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 CCS Technical Support

How to store in EEPROM of PIC16F886

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



Joined: 18 Jun 2012
Posts: 19

View user's profile Send private message

How to store in EEPROM of PIC16F886
PostPosted: Sat Jul 07, 2012 11:32 pm     Reply with quote

Till date I have implemented the things. Reading keypad, storing into array and then comparing the two array. Now I want to store this array data, that is password in EEPROM of PIC16F886, since this controller has 256 byte of EEPROM built in. I read CCS C help files and other code. I have some questions, please suggest.

What is the use of #ROM?
I did not understand this, please give some example.

To write into internal EEPROM.
write_eeprom(address, value)

To read from internal EEPROM.
read_eeprom(address)

After reading keypad I am getting ASCII value of keys, say after pressing 1 I will get ASCII value of 1. So how I will write to eeprom.
Like this.
write_eeprom(0, digit[i]), will use loop. Any change is required in format of number to store in eeprom.
Like wise reading from eeprom.

Another thing, when eeprom writing is going on we have to wait in code, right? We have to wait to finish writing of eeprom, so how to implement this. Can please anybody give code or example.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sun Jul 08, 2012 3:55 am     Reply with quote

Most of what you want is in the CCS manual and the CCS examples folder.

Quote:
Another thing, when eeprom writing is going on we have to wait in code, right? We have to wait to finish writing of eeprom, so how to implement this. Can please anybody give code or example.

The Microchip data sheets relating to EEPROM suggest disabling interrupts to prevent other activity during the write phase:-
Quote:
The write will not initiate if the above sequence is not
exactly followed (write 55h to EECON2, write AAh to
EECON2, then set WR bit) for each byte. We strongly
recommend that interrupts be disabled during this
code segment.

Other than that, the write_eeprom(address , data) function sits there till it's done.

Mike
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