PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jun 15, 2006 3:45 pm |
|
|
Quote: | I seem to be reading back random values |
I made the test program below, and compiled it with PCM vs. 3.249.
It worked OK. It displayed the following output:
That's the LSB and the MSB of the program word at ROM address 0x1000.
I used the ICD2 to erase the PIC before I programmed it, so I know
that it will have 0x3FFF in all erased locations. Is it possible that you
have old code left in most of your PIC ? Try erasing it first. Then
run the test program.
Code: |
#include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, NOBROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
int8 g_ucTestRead[10];
//======================
void main()
{
read_program_memory(0x1000, &g_ucTestRead[0], 2);
printf("%x %x \n\r", g_ucTestRead[0], g_ucTestRead[1]);
while(1);
}
|
|
|