|
|
View previous topic :: View next topic |
Author |
Message |
AD76XYZ
Joined: 18 Jun 2012 Posts: 19
|
How to store in EEPROM of PIC16F886 |
Posted: Sat Jul 07, 2012 11:32 pm |
|
|
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
|
|
Posted: Sun Jul 08, 2012 3:55 am |
|
|
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 |
|
|
|
|
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
|