pic_data_eeprom

reading/writing of PIC's data EEPROM

Author Stef Mientki, Copyright © 2002..2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling, Joep Suijs (on behalf of Tijs van Roon).
Compiler 2.4o

Description

Read from or write to EEPROM/data a byte, word or double word.
Available procedures:
  * data_eeprom_read(,)
  * data_eeprom_write(,)
  * data_eeprom_read_word(,)
  * data_eeprom_write_word(,)
  * data_eeprom_read_dword(,)
  * data_eeprom_write_dword(,)
Available functions:
  *   = data_eeprom()
  *   = data_eeprom_word()
  *  = data_eeprom_dword()
In all cases  is a word containing the position relative to
the beginning of EEPROM/data memory.
Examples of use:
  * Read a byte of EEPROM at offset 7 into x:
        var byte x
        data_eeprom_read(7, x)
  * Read a word from EEPROM at offset 4 into y:
        var word y
        y = data_eeprom_word(4)
  * Write a byte to EEPROM at offset 18:
        data_eeprom_write(18, 0b1111_0000)


Notes

- Write-protect bits in configuration memory may prohibit writing.
- Writing to locations outside the available memory range may have
  unexpected effects!
- Summary of changes
  + Changed byte-offset to word-offset for larger EEPROMs with 18Fs
  + Offset and flags settings for read and write in separate procedure.
  + Moved check for write completed ahead of read and write, for
    performance (ahead of read needed for read back of same offset).
  + added 'pragma inline' to several procedures
  + some other code optimizations
  + added support for PICs with deviating register names, like 'EEDAT'
    or EEDATL in stead of 'EEDATA' and EEADRL in stead of EEADR.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_data_eeprom.jal
16f876a16f876a_rtc_timeset.jal
16f87716f877_data_eeprom.jal
16f877a16f877a_rtc_timeset.jal
16f877a16f877a_data_eeprom.jal
16f8816f88_data_eeprom.jal
16f8816f88_remember_me.jal
18f14k5018f14k50_data_eeprom.jal
18f252018f2520_data_eeprom.jal
18f255018f2550_data_eeprom.jal
18f262018f2620_data_eeprom.jal
18f45218f452_data_eeprom.jal
18f455018f4550_data_eeprom.jal
18f462018f4620_data_eeprom.jal
18f672218f6722_data_eeprom.jal