Tony Vandiver escreveu: > I started working on a bootstrap for the PIC18F44J10, and was surprised = > to find that the size of a block erase is 1024 bytes. The datasheet = > says that the block erase is required for at least every third write = > which makes me think I have to use it rather than writing a block of all = > FFFF to a 64 byte flash write block to do a pseudo erase. The problem I = > have with that is that if I want to maintain memory on the part that is = > never erased, the size of that memory must be at least 1K. So, if I = > want to have the boot block at the start of memory to encompass the = > reset and interrupt vectors, that's 1K of codespace that I can't erase = > at the start, and in addition, if I want to maintain the configuration = > bytes at the end of program memory, that's another 1K of code that I = > don't want to ever erase. That leaves me with only 14K of usable code = > space for the part. I can live with that for my current application, = > but it seems pretty wasteful. Am I not thinking about this correctly? = > Will a 64 byte block write of all 1's effectively substitute for a cell = > erase? Writing FLASH memory can only change bits from '1' to '0', it is for this reason that the erase exists, to change '0' bits back to '1' again. Unfortunately the erase granularity for your device is 1K bytes. If you have enough RAM, first copy the page contents to RAM, modify it, erase the page and write it again. Regards, Isaac __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist