SW500009 Microchip Technology, SW500009 Datasheet - Page 199

HI-TECH FOR DSPIC/PIC24

SW500009

Manufacturer Part Number
SW500009
Description
HI-TECH FOR DSPIC/PIC24
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC24 & DsPICr
Datasheet

Specifications of SW500009

Supported Families
PIC24
Core Architecture
PIC, DsPIC
Software Edition
Standard
Kit Contents
Software And Docs
Tool Type
Compiler
Mcu Supported Families
PIC24 MCUs And DsPIC DSCs
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
DSPIC3X/PIC24
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
025
778-1003
778-1003
Library Functions
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.
#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);
185

Related parts for SW500009