| ??? 07/10/07 12:18 Read: times |
#141672 - Some ideas Responding to: ???'s previous message |
Rick:
in this thread I posted a suggested circuit for AT89S8253: http://www.8052.com/forum/read.phtml?id=132901 The AT89S8252 dos not show power up problem, so you could use the /POWER_OK part only. The idea is checking /POWER_OK low before starting any EEPROM writing cycle. The 1000uF cap. should give time enought to finish the cycle. This is some possible code for writing one byte a time:
void write_EEPROM(unsigned char dato,unsigned char xdata *add){
if(_POWER_OK==FALSE){
WMCON=WMCON|EEMWE_; // EEMWE high
ET2=FALSE; // stop interrupts
*add=dato; // start writing
while((WMCON&WDTRST_)==0); // wait WDTRST=1 (2.5ms)
ET2=TRUE; // restart interrupts
WMCON=WMCON&(~EEMWE_); // EEMWE low
}
}
Disabling interrupts is important: if an ISR tries to read EEPROM while being written (even a different address) the result is wrong. So, disable interrupts before writing, unless the ISR does not use EEPROM at all. Although I do not have reset problems (and I use simple RC) it is a good idea to use a dedicated reset chip. Daniel |
| Topic | Author | Date |
| AT89S8252 EEPROM | 01/01/70 00:00 | |
| More Info. | 01/01/70 00:00 | |
| Have the same problem... | 01/01/70 00:00 | |
| AT89s8252 EEPROM | 01/01/70 00:00 | |
| Reset | 01/01/70 00:00 | |
| Some ideas | 01/01/70 00:00 | |
| AT89s8252 EEPROM | 01/01/70 00:00 | |
| EPROM reading | 01/01/70 00:00 | |
| AT89s8252 | 01/01/70 00:00 | |
| YES | 01/01/70 00:00 | |
| 7705 is rather old... | 01/01/70 00:00 | |
| AT89S8252 EEPROM | 01/01/70 00:00 | |
| you already did | 01/01/70 00:00 | |
the ol' trick is... | 01/01/70 00:00 |



