SW500010 Microchip Technology, SW500010 Datasheet - Page 220

HI-TECH C PRO FOR PIC10/12/16

SW500010

Manufacturer Part Number
SW500010
Description
HI-TECH C PRO FOR PIC10/12/16
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC10/12/16r
Datasheets

Specifications of SW500010

Supported Families
PIC10, PIC12, PIC16
Core Architecture
PIC
Software Edition
Professional
Kit Contents
Software And Docs
Mcu Supported Families
PIC10/12/16
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC10, PIC12, PIC14, PIC16, PIC16E
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
019P
778-1006
778-1006
EEPROM_READ, EEPROM_WRITE
Synopsis
Description
These function allow access to the on-chip eeprom (when present). The eeprom is not in the directly-
accessible memory space and a special byte sequence is loaded to the eeprom control registers to
access the device. Writing a value to the eeprom is a slow process and the eeprom_write() function
polls the appropriate registers to ensure that any previous writes have completed before writing the
next datum. Reading data is completed in the one cycle and no polling is necessary to check for a
read completion.
Example
Note
It may be necessary to poll the eeprom registers to ensure that the write has completed if an eep-
rom_write() call is immediately followed by an eeprom_read(). The global interrupt enable bit
(GIE) is now restored by the eeprom_write() routine. The EEIF interrupt flag is not reset by this
function.
220
#include <htc.h>
unsigned char eeprom_read (unsigned char addr);
void eeprom_write (unsigned char addr, unsigned char value);
#include <htc.h>
void
main (void)
{
}
unsigned char data;
unsigned char address;
address = 0x10;
data = eeprom_read(address);
Library Functions

Related parts for SW500010