??? 05/12/05 20:55 Read: times |
#93357 - AT89c51ED2 EEPROM problem. |
I have been tring to use the EEPROM built into the ED2.
I know you have to set EECON(0xd2) to 0x02 to switch the movx command over to EEPROM. here is the latest incarnation of my code: I use SDCC and 'byte_read' is a global variable. //****************************************************************** //* Write EEPROM //****************************************************************** void WriteEE(unsigned int Addr,unsigned char Data) { Addr; Data; while(EECON & 1){}; //check the EEBUSY bit EECON=2; _asm mov acc,b movx @dptr,a _endasm; EECON=0; } //****************************************************************** //* Read EEPROM //****************************************************************** unsigned char ReadEE(unsigned int Addr) { Addr; while(EECON & 1){}; //check the EEBUSY bit EECON=2; _asm movx a,@dptr mov _byte_read,a _endasm; EECON=0; return byte_read; } |
Topic | Author | Date |
AT89c51ED2 EEPROM problem. | 01/01/70 00:00 | |
what is this | 01/01/70 00:00 | |
re:what is this. | 01/01/70 00:00 | |
Also Tried | 01/01/70 00:00 | |
So..![]() | 01/01/70 00:00 |