cancel
Showing results for 
Search instead for 
Did you mean: 

Storing Data in EEPROM on the STM8S003k3

KRiaz.1
Associate II

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?

1 REPLY 1
AA1
Senior III

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.