CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

how to use the EEPROM of the micro

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
julien lochen



Joined: 16 May 2008
Posts: 14

View user's profile Send private message

how to use the EEPROM of the micro
PostPosted: Mon Jun 30, 2008 9:19 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jun 30, 2008 9:30 am     Reply with quote

RTFM? Confused

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








PostPosted: Mon Jun 30, 2008 1:40 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group