mikroElektronika PIC Microcontrollers PIC12 User Manual page 181

Mikroc user's manual
Table of Contents

Advertisement

mikroC
making it simple...
Eeprom_Read
Prototype
void Eeprom_Write(char address, char data);
Description
Writes data to the specified address. Parameter
can address only 256 locations. For PIC18 micros with more EEPROM data locations, it
is programmer's responsibility to set SFR EEADRH register appropriately.
Be aware that all interrupts will be disabled during execution of EEPROM_Write rou-
tine (GIE bit of INTCON register will be cleared). Routine will set this bit on exit.
Requires
Requires EEPROM module.
Ensure minimum 20ms delay between successive use of routines
Eeprom_Read
an undefined result.
Example
Eeprom_Write(0x32);
Library Example
unsigned short i = 0, j = 0;
void main() {
PORTB = 0;
TRISB = 0;
j = 4;
for (i = 0; i < 20u; i++)
Eeprom_Write(i, j++);
for (i = 0; i < 20u; i++) {
PORTB = Eeprom_Read(i);
Delay_ms(500);
}
}//~!
MikroElektronika: Development tools - Books - Compilers
mikroC - C Compiler for Microchip PIC microcontrollers
. Although PIC will write the correct value,
is of byte type, which means it
address
Eeprom_Write
Eeprom_Read
and
might return
page
173

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents