2023-06-20 10:14 PM
Hi Everyone,
I am using stm8s003k3 in one of my projects. I want to store a variable containing a number from 0 to 999 in EEPROM but the issue is FLASH_ProgramByte & FLASH_ReadByte can only store a number up to 256. I tried to use FLASH_ProgramWord but I found don't know how to read a whole word as there is no alternative to FLASH_ReadByte for ProgramWord.
I need to store 8 different variables so I cannot program each byte of 999 digits and then read all of them because in this way I need 24 variables and my code length increases.
Can anyone suggest a better way how to read a whole word?
2023-06-21 05:48 AM
You can read from EEPROM directly as you read from a peripheral, use the address.
You store in EEPROM bytes in binary. And you can join the variables in a struct.