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

16F628 e2p writing problem

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







16F628 e2p writing problem
PostPosted: Wed Jan 22, 2003 3:37 am     Reply with quote

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
PostPosted: Wed Jan 22, 2003 4:30 am     Reply with quote

:=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!!
PostPosted: Wed Jan 22, 2003 1:45 pm     Reply with quote

hi,

I just need a glases to read correctly the help file, Smile
thanks for your help!

best regards
Invisible
___________________________
This message was ported from CCS's old forum
Original Post ID: 10894
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