Hi,

I use PBP Pro 2.45, MPLAB 6.4, and Pic 18F6720. I want to write and read from code memory. But my small sample program doesnt work:

x var word

ERASECODE $5000
Pause 20

x=123
WRITECODE $5000, x
Pause 20

READCODE $5000, x

hserout [hex x]

hserout puts out "65535" but it should put out "123". When I read with readcode a word from the program- codespace the right content will
be displayed.

I disabled all protect- configurationbits.

Any ideas where my mistake is?