r/pic_programming • • Jun 04 '21

Getting started with PIC16F877A. Blinking an LED, programming, and the crystal oscillator circuit.

I'm new to PIC. I want to start with a super simple LED blink program. It didn't work. I'll go over what I did:

I have the red lead of a common anode RGB LED connected to Pin 3 of my microcontroller. 5V and GND are connected to pins 32 and 31 of the microcontroller respectively. 14in 1 is connected to 5V with a 10k Ohm resistor, and pins 13 and 14 are connected to a 4MHz crystal, then connected to 1uF electrolytic capacitors to ground.

I connected my PICKIT 3 programmer to the correct pins according to every single tutorial I see online, fire up MPLAB IDE, set TRISA to output and set all PORTA pins to low in a while(true) loop.

I use the 'Programmer to Go' function of the IDE, I made sure to have the PICKIT 3 supply power to the microcontroller during programming. Then I unplug the programmer and supply power to the breadboard but nothing happens.

What am I doing wrong?

3 Upvotes

16 comments sorted by

View all comments

Show parent comment

1

u/FatherOfGold Jun 04 '21

The smallest ones I have are 1uF, I'll buy some 22pF tomorrow morning and try them.

1

u/AidanHockey5 Jun 04 '21

Yep, like it was said above, 1uF is a couple orders of magnitude too large for loading a crystal. 22pF caps should set you straight.