Storing Samples in EEPROM

The diagram below shows each bank in EEPROM memory. The first ten bytes of EEPROM contain samples of the phase 3 voltage output, and the next six EEPROM bytes are unused. Although six EEPROM bytes per group are "wasted" by not writing to them, addressing the EEPROM space this way is easier to understand and handle programmatically.

The Phase 2, Phase1, and Rectified Output Samples, ten each, follow similarly. Each of the four sample groups within each bank is separated by sixteen bytes, or $10 in hexadecimal. Each bank is separated from one another by 64 bytes, or $40 in hexadecimal. Each time a new set of samples is taken, the data is written to a new bank. This spreads the writes to the EEPROM out over a larger area, thus conserving the writeable lifecycle of each EEPROM byte.

Figure 6-11: EEPROM Memory Allocation For Variables

All addresses are in hexadecimal. Shaded areas indicate sample storage, and unshaded areas are unused.

Solar Power

Solar Power

Start Saving On Your Electricity Bills Using The Power of the Sun And Other Natural Resources!

Get My Free Ebook


Post a comment