PDA

View Full Version : writecode work on 18f26j11?



EE12212
- 8th April 2011, 11:43
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?




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

Darrel Taylor
- 8th April 2011, 17:59
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.

EE12212
- 9th April 2011, 01:48
thanks for the information Darrel.
on monday i will try the both ideas (assembly and 64bytes at a time).