This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to save data to ROM?

hello, is it necessary to erase the ROM before we write any data to it? or its required that i erase that particular segment where i want to write before writing to it?

also, how to write a program for writing data to ROM and then reading it?

thanks in advance,

  • You specify the contents of a ROM. Send that to the chip manufacturer and they will do the rest. ... Just kidding.

    You are asking about Flash memory. Flash is normally Read Only, but you can tell the Flash-controller to "erase" or "write".

    During "write", a bit that is currently "1" can be changed to "0". If a bit is currently "0", it cannot be changed to "1" with "write" operation.

    During "erase", all bits are changed to "1". But you cannot "erase" a single bit, byte, or word. You have to "erase" at least an entire segment (usually 512 byte) in one single "erase".

    Details of what to tell the Flash-controller are in the User's Guide. Simple examples can also be found in code examples.

  • old cow yellow, here is what i intend to do. i would like to save some count values onto ROM and then later; read those count values. i understand what you say, but my question is, is it necessary to erase the entire ROM to write only 1 segment of it. The code that I am working on has a flow like this:

    1. Init -- save calibration and information constants onto ROM(these constants are different from TI calibration and info constants)

    2. save ADC data onto external FLASH memory, after the memory is full, save the count values onto ROM

    3. when reading data from external FLASH memory, use the count values to limit the counter loop.

    i do not want to erase the data that I wrote at init, but also want to save the count values and utilize them. can you please help what should be my approach?

  • Funny1234 Guy said:
    is it necessary to erase the entire ROM to write only 1 segment of it.

    No, but it is necessary to erase a whole segment to write a single '1' bit when there was a '0' bit before. One segment being 64 to 512 bytes (512 bytes for main flash, 64 to 256 bytes for info flash)

    The MSP has mroe than one info segment. On most MSPs there are 4, son some only 2. You can save the calibration and information data into one segment, and the cound values into another segment. Then you don't have to touch the info data at all.
    On MSPs with only two info segment,s ou should merge the info dat awith the original calibration data once.

**Attention** This is a public forum