Specifications

Chapter 2 - Microcontroller PIC16F84
Previous page Table of contents Chapter overview Next page
2.8 EEPROM Data memory
PIC16F84 has 64 bytes of EEPROM memory locations on addresses from 00h to 63h those can be
written to or read from. The most important characteristic of this memory is that it does not loose
its contents during power supply turned off. That practically means that what was written to it will
be remaining even if microcontroller is turned off. Data can be retained in EEPROM without power
supply for up to 40 years (as manufacturer of PIC16F84 microcontroller states), and up to 10000
cycles of writing can be executed.
In practice, EEPROM memory is used for storing important data or some process parameters.
One such parameter is a given temperature, assigned when setting up a temperature regulator to
some process. If that data wasn't retained, it would be necessary to adjust a given temperature
after each loss of supply. Since this is very impractical (and even dangerous), manufacturers of
microcontrollers have began installing one smaller type of EEPROM memory.
EEPROM memory is placed in a special memory space and can be accessed through special
registers. These registers are:
EEDATA at address 08h, which holds read data or that to be written.
EEADR at address 09h, which contains an address of EEPROM location being accessed.
EECON1 at address 88h, which contains control bits.
EECON2 at address 89h. This register does not exist physically and serves to protect EEPROM
from accidental writing.
EECON1 register at address 88h is a control register with five implemented bits.
Bits 5, 6 and 7 are not used, and by reading always are zero. Interpretation of EECON1 register
bits follows.
EECON1 Register
bit 0 RD (Read Control bit)
Setting this bit initializes transfer of data from address defined in EEADR to EEDATA register. Since
time is not as essential in reading data as in writing, data from EEDATA can already be used
further in the next instruction.
1=initializes reading
0=does not initialize reading
bit 1 WR (Write Control bit)
Setting of this bit initializes writing data from EEDATA register to the address specified trough
EEADR register.
1=initializes writing
0=does not initialize writing
bit 2 WREN (EEPROM Write Enable bit) Enables writing to EEPROM
If this bit was not set, microcontroller would not allow writing to EEPROM.
1=writing allowed
http://www.mikroelektronika.co.yu/english/product/books/PICbook/2_09Poglavlje.htm (1 of 3) [4/2/2003 16:18:00]