PDA

View Full Version : Readcode problems



BobP
- 28th November 2012, 12:44
Hi,

Have been experimenting with putting ASCII data in to code space and it didn't work as I expected. Hopefully someone will point out my stupid mistakes!!

Using a PIC18F2525 with PicBasicPro 2.50 (has been tested with 2.60)
Here is what I have found already;

1. ASCII Code is written to the PIC correctly at program time.
2. ASCII Code will read and display correctly if reading in same 8k memory page.
3. If memory location is set outside the 8k page it will only return zeros.

Have checked manual and can find no mention of limitations to using 'READCODE'. Have I missed something?

I have attached the test program and the asm file with the ASCII data.

Thanks,
Bob

Darrel Taylor
- 28th November 2012, 17:58
Your program works fine here on an 18F4525.
I don't have a 2525, but they are pretty much the same except for the number of pins.

I can put the data anywhere in program memory and it still works.

What do your CONFIG's look like?
If you have any "Table Reads" protected it could explain it.

You should have these as your configs ...
__CONFIG _CONFIG1H, _OSC_HS_1H
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L

BobP
- 28th November 2012, 18:33
Hi Darrel,

Many thanks for your reply. Once again another valuable reply, you were spot on.

I spent hours looking for what I was doing wrong. 2 min after reading your post it now works. I just changed the fuse settings on the programmer.

Many thanks again,
Bob