MSP430G2553: Using MCU's flash memory

Part Number: MSP430G2553

Tool/software:

Hello everyone!

I was searching for informations about using flash memory to store and recover data on mcu's user guide (SLAU 144k).

In this document, it is said that the only form of reading is using MRG0 and MRG1 bits of FCTL4 register, technique called marginal reading.

 

However, exploring the msp430g2553.h file, I did not found the implementation of FCTL4 register.

Is there a way to read from the flash using this microcontroller?

Thank you in advance!

  • You can read from the flash memory just as easy as from SRAM. The CPU does it every time it fetches an instruction.

    Writing is more involved because you have to erase a segment of memory in order to write to it. There is a block of flash, information memory, which is available for user data and is separate from the program memory. Also used by some devices to store calibration data so check the documentation and don't write over that.

    That marginal read mode stuff is to find if the flash write didn't work as well as expected.

  • Thanks for your reply.

    Do you have any link with code and/or a user guide reference to dig up more about the topic?

    Any help is appreciated!

  • The guide has a long section on the topic.

    The package of code examples includes one for flash write.

**Attention** This is a public forum