Specifications
mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 8: Other MCU's Circuits
● EECON1 (control register);
● EECON2 (control register);
● EEDAT (saves data ready for write and read); and
● EEADR (saves address of EEPROM location to be accessed).
In addition, EECON2 is not true register, it does not physically exist. It is used in write program sequence only.
The EEDATH and EEADRH registers belong to the same group as the registers used during EEPROM write and read. Both of
them are therefore used for program (FLASH) memory write and read.
Since this is considered a risk zone (you surely do not want your microcontroller to accidentally erase your program), we
will not discuss it further, but advise you to be careful.
EECON1 Register
Fig.8-18 EECON1 Register
EEPGD - Program/Data EEPROM Select bit
● 1 - Access program memory; and
● 0 - Access EEPROM memory.
WRERR - EEPROM Error Flag bit
● 1 - Write operation is prematurely terminated and error has occurred; and
● 0 - Access EEPROM memory.
WREN - EEPROM Write Enable bit.
● 1 - Write to data EEPROM enabled; and
● 0 - Write to data EEPROM disabled.
WR - Write Control bit
● 1 - Initiates write to data EEPROM; and
● 0 - Write to data EEPROM is complete.
RD - Read Control bit
● 1 - Initiates read from data EEPROM; and
● 0 - Read from data EEPROM disabled.
Read from EEPROM Memory
http://www.mikroe.com/en/books/picmcubook/ch8/ (12 of 15)5/3/2009 11:34:45 AM