Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/16/02 21:37
Read: times


 
#25909 - RE: AT89S8252
Here is some C code that I used for reading and writing to the internal EEPROM of the AT89S8252.

char eeprom_read(unsigned int addr)
{
char eeprom_data = 0;
eeprom_data = (*(char xdata *)addr);
return eeprom_data;
}

void eeprom_write(char data_value, unsigned int addr)
{
WMCON |= 0x10; // Set the EEMWE bit to start a write to EEPROM.
(*(char xdata *) addr) = data_value;
WMCON &= ~0x10; // Clear the EEMWE bit to finish write.
}

Hope this helps.

List of 7 messages in thread
TopicAuthorDate
AT89S8252            01/01/70 00:00      
RE: AT89S8252            01/01/70 00:00      
RE: AT89S8252            01/01/70 00:00      
RE: AT89S8252            01/01/70 00:00      
RE: AT89S8252            01/01/70 00:00      
RE: AT89S8252            01/01/70 00:00      
RE: AT89S8252            01/01/70 00:00      

Back to Subject List