Monday 31 August 2015

pic - Can the microcontroller program flash memory be used for storing user configuration?


Many microcontrollers, e.g. PIC18F, have flash program memory: "The Flash program memory is readable and writable during normal operation". Does this mean I can store some user configurations in the program memory?



Answer



Yes, you can. I have done this many times.


However, there are some drawbacks relative to using separate EEPROM:



  1. The number of lifetime writes to program flash memory is significantly less than data EEPROM.

  2. The processor will go out to lunch during the erase and write times.

  3. Program flash is erased in blocks. You can't just update a single byte. I usually use a block caching scheme to deal with this.



No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...