PDA

View Full Version : writecode - problem - 18F6720



Tomasm
- 3rd November 2004, 12:46
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?

Dwayne
- 3rd November 2004, 14:24
Hello Tomasm,

Check this link out..

Melanie did a wonderful job with examples

http://www.picbasic.co.uk/forum/showthread.php?s=&threadid=137&highlight=writecode

Dwayne

Tomasm
- 3rd November 2004, 15:16
Hello Dwayne,

i know Melanies answer in this thread, but I cant use the PBP mnemonics, because I work with a 18F6720, so I have to use MPASM.

And the writecode example from Melanie doesnt work with my 18F6720!

mister_e
- 3rd November 2004, 15:51
Dear Tomasm, you can use PBP to do your code. MPASM will only translate your .bas file into an .hex file to be place into your PIC.


better for you to update MPLAB to new version 6.6x

after that you have to do EXACTLY the following instruction to include PBP into MPLAB. This will work

http://www.melabs.com/support/mplab.htm

don't forget to reboot !!!

many regards.