|
|
View previous topic :: View next topic |
Author |
Message |
Hamid Guest
|
Flash write problem on PIC18F2523 |
Posted: Wed Aug 29, 2007 12:35 am |
|
|
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
|
|
Posted: Wed Aug 29, 2007 4:24 am |
|
|
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 |
Posted: Wed Aug 29, 2007 5:50 am |
|
|
THANK you a lot |
|
|
|
|
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
|