| ??? 06/14/02 08:35 Read: times |
#24458 - RE: using AT89S8252\'s memory in C |
Hi Martijn,
I assume you are talking about the EEPROM memory. 1. Declare your integers as unions, this will make writing a lot easier. 2. They must be declared as XDATA. 3. Before any (read or write) access to EEPROM the EEMEN bit in the WMCON sfr must be set. 4. Before writing, the EEMWE bit also must be set. 5. After writing a byte, check the RDY/nBSY flag in WMCON. Writing is complete when the bit is '1'. 6. Don't forget to reset the EEMEN and EEMWE bits. In pseudocode: Read: EEMEN = 1; some_intVar = EEPROMintVar; next_intVar = EEPROMintVar2; EEMEN = 0; Write: EEMEN = 1; EEMWE = 1; EEPROMintVar.H = HIGH(newvalue); while(RDY/nBSY == 0); EEPROMintVar.L = LOW(newvalue); while(RDY/nBSY == 0); EEMWE = 0; EEMEN = 0; Best regards, Rob. |
| Topic | Author | Date |
| using AT89S8252's memory in C | 01/01/70 00:00 | |
| RE: using AT89S8252\'s memory in C | 01/01/70 00:00 | |
| RE: using AT89S8252\'s memory in C | 01/01/70 00:00 | |
| RE: using AT89S8252\'s memory in C | 01/01/70 00:00 | |
| RE: using AT89S8252\'s memory in C | 01/01/70 00:00 | |
RE: using AT89S8252\'s memory in C | 01/01/70 00:00 |



