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 support@ccsinfo.com

write_program_eeprom() problems

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







write_program_eeprom() problems
PostPosted: Mon Mar 26, 2007 6:49 pm     Reply with quote

Hi I'm Douglas I try to write in the program memory using write_program_eeprom(1860, 0x1010) function but the line that is the first parameter was not the value line changed that appear in the program memory, the affected line is 1861 and follow write three address more in secuential like this:
line 1860 was not written,
line 1861 wrote with 0x1010 ,
line 1862 wrote with 0x1010,
line 1863 wrote with 0x1010,
line 1864 wrote with 0x1010
and this is not ended, when I try to read this lines I can't read anything as you can note in this line read_program_eeprom(1860) is natural that line don't read the correct value because the write_program_function don't write in this address. Then, when I change the address in function myVariable=read_program_eeprom(1861) nothing is read and the variable have the same value before this reading attempt.
what is a problem in this case? thanks for any help!
Douglas
KaraMuraT



Joined: 16 May 2006
Posts: 65
Location: Ankara/Turkey

View user's profile Send private message Send e-mail

PostPosted: Thu Mar 29, 2007 12:30 am     Reply with quote

As always asked: What is the concerning PIC and CCS version?

You should pay attention to Erase/write cycle... You "can't" write any value before erasing. And remember, you can not erase one byte of program eeprom (aka flash). The erase command will erase a block. And the block size depends on the PIC type you use...
_________________
/// KMT
/// www.muratursavas.com
Doglito
Guest







write_program_eeprom() problems
PostPosted: Thu Mar 29, 2007 3:57 pm     Reply with quote

Thanks for reply! the pic tha I use is 16f877A and the ccs version is 4.030 . but this task seem so easy to implement, I can't write correctly in memory program and read to. in the ccs c reference manual on the page 256 has a example that how to use this function, and don't have no suggestion of requirements to write beyond write_program_eeprom(adress, value);
and the same is to read_program_memory() ;
what I need in addtional to fix this? thanks
Douglas
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