View previous topic :: View next topic |
Author |
Message |
julien lochen
Joined: 16 May 2008 Posts: 14
|
how to use the EEPROM of the micro |
Posted: Mon Jun 30, 2008 9:19 am |
|
|
Hello,
I work with the PIC16F886.
I have:
- FLASH mem: 8192 words
- SRAM: 368 bytes
- EEPROM: 256 bytes
How to store in C a variable in the EEPROM ? |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Jun 30, 2008 9:30 am |
|
|
RTFM?
Page 54 of the manual: 'Data Eeprom' gives an overview of all relevant functions. Look up the functions to find more info and examples. |
|
|
Guest
|
|
Posted: Mon Jun 30, 2008 1:40 pm |
|
|
Syntax:
write_eeprom (address, value)
Parameters:
address is a (8 bit or 16 bit depending on the part) int, the range is device dependent
value is an 8 bit int
Returns:
undefined
Function:
Write a byte to the specified data EEPROM address. This function may take several milliseconds to execute. This works only on devices with EEPROM built into the core of the device.
For devices with external EEPROM or with a separate EEPROM in the same package (line the 12CE671) see EX_EXTEE.c with CE51X.c, CE61X.c or CE67X.c.
Availability:
This function is only available on devices with supporting hardware on chip.
Requires:
Nothing
Examples:
#define LAST_VOLUME 10 // Location in EEPROM
volume++;
write_eeprom(LAST_VOLUME,volume);
Example Files:
ex_intee.c, ex_extee.c, ce51x.c, ce62x.c, ce67x.c
Also See:
read_eeprom(), write_program_eeprom(),
read_program_eeprom(), data eeprom overview |
|
|
|