Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interfacing eeprom 16f877a

Status
Not open for further replies.

maria_100784

Newbie level 6
Joined
Nov 19, 2011
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,371
First off all Hi. My name is Maria and i-m new to microcontrollers. I have a project made in ASM unsing MPLAB with the 16f877a controller. The device forwards the serial data from a gps module and send it trough the RS232 port on PC , at a speed of 57600 ,over a FTDI cable in real time. What i want to do is to change the code ,instead of sending the data via UART, to save it on a 24c1024b EEPROM. So i have the following code:
Code:
WaitSend
	btfss	TXSTA,TRMT	;Wait to finish transmission
	goto	WaitSend
	call	Bank0
	movf	d1,w
	movwf	TXREG
	return
So..i need a way to take the data from the TXREG register and put it in eeprom . Hope somebody understands what i want to realise. Thanks.
 

Hi,

If you follow the code the ' movf d1,w ' this moves the data held in d1 into W to be passed to the TX REG for transmission, so your data is already there, saved.

So when, I assume, the data from the gps module is stored in d1, then thats the time to write it to eeprom.
You have some eeprom on the 877A chip but for large amounts of data you have to use the external eeprom you mention though it uses a different serial protocol to the serial RS232.

The Pic chip has an SPI serial protocol but I do not know if that is exactly compatible with the ATmel eeprom chip ? - perhaps your tutor is testing you there ?
 

hmm..i-m not bound to SPI . I could use I2C also...i need some sort or routine to move the data from "d1" in the external eeprom. Thanks
 

Hi,

The pic has all sort of protocols, its what the Atmel eeprom chip uses that determines the code you need to program up.
Microchip do their own spi and i2c eeproms to match their pic chips.
Does that Atmel chip match either of those protocols ?? - if not you probably need to code you own custom protocol, assuming you must use that Atmel chip..?

Assembler is not like C, you have to create your own 'modules' , there is no ready made Assembler library, though you might be able to 'borrow' parts of other folks code.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top