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

Flash write problem on PIC18F2523

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







Flash write problem on PIC18F2523
PostPosted: Wed Aug 29, 2007 12:35 am     Reply with quote

Hi,
I want to write data to flash same as eeprom but I have a big problem when I write new data the result LOGICALLY and" with the privious data ?? its mean I can not change the 0 data to 1!
how I can write new data to flash without this problem?
Ttelmah
Guest







PostPosted: Wed Aug 29, 2007 4:24 am     Reply with quote

This is a function of the flash memory. It is erased in _blocks_. The function 'write_program_memory', will only erase a block, when you write to a block _boundary_ (first byte in the block). Look at the manual, for 'write_program_memory'. There is a table at the bottom, which descibes when the functions will erase a block. The 'write_program_eeprom' function, will only erase on chips where the erase size, matches the block write size.
If you want to change just an individual byte or a few bytes, inside a block, then you need to read the whole block, change the bytes in the read values, and write the entire block back.

Best Wishes
HAMID
Guest







THANK YOU
PostPosted: Wed Aug 29, 2007 5:50 am     Reply with quote

THANK you a lot
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