How Do You Write a Single Variable to Flash?

I'm using a C167 chip, I need to save just a single variable to Flash. The value will be used as part of a configuration parameter. Is there a nice simple way of using Flash to save just a single variable? Thanks

Parents
  • The trouble with Flash for data storage is that you can't generally erase individual locations - you have to erase a whole sector.

    Also, flash tends to have only a relatively limited number of erase cycles.

    Therefore, you might want to consider alternatives; eg, EEPROM, FRAM,...

    For details of erasing & programming your particular flash chip, you will have to read the Data Sheet.
    You will probably find example code on the manufacturer's website.

Reply
  • The trouble with Flash for data storage is that you can't generally erase individual locations - you have to erase a whole sector.

    Also, flash tends to have only a relatively limited number of erase cycles.

    Therefore, you might want to consider alternatives; eg, EEPROM, FRAM,...

    For details of erasing & programming your particular flash chip, you will have to read the Data Sheet.
    You will probably find example code on the manufacturer's website.

Children
More questions in this forum