This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Flash read & write

Hello friends I want to define 32bit(4 byte) value as a constant in flash.
How to access it within a programm written in 'C' for 8051 microcontrolller.
Please suggest me any solution.

Parents
  • By the way - your subject line says "read & write", while your message says "constant".

    There are no general way for a program to write to the code memory. Some specific 8051 chips have methods, but only you know what model you are going to use - you didn't seem to think supplying the chip model was important for this thread.

    Another thing is that the code memory can't normally modify just 4 bytes, even if the chip do support in-application programming (IAP) of the flash memory. And there are also limitations on how many times such a processor can rewrite a flash sector because of wear. And of course it isn't too good if the same flash sector both contains a constant that should be changed, and real code, unless you can make sure that the program never tries to run that code while you reprogram the sector.

    Some 8051 processors have internal EEPROM memory, which is sometimes better suited for storing of configuration data that may have to be changed in field.

Reply
  • By the way - your subject line says "read & write", while your message says "constant".

    There are no general way for a program to write to the code memory. Some specific 8051 chips have methods, but only you know what model you are going to use - you didn't seem to think supplying the chip model was important for this thread.

    Another thing is that the code memory can't normally modify just 4 bytes, even if the chip do support in-application programming (IAP) of the flash memory. And there are also limitations on how many times such a processor can rewrite a flash sector because of wear. And of course it isn't too good if the same flash sector both contains a constant that should be changed, and real code, unless you can make sure that the program never tries to run that code while you reprogram the sector.

    Some 8051 processors have internal EEPROM memory, which is sometimes better suited for storing of configuration data that may have to be changed in field.

Children