neethumini
Newbie level 2
i have a problem eeprom writing in at89s8253.
the rading of eeprom works well but i can't rewrite the eeprom.
the writing updation is not working.
my code to write to eeprom is given below.
plz help me
void ieem_WrByte(unsigned int adr, unsigned char val)
{ Ext_int_off;
EECON|= (EEMEN_ | EEMWE_ |EELD_);
XBYTE[adr] = val;
while ((EECON & RDY_) == 0)
EECON &= ~(EEMWE_ | EEMEN_);
Ext_int_on;
}
i am using byte writing mode
the rading of eeprom works well but i can't rewrite the eeprom.
the writing updation is not working.
my code to write to eeprom is given below.
plz help me
void ieem_WrByte(unsigned int adr, unsigned char val)
{ Ext_int_off;
EECON|= (EEMEN_ | EEMWE_ |EELD_);
XBYTE[adr] = val;
while ((EECON & RDY_) == 0)
EECON &= ~(EEMWE_ | EEMEN_);
Ext_int_on;
}
i am using byte writing mode