User manual

344
mikoC PRO for dsPIC
MikroElektronika
EEPROM_Erase
EEPROM_Erase_Block
EEPROM_Read
Prototype
void EEPROM_Erase(unsigned long address);
Description Erases a single (16-bit) location from EEPROM memory.
Parameters - address: address of the EEPROM memory location to be erased.
Returns Nothing.
Requires Nothing.
Example
unsigned long eeAddr = 0x7FFC80;
...
EEPROM_Erase(eeAddr);
Notes CPU is not halted for the Data Erase cycle. The user can poll WR bit, use NVMIF or Timer IRQ to
detect the end of erase sequence.
Prototype
void EEPROM_Erase_Block(unsigned long address);
Description Erases one EEPROM row from EEPROM memory; For dsPIC30 family it is 16 words long, for
24F04KA201 and 24F16KA102 family it is 8 words long.
Parameters - address: starting address of the EEPROM memory block to be erased.
Returns Nothing.
Requires Nothing.
Example
unsigned long eeAddr = 0x7FFC20;
...
EEPROM_Erase_Block(eeAddr);
Notes CPU is not halted for the Data Erase cycle. The user can poll WR bit, use NVMIF or Timer IRQ to
detect the end of erase sequence.
Prototype
unsigned int EEPROM_Read(unsigned long address);
Description Reads data from specied address.
Parameters - address: address of the EEPROM memory location to be read.
Returns Word from the specied address.
Requires It is the user’s responsibility to obtain proper address parity (in this case, even).
Example
unsigned long eeAddr = 0x7FFC20;
unsigned int temp;
...
temp = EEPROM_Read(eeAddr);
Notes None.