# Troubles programming pic16f1503 (MPLAB X, PICKIT 3)

Status
Not open for further replies.

#### nabla101

##### Junior Member level 3
Hi,

I'm using MPLABx and pickit 3 to try and program a simple circuit based on the pic16f1503 microcontroller (Using ICSP, powered by the boards 5V supply).

I made a basic program to try and turn on an led for debugging purposes, to know I can program it, but after I get the program/verify complete message in the dialoque box of mplab x, nothing happens. I'm assuming this message means that my ICSP connections to the chip are ok, if it says "verify complete"?....and I'm also sure my hardware is right, as I've checked everything for correct connections and shorts multiple time with my multimeter.

I can also turn the LEDs on manually by using a jumper to connect them to the 5V supply with the MCU removed - except after programming the expected pin does not read a 5V level on the MCU, and therefore the LED doesnt turn on.

Heres my program:

Code:
#include <htc.h>
#include <pic16f1503.h>

__CONFIG(FOSC_ECH & WDTE_OFF & PWRTE_OFF & MCLRE_ON & CP_OFF & BOREN_ON & CLKOUTEN_OFF);
__CONFIG(WRT_OFF & STVREN_ON & BORV_LO & LPBOR_OFF & LVP_ON);

void main(void){

PORTC = 0;
PORTA = 0;
TRISC = 0;
TRISA = 0;

while(1){

PORTCbits.RC5 = 1;

}

}

Because, the program is so simple, and the hardware is also quite simple, and I'm sure its connected right, then I think the problem must have to do with the configuration settings I'm using and/or the pickit3 settings, but I'm not sure what exactly?

I have a 20Mhz Xtal between the CLKOUT/CLKIN pins, and a 30pF surface mount cap from each XTal pin to ground, all soldered ok, and placed close to the pins in a compact manner. I also definitely have power on the chip.

Also, if it helps, I'm using Hi-tech compiler.

Status
Not open for further replies.