writecode work on 18f26j11?
hello:)
Someone tell me if writecode command works in the pic18F26J11?
I can read through the readcode all memory locations, but i can't write in memory!
any idea?
Code:
ESCREVER:
FlashAddr = $4e20
FlashData = MODE
INTCON.7 = 0
EECON1.2 = 1
EECON1.5 = 1
erasecode flashaddr
EECON2 = $55
EECON2 = $AA
EECON1.1 = 1
WRITECODE flashaddr, FlashData
EECON1.1 = 0
EECON1.2 = 0
EECON1.5 = 1
INTCON.7 = 1
LCDOUT $FE,$D6,#flashdata
RETURN
'___________________________________________________________________
leitura:
FlashAddr = $4e20
READCODE FlashADDR, flashdata
LCDOUT $FE,$D0,#flashdata
MODE = FLASHDATA
return
Re: writecode work on 18f26j11?
The "Word Programming" mode is not supported.
You would need to write 64 bytes at a time with WRITECODE.
ERASECODE will erase 1024 bytes.
If you use the assembly language code from the datasheet, you can write 1 word at a time.
But you can still only erase blocks of 1024 bytes.
Re: writecode work on 18f26j11?
thanks for the information Darrel.
on monday i will try the both ideas (assembly and 64bytes at a time).