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

EEPROM segmenting on AT89S8253

Microcontroler AT 89S8253 is equiped with 2K on chip EEPROM. This is mapped to X data space.
There is feature Page Mode Write, having possibilities to write 32 byte segment in one cycle. Can I force compiller to define variables in this space inside 32Bytes segments? It means to block compiler put long variables over border. For example one byte of INT at 0x1F and second at 0x20. How to block it.
Best regard
Jaro

Parents Reply Children
  • Thank for your answer. That solution is clear, but still asking me to take care about variables. My idea was put this work on compiler

  • You can use the at keyword of the C51 compiler to specify a location for a variable. Note that you cannot do this and specify an initializer at the same time.

    You can also use linker directives to locate your variables, which is the more traditional way to do so. See the SEGMENTS directive, or CODE / XDATA / DATA / etc for BL51.

    If you don't care about locations of individual variables, then perhaps the easiest thing do to is put all of your EEPROM variables into one .c file, so that they all appear in a single segment, and then tell the linker where you'd like that segment to appear. You also might declare a struct to match the layout of your EEPROM area.