|
|
View previous topic :: View next topic |
Author |
Message |
Invisible Guest
|
16F628 e2p writing problem |
Posted: Wed Jan 22, 2003 3:37 am |
|
|
hi,
just little problem with a 16F628, if I call this piece of code:
void write_e2p() {
for (i=0;i<=9;++i) {
write_eeprom(i,0x10);
printf("add: \%u=\%u,i,read_eeprom(i));
}
}
when reading e2p I got
add: 0=255
add: 1=255
...and so,
what is the problem here?, eeprom is suposed to be 10h in all that addreses..
best regards
Invisible
___________________________
This message was ported from CCS's old forum
Original Post ID: 10884 |
|
|
kolio Guest
|
Re: 16F628 e2p writing problem |
Posted: Wed Jan 22, 2003 4:30 am |
|
|
:=hi,
:=
:=just little problem with a 16F628, if I call this piece of code:
:=
:=void write_e2p() {
:= for (i=0;i<=9;++i) {
:= write_eeprom(i,0x10);
:= printf("add: \%u=\%u,i,read_eeprom(i));
:= }
:= }
:=
:=when reading e2p I got
:=add: 0=255
:=add: 1=255
:=...and so,
:=what is the problem here?, eeprom is suposed to be 10h in all that addreses..
:=
:=best regards
:=Invisible
Oups,
in write_eeprom(i,0x10) first parameter is the value and the second is the address, so just swap their places in the souce code. It should work. It is normal that you're reading 255 - the eeprom is clear, but if you're try to read from address 0x10 there will be 9
Wish you luck!
___________________________
This message was ported from CCS's old forum
Original Post ID: 10885 |
|
|
Invisible Guest
|
thank you very much!! |
Posted: Wed Jan 22, 2003 1:45 pm |
|
|
hi,
I just need a glases to read correctly the help file,
thanks for your help!
best regards
Invisible
___________________________
This message was ported from CCS's old forum
Original Post ID: 10894 |
|
|
|
|
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
|