- This topic has 1 reply, 2 voices, and was last updated 11 years ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › SDCC Read/Write EEPROM At89c51ed2
Hi!
I am using the Mic At89c51ed2 and programing with SDCC. This device have 2k of a internal eeprom. But I have Problems ta acess this eeprom…
I wrote the code like this:
unsigned char __xdata __at(0x00) texto; //creating a variable texto
//to read th eprom I wrote a code like this
EA = 0; //turn off the interrupts
EEE = 1; //Active the EEE bit of ECON register, to read texto in the eeprom
data = texto; //read the EEPROM in the position 01
EEE =0; //turn off the EEE bit of ECON register
EA = 1; //turn ON the interrupts
//to write th eprom I wrote a code like this
EA = 0; //turn off the interrupts
EEE = 1; //Active the EEE bit of ECON register, to read texto in the eeprom
texto = data; //write the EEPROM in the position 01
EEE =0; //turn off the EEE bit of ECON register
EA = 1; //turn ON the interrupts
But this dont work, the data don’t remains… In other words, the data is not write/read in the eeprom…
In the begining of the code, I am using “xdata” to access the external memory and “Set” the “EEE” to write in the eeprom. You know a diferente sentence of Storage Class Extensions to create variables in the internal eeprom? Someone can Help me?
Thanks,
Rafael Lopes
you haven’t interfaced any LCD to the circuit??