Writing float to EEPROM
Hello Guys,
I have a AT24CM02 EEPROM which uses I2C to communicate with a STM32H7 MCU.
I need to store some float values into the EEPROM, but I do not know how.
I appreciate any suggestions.
Thank you and best regards,
Vouria
Hello Guys,
I have a AT24CM02 EEPROM which uses I2C to communicate with a STM32H7 MCU.
I need to store some float values into the EEPROM, but I do not know how.
I appreciate any suggestions.
Thank you and best regards,
Vouria
If you build a EEPROM write block which deals with EEPROM pages internally (not the case in F/M/RAM), it would be more generic
Then if you just save/retrieve data in EEPROM, use sizeof(my_variable) to get its size in bytes.
This way you can backup float, double, struct, anything without worry.
Please also note that EEPROM needs time after write a page or by polling the ACK bit of the EEPROM at the right time.
With a little extra effort in the early stage, the foundation will be more rugged.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.