I have a PIC16F877A and I am supposed to connect 3 LED lights that are series on each output pin the PIC has 40 pins and 33 output pins, if I connect 5 output pins the code I made that will make the lights blink in a certain way works but if I add another output making it more than 5 pins it just keeps on blinking the code I made for the light pattern will not work what is the problem?

enter image description here

  • 5
    \$\begingroup\$ Could you draw a diagram of your circuit? Show us your code? It is a little hard to understand what you are asking here. \$\endgroup\$
    – dext0rb
    Jan 21, 2013 at 23:26
  • \$\begingroup\$ Some pins are analog instead of digital by default (at least with the PICs I've used), so perhaps when you "add another output making it more than 5 pins" the additional pin is on a different port than the first five and doesn't work as it is not configured as a digital output? Just a guess. As dextorb said, you really need to post your code. \$\endgroup\$
    – Nate
    Jan 21, 2013 at 23:46
  • \$\begingroup\$ i cant post image but this is the link for the image i.stack.imgur.com/FI8Oo.jpg \$\endgroup\$ Jan 21, 2013 at 23:51
  • \$\begingroup\$ i will post code later cause i dont have it in this pc that i am using right now but the code works fine in a simulator that i am using called isis 7 \$\endgroup\$ Jan 21, 2013 at 23:52
  • 1
    \$\begingroup\$ The image is OK, but a schematic diagram would be better. You need to clean up your breadboard. The two 22pF capacitors need to connect between the crystal and ground with very short connection. Just connect the caps directly to ground, don't use that extra bit of wire. It also doesn't look like the 10mF cap is connected to anything? Again, a schematic diagram would be better. \$\endgroup\$
    – dext0rb
    Jan 22, 2013 at 0:00

1 Answer 1


A few things that may be causing issues:

  • I can't see any decoupling caps (e.g. 100nF, 1uF ceramic) on or close to the power pins
  • The crystal caps are too far away from the crystal, connected via jumper wires.
  • What is the other end of the 10uF cap connected to?

Cap Connection

  • \$\begingroup\$ it is connected to the memory clear and a 1k ohm resistor \$\endgroup\$ Jan 22, 2013 at 0:15
  • \$\begingroup\$ and the resistor is connected to the ground \$\endgroup\$ Jan 22, 2013 at 0:15
  • \$\begingroup\$ I mean the other end - it does not appear to be connected to anything. See arrow in image I added to my answer. \$\endgroup\$
    – Oli Glaser
    Jan 22, 2013 at 0:35
  • \$\begingroup\$ it supposed to be connected to the ground \$\endgroup\$ Jan 22, 2013 at 0:43
  • 1
    \$\begingroup\$ Well you should connect it to ground then ;-) It doesn't appear to be connected to anything in the picture, unless there is some wire we can't see (or it's a pre wired-to-ground picture) \$\endgroup\$
    – Oli Glaser
    Jan 22, 2013 at 6:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.