SW500009 Microchip Technology, SW500009 Datasheet - Page 47

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
C Language Features
3.2.5.3 EEPROM Access Functions
The library functions eeprom_read() and eeprom_write(), can be called to read from, and write to
the EEPROM during program execution. For example, to write a byte-size value to an address in
EEPROM and retrieve it using these fuctions would be:
These functions test and wait for any concurrent writes to EEPROM to conclude before performing
their required operation. The eeprom_write() function will initiate the process of writing to EEP-
ROM and this process will not have completed by the time that eeprom_write() returns. The new data
written to EEPROM will become valid approximately four milliseconds later. In the above example,
the new value will not yet be ready at the time when eeprom_read() is called, however because this
function waits for any concurrent writes to complete before initiating the read, the correct value will
be read.
3.2.5.4 EEPROM Access Macros
Although these macros perform much the same service as their library function conterparts, these
should only be employed in specific circumstances. It is appropriate to select EEPROM_READ or
EEPROM_WRITE in favour of the library equivalents if any of the following conditions are true:
#include <htc.h>
void eetest(void){
}
It may also be convenient to use the preprocessor symbol, _EEPROMSIZE in conjunction
with some of these access methods. This symbol defines the number of EEPROM bytes
available for the selected chip.
You cannot afford the extra level of stack depth required to make a function call
You cannot afford the added code overhead to pass parameters and perform a call/return
You cannot afford the added processor cycles to execute the function call overhead
unsigned char value = 1;
unsigned char address = 0;
eeprom_write(address,value); // Initiate writing value to address
value = eeprom_read(address); // read from EEPROM at address
Processor-related Features
33

Related parts for SW500009