Moving PIC to breadboard resistor/capacitor question - Page 1
Forum section: electronics / beginners

author: blewisjr
author_rank: Frequent Contributor
timestamp: March 12, 2013, 12:19:57 pm
content: Sorry for the really newbie questions but for my next project I want to move my PIC over to a breadboard for easier prototyping.Essentially what I need to do is build the ICSP circuit so my PICkit3 can program and power the chip on the breadboard.The circuit uses a 10k pull up resistor on Pin 1 (assuming to handle the preventing unwanted resets) it appears and also a 0.1uF Capacitor on Pin 1 (assuming to stabilize the voltage). It also appears as if the resistor is before the capacitor in the circuit.The questions I have is 1 is the resistor actually before the capacitor and 2 I don't have a 0.1uF capacitor only a 10nF 100nF and 100uF would it be possible to use one of these other caps without creating magic smoke on my MCU.Here is the schematic as well for the ICSP circuit on the supplied low pin count demo board. P1 is the ICSP. Wish I can read these better.http://ww1.microchip.com/downloads/en/DeviceDoc/PICkit%203%20LPC%20Demo%20Board%20SCH.pdf

author: metalphreak
author_rank: Frequent Contributor
timestamp: March 12, 2013, 01:13:10 pm
content: You don't need any of that to do programming. You can just directly connect the ICSP pins and it works fine.The capacitor in that schematic is simply a power supply stabilization cap, for when the PIC is actually running in operation.

author: mariush
author_rank: Super Contributor
timestamp: March 12, 2013, 01:27:51 pm
content: 1uF = 1000 nFSo 0.1 uF is the same as 100nFThis capacitor is for decoupling, a small capacitor is not required but recommended, but it can be 0.1uF , 0.47uF, I think even 1 uF would work. But electrolytic capacitors are not recommended, use ceramic or tantalum capacitors. The 100nF will do.As for a circuit... no, there's not really any circuit, it's nothing complex. Just a resistor to keep the reset line high and give the pickit the ability to restart your pic chip and that's all.The resistor doesn't even have to be 10k, it just has to be a reasonable value, the guide says 4.7-10k.See Pickit 3 user guide :The wires are numbered from 1 to 5, 1 is the pin marked on the pickit 3. The black triangles go to the input voltage that you use to power the chip (up to about 5.5v). AVdd and Avss are only required on some controllers.If you want to use that 0.1uF capacitor, you connect it between Vdd and Vss , as close as possible to those pins - that's what it's also drawn in that schematic you linked: you can see it's between V and ground , and pin 1 (Vdd) is connected to V and pin 20 (Vss) is connected to ground.If you use a linear regulator to power the microcontroller and it's very close to the breadboard (centimeters) you don't need this capacitor, but generally doesn't hurt to have it on the breadboard.You can see the official connection guide doesn't even mention that capacitor, it's just a good practice to use one with any IC

author: blewisjr
author_rank: Frequent Contributor
timestamp: March 12, 2013, 02:25:53 pm
content: Seems simple enough good to know that 100nF is actually 0.1uF which I would have known if I though of doing the conversion. Thanks a bunch if I blow it up I will make sure to post about it. This will be my first attempt at hooking up my own setup woo.EDIT:Well I did not Blow anything up but I must have done something wrong.The device gets powered and the program on the chip blinks the light. On the other side of things is it won't program the chip says can't find device id so now I need to figure out why.

author: Jon Chandler
author_rank: Frequent Contributor
timestamp: March 12, 2013, 05:42:46 pm
content: The 0.1 uF bypass cap should not be omitted. Without it, all kinds of strange problems can occur.Commandments For Using PICscovers some of the common problems encountered when using PICs and may be a useful reference.

author: blewisjr
author_rank: Frequent Contributor
timestamp: March 12, 2013, 06:17:51 pm
content: I am using the 0.1uF Cap but for some reason I can't program the device at the moment. The program already on the chip runs fine but the IDE is not picking up the devices ID.Got it working yey!!! not sure if it is quite right however. I will get a set of more tidy jumper wires and take a picture so you can double check and explain if I did something wrong somewhere.

author: blewisjr
author_rank: Frequent Contributor
timestamp: March 12, 2013, 11:48:26 pm
content: Sorry for the double post but this needs a separate post.I finished the ICSP setup for my PIC16F1829 nice and clean with precut jumper wires.Right now everything works the chip programs and the test blink program runs without a hitch.I took a picture and labeled the breadboard. My question regards the if the Pull up resister and decoupling capacitor are in the right locations.Note: You may need to zoom in the picture a tad to read the text.

author: Jon Chandler
author_rank: Frequent Contributor
timestamp: March 13, 2013, 12:27:09 am
content: It would be best to connect the cap directly to the negative pin instead of back to the negative rail of the bread board. The shortest leads possible across the power pins is desirable.

author: MikeK
author_rank: Super Contributor
timestamp: March 13, 2013, 12:35:41 am
content: Yeah, put the cap in front of the PIC and connect the leads one space over to Vdd and Vss.Also, I always add a diode in series with the resistor to prevent Vpp from driving the power rail.

author: mariush
author_rank: Super Contributor
timestamp: March 13, 2013, 01:30:46 am
content: It looks ok, with just the mention of the capacitor which should be as close as possible to the pin.You could however make it quite prettier and more future proof by moving the chip slightly to the left.For example, here's how I envision it:Your header goes from I1 to I6. The 0.1uF could be even better positioned on the other side of the chip, closer to Vdd, but this way is good enough.With larger microcontrollers, such asPIC16F1519that comes in a DIP28 package, you'll find out that the Pgd and Pgc pins are the first two at the top, the MCLR is the first at the bottom and the Vdd and Vss are somewhere in the center. So this layout allows you to quickly rearrange for such microcontroller:As you can see, all I have to do is move the microcontroller 1 hole to the right so that Pgd and Pgc remain aligned with the header, move the resistor for MCLR a bit to the left to be connected to first pin, and add two wires in the center for Vdd and Vss. The rest of the wires remain in place and don't bother your wires and other things you connect.ps. In case you're curious I made the pictures with Fritzing.

author: blewisjr
author_rank: Frequent Contributor
timestamp: March 13, 2013, 01:38:49 am
content: Awesome thanks for the tips that will for sure allow for some more room I will tinker around with it tomorrow some time and clean it up a bit more. Glad to know I have the right idea I just was not sure if the cap was positioned properly I could not figure out how to get it closer to VSS and you gave me a great demonstration of how to get it closer sweetthanks again.

author: metalphreak
author_rank: Frequent Contributor
timestamp: March 13, 2013, 01:43:42 pm
content: One thing that seems to be a trap for new people (and I have been caught out by this a few times):Many of the PICs have a "Low Voltage Programming" mode. This will be marked on the datasheet as the LVP pin (its not a dedicated pin). When running, if this pin goes high it will enter low voltage programming mode - NOT what you want to happen in most cases. In many cases, a randomly resetting MCU, or weird stuff happening, can be attributed to leaving LVP enabled. All you need to do is disable it using the config words in your program (#pragma LVP = OFF or similar, I can't remember the exact code).The PICKIT doesn't use LVP to program so it's safe to turn offFor me, running high speed SPI on adjacent pins was causing the LVP pin to get set, causing my program to reset. Also, touching the pin with your finger will cause it to go into LVP. Once off, its all fine.

author: blewisjr
author_rank: Frequent Contributor
timestamp: March 13, 2013, 02:19:42 pm
content: Yea on the PICKit 3 LVP is actually on Pin 6 of the ICSP header. In the config words I leave LVP OFF and just to be sure the LVP pin on the header is left floating.The PIC16F1829 does not even have a LVP pin on the chip to begin with anyway.