Author Topic: Moving PIC to breadboard resistor/capacitor question  (Read 6099 times)

0 Members and 1 Guest are viewing this topic.

Offline blewisjrTopic starter

  • Frequent Contributor
  • **
  • Posts: 301
Moving PIC to breadboard resistor/capacitor question
« on: March 12, 2013, 12:19:57 pm »
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
 

Offline metalphreak

  • Frequent Contributor
  • **
  • Posts: 815
  • Country: au
  • http://d.av.id.au
    • D.av.id.AU
Re: Moving PIC to breadboard resistor/capacitor question
« Reply #1 on: March 12, 2013, 01:13:10 pm »
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.

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5193
  • Country: ro
  • .
Re: Moving PIC to breadboard resistor/capacitor question
« Reply #2 on: March 12, 2013, 01:27:51 pm »
1uF  = 1000 nF   

So 0.1 uF  is the same as 100nF

This 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
« Last Edit: March 12, 2013, 01:54:51 pm by mariush »
 

Offline blewisjrTopic starter

  • Frequent Contributor
  • **
  • Posts: 301
Re: Moving PIC to breadboard resistor/capacitor question
« Reply #3 on: March 12, 2013, 02:25:53 pm »
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.
« Last Edit: March 12, 2013, 05:41:10 pm by blewisjr »
 

Offline Jon Chandler

  • Frequent Contributor
  • **
  • Posts: 539
    • Throw Away PIC
Re: Moving PIC to breadboard resistor/capacitor question
« Reply #4 on: March 12, 2013, 05:42:46 pm »
The 0.1 uF bypass cap should not be omitted.  Without it, all kinds of strange problems can occur.

Commandments For Using PICs covers some of the common problems encountered when using PICs and may be a useful reference.
 

Offline blewisjrTopic starter

  • Frequent Contributor
  • **
  • Posts: 301
Re: Moving PIC to breadboard resistor/capacitor question
« Reply #5 on: March 12, 2013, 06:17:51 pm »
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.
« Last Edit: March 12, 2013, 06:49:59 pm by blewisjr »
 

Offline blewisjrTopic starter

  • Frequent Contributor
  • **
  • Posts: 301
Re: Moving PIC to breadboard resistor/capacitor question
« Reply #6 on: March 12, 2013, 11:48:26 pm »
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.

 

Offline Jon Chandler

  • Frequent Contributor
  • **
  • Posts: 539
    • Throw Away PIC
Re: Moving PIC to breadboard resistor/capacitor question
« Reply #7 on: March 13, 2013, 12:27:09 am »
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.
 

Offline MikeK

  • Super Contributor
  • ***
  • Posts: 1316
  • Country: us
Re: Moving PIC to breadboard resistor/capacitor question
« Reply #8 on: March 13, 2013, 12:35:41 am »
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.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5193
  • Country: ro
  • .
Re: Moving PIC to breadboard resistor/capacitor question
« Reply #9 on: March 13, 2013, 01:30:46 am »
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 as PIC16F1519 that 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.
 

Offline blewisjrTopic starter

  • Frequent Contributor
  • **
  • Posts: 301
Re: Moving PIC to breadboard resistor/capacitor question
« Reply #10 on: March 13, 2013, 01:38:49 am »
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 sweet :D thanks again.
 

Offline metalphreak

  • Frequent Contributor
  • **
  • Posts: 815
  • Country: au
  • http://d.av.id.au
    • D.av.id.AU
Re: Moving PIC to breadboard resistor/capacitor question
« Reply #11 on: March 13, 2013, 01:43:42 pm »
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 off :)


For 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.

Offline blewisjrTopic starter

  • Frequent Contributor
  • **
  • Posts: 301
Re: Moving PIC to breadboard resistor/capacitor question
« Reply #12 on: March 13, 2013, 02:19:42 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf