PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Aug 26, 2008 8:39 pm |
|
|
Try this test program and see if it works:
Code: | #include <18F8722.h>
#fuses XT, NOWDT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
// These eeprom locations will be written when the
// PIC is programmed with the ICD2 programmer.
#rom int8 0xF00000 = {0, 1, 2, 3, 4} // 0xF00000 is for 18F PICs
//==========================
main()
{
int8 i;
printf("Start\n\r\n\r");
// Display eeprom that was written with the ICD2.
printf("Eeprom written by the ICD2 programmer:\n\r");
for(i = 0; i < 5; i++)
printf("%x " read_eeprom(i));
printf("\n\r");
printf("\n\r");
// Write the first two bytes with 0x55 and 0xAA.
write_eeprom(0, 0x55);
write_eeprom(1, 0xAA);
printf("Locations 0 and 1 should now be 0x55 and 0xAA:\n\r");
for(i = 0; i < 5; i++)
printf("%x " read_eeprom(i));
printf("\n\r\n\rDone\n\r");
while(1);
} |
|
|