Hi Jinx, I'm *guessing* that you may have copied a *portion* from Microchip's routine out-of-context and thus might be getting a side-effect since you might not be using their complete read-erase-write routine. Are you implementing completely separate FlashErase and FlashWrite functions? I guess I'm not following this thread very well very possibly because of the limited scope of snippets as opposed to seeing more of your whole program. Maybe tomorrow I will see what you are asking and it will make better sense to me. But here is one difference that stood out to me in a big way: PRE-INCREMENT versus POST-INCREMENT table writes to the holding registers ( TBLWT+* versus TBLWT*+). There is a big difference between the two and you must be attentive and careful in the situations you will use them. In the PIC18F452 code I use to write to flash memory for example, I use post-increment notation on the holding registers table write instruction (TBLWT*+) because that's the *only* option that will work with my FlashWrite function precondition that the lower 3 bits of the table pointer *must* be zeros upon function entry. I've never had a problem with my code. I have completely different, single-purpose flash routines: one function erases a block of 64 bytes -- that's its only purpose, and one function writes a block of 8 bytes -- that's its only purpose. In the code you use to write to flash memory and in Microchip examples I've seen in their data sheets, they are using pre-increment notation on the table write instruction (TBLWT+*) for loading the holding registers. Microchip is using the *pre-increment* table writes to compensate for the previous TBLRD*- adjustment from the earlier erase sequence in their single read-erase-write snippet. In this way, they don't have to add another TBLRD*- after they load the holding registers. If you are *NOT* using the read-erase-write flash routine sequence *exactly* as Microchip is doing, this *could* be your problem. For example, if you have separate Erase and Write routines like me, you definitely want the *POST INCREMENT* notation on your table writes to the holding registers in your FlashWrite routine if your function preconditions are the same as mine. If you copied their flash write snippet you are getting the PRE-INCREMENT table writes which you just might not want. I'm making some assumption of your side and I apologize if these assumptions are wrong -- just trying to help you out. I hope this makes sense and that I have not totally missed your point. Please ponder what I'm saying here and let us know how things work out for you ok Joe? Best regards, Ken Pergola -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics