2018-01-23 12:58 PM
Hi,
I am using the STEVAL-IHM041V1 demo board to develop my own application. The mcu
is STM8S103F3P6. I checked the EEPROM locations to verify that the EEPROM read/writeare fine when the +5V is stable. But I have problem trying to save the last data settings to EEPROM after the power has been removed. The EEPROM write is happening before the +5V drops below 3V(BOR voltage). But it didn't work and I didn't get thelast saved data from EEPROM read once the board is powered up again. Why? Does anyoneexperience similar problem?2018-01-24 01:03 AM
Hello,
When the EEPROM is used, the MCU need time to realize the write.
Can you test, with the same test, but adding 50 ms before you cut the power supply ?
Add capacitor to help the MCU to realize the operation.
Also, use the redundancy by write your data + checksum + timestamp in a section.
For example : For 10 bytes data, I use 2 bytes for checksum and 4 bytes for timestamp. So I need 16 bytes for each save. I use 64 bytes section of EEPROM and I have than 4 locations that I used in circular mode. I never lost all my data.
2018-02-01 09:27 AM
Sebastien B,
Thanks for your reply! I found the cause of my EEPROM Read/Write problem. It takes a lot longer than I think to write the EEPROM so my Watchdog resets the cpu. The datasheet says it takes 6mS to write 4 bytes but my tests showed it
takes 20mS at 1MHz CPU clock. Anyway, it is working now. Thanks!
Sam