I have a PIC16F59 and I want to get started with it by writing a blinking LED program. I am using HI-TECH C for the PIC10/12/16 MCU Family and the PICkit3 and MPLAB X as my IDE. Here is my attempted code which is supposed to turn on all LEDs on port B.
#include <stdio.h>
#include <stdlib.h>
#include <htc.h>
int main(int argc, char** argv)
{
while (1)
{
// Put delay code here
PORTB=1;
// Put delay code here
}
return (EXIT_SUCCESS);
}
The program compiles fine. However, when uploading the hex file using the PICkit3 I get this error message:
Program operation of Program Memory failed
Address 0x0, read expected 0x25
What I am I doing wrong? Are there any configuration settings that I am not aware of?