Thanks, Charles.
The PBP manual says of DEFINE WRITE_INT 1
Disable/enable global interrupts in Write, which is why it sounded like a toggle to me.
Looking at the 16F88 manual at 3.6.1, "FLASH PROGRAM MEMORY ERASE SEQUENCE", Step 3 is "Disable interrupts". Oddly, there is no complementary step to re-enable them. However, the code example 3-4 shows disabling interrupts with
BCF INTCON,GIE
and then enabling them again with
BSF INTCON, GIE
Equally oddly, the example at 3-5 for writing to flash program memory has the BSF at the end but not the BCF anywhere prior.
So . . .
It looks like interrupts do need to be disabled/re-enabled with ERASECODE, too.
Any reason why I can't just use an @ ahead of the above statements instead of the DEFINE? Would it save any time/space?
Bookmarks