|
|
View previous topic :: View next topic |
Author |
Message |
zeroskj1988
Joined: 07 Jul 2011 Posts: 5 Location: kochi
|
16f873A eeprom error |
Posted: Wed Nov 02, 2011 3:52 am |
|
|
Hello sir, I am using pic16f873a eeprom to store value. In ccs compiler I write program like this
Code: |
ROM 0x2100={35,27}
hc=read_eeprom(0);
lc=read_eeprom(1);
to read eeprom
write_eeprom(0,hc);
write_eeprom(1,lc);
to write eeprom
|
When i complete one cycle of this operation, i am not able to read the lc value, but no problem eith reading of hc.
Can anybody point out what is the problem with this program. Thanks in advance. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19510
|
|
Posted: Wed Nov 02, 2011 4:37 am |
|
|
Since you don't post a program, not much we can say!.....
However:
Code: |
#include <16F873A.h>
#FUSES NOWDT,HS,NOBROWNOUT,PUT,NOLVP
#use delay(clock=20000000)
#use RS232 (UART1,BAUD=9600,ERRORS)
#ROM 0x2100={35,27}
void main() {
int8 hc,lc;
hc=read_eeprom(0);
lc=read_eeprom(1);
printf("hc= %3d lc=%3d\n\r",hc,lc);
do {
}
while (TRUE);
}
|
Happily displays:
You need to look at details. For instance, the ROM statement, is #ROM, not ROM as you post. Remember also, (you don't show how you are using them), what might have changed variables, so they don't do what you expect.
Best Wishes |
|
|
|
|
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
|