yep steve i was thing something like this
1. erase sector 0
2 write the changed bytes to sector 0 for page / byte /length data
3. using the address and number of byte to change length( assumes 1- 256 bytes contiguous) get the all OTHER pages/ bytes in orginal sector and write to sector 0
so need to find value of entered page address and read into the buffer (256kb) , then write
a. input page + 1 (data above the input page) for next loop 1 -
b. input page -1 ( data below the input page) for next loop 2
c. allow for input page location = 0 or 255 - so for next loop 1 only
this then copy of all pages EXCEPT that which need to change
If the input length was 255 then sector 0 has copy of the completed changed data
if length <255 bytes change then
then use the input length and byte start address value to read / write
a. read bytes start address + length + 1 - for next loop1 - ( read the bytes above that dont need to change)
b. read bytes start address + length - 1 - for next loop2 - ( read the bytes below that dont need to change)
c. allow for input bytes location + length of 0 or 255 - so for next loop 1 only
this then copy of all bytes except that which have been changed
now do a sector erase of the orginal sector
now read/ write each page back from sector 0 each page
not easy but as hedric said the smaller the sector erase size the less time it takes
Bookmarks