PIC Programming Adapter

Discussion in 'Embedded Systems and Microcontrollers' started by tracecom, May 10, 2012.

  1. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    Please see the attached schematic. If this schematic is correct, then my conclusion is that applying power to the wrong pins on a PIC causes no harm. Is that true?
     
  2. hexreader

    Active Member

    Apr 16, 2011
    249
    82
    I would say that this is bad design, but you would get away with it.

    You may be shorting an output if you put in a programmed PIC, but PICs are robust devices, and seem to cope.

    Hopefully any shorted outputs would be shorted only for a very short time, until the programming voltage is applied.

    I would say that "causes no harm" is a bold statement. I would class this as "you will probably get away with it"

    Just my thoughts
     
  3. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    If this was used only with an ICSP programmer, would that make it a safe design?
     
  4. hexreader

    Active Member

    Apr 16, 2011
    249
    82
    Don't see how it could ever be a safe design.

    I know of no other programmers for low-end PICs except ICSP, so I am not sure what you mean.

    I would guess that if you only ever used it for programming blank PICs, then I imagine it would be safe.

    To my thinking, a safe design would not short any pins one to another, except VDD to VDD and AVDD, VSS to VSS and AVSS. But low pin-count PICs only have one VDD and one VSS I believe.

    But I could be wrong....
     
  5. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I am very new to PICs, so my questions may be naive. If one is using the subject adapter with a PICkit 2, and only the PICkit 2 supplies power to the PIC, does that eliminate the potential for a problem?
     
  6. hexreader

    Active Member

    Apr 16, 2011
    249
    82
    The problem is with the adapter.

    But for hobby use, I bet this adapter is fine.

    It is simply not good design, to my mind. Chances are that you would never know the difference. But I have never used it.

    Not sure why you would need an adapter anyway. My designs all have a six pin (only 5 pins used) plug on the final board design. Programming on a socket, then plugging the programmed PIC onto your board is a very old concept.

    Sorry if I am not being very clear
     
  7. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    Thanks for your help; it's my questions that are not clear. The appeal of the adapter to me is that I would be able to program so many different PIC's with one fixture, i.e., not just the 8, 14, and 20 pin devices, but the 16 and 18 pin ones as well. Maybe it's not really important.
     
  8. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Even for hobby use. It is much better to design in such a way that you do not need any socket. With an ISCP programmer like PICKIT 2 you do not need a programming socket. Each time you take your PIC in and out of circuit. You will subject it to wear and tear. And after a short time you may see that your components legs just fell of.
     
  9. hexreader

    Active Member

    Apr 16, 2011
    249
    82
    What PICs are you programming anyway?

    Do you have a project in mind?

    Don't need to know, just interested.

    ... and I remember now.... other microcontrollers (e.g. Atmel AVR) can be parallel programmed or ICSP. PICs only use ICSP. Your questions were clear, it is my memory and understanding that are lacking.

    EDIT: and now I see t06afre's post, he makes a good point
     
  10. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I was thinking about building a version of the adapter with a ZIF socket, but perhaps it's unnecessary. In a circuit such as this (http://forum.allaboutcircuits.com/showthread.php?t=67622) is it ok to program the PIC with the LEDs connected to pins 12 and 13?
     
  11. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I am just in the "data acquisition mode." :)
     
  12. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    If you make a PCB/stripeboard include some jumpers. If you do bread board. just remove two of the LEDs (or LED resistors) on port RB6 and RB7, then programming. Or perhaps just better. Use one jumper and let the LEDs in question be not grounded then programming. Look at figure 3.1 in this document http://ww1.microchip.com/downloads/en/DeviceDoc/51553E.pdf This shows how to do it
     
  13. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    I do a lot of work with PICs for three reasons: they are inexpensive, they are very powerful, and they are inexpensive. Since they are inexpensive I select a PIC based on leaving the ICSP pins all alone so there is never an issue when programming, and more importantly, in circuit debugging. A few more pins adds near zero to the cost.

    I do what hexreader and t06afre do, I add a set of 6 pins on the board (with a big black dot on pin 1) so I can hang a PICkit there anytime I want.

    Removing the PIC to reprogram it is so 1990's. Some of us had to live thru that and we do not recommend returning to 20 year old methods when better ones now exist.
     
  14. coldpenguin

    Active Member

    Apr 18, 2010
    165
    9
    I'd recommend getting some breadboard and giving that a shot. Remember, the ports will be in input mode, and you will of course connect the ICSP between the port and the 470 ohm resistor.
    I reckon there is a decent chance of that working most of the time (and the 'verify' on program solves, or at least notifies of the odd occasion it doesnn't work.)
     
  15. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    Thanks. I have built that particular circuit on a solderless breadboard and have it working. I just used that as an example for my question, which phrased more generally is, "Is it permissible to use the PGC and PGD pins as inputs or outputs, and still connect the PICkit 2 to them without isolating them from the input or output connections?"
     
  16. hexreader

    Active Member

    Apr 16, 2011
    249
    82
    In my limited experience, sometimes this works, sometimes it does not. Depends on the PIC you are using and what is connected. I do not think you will do damage if you try it, it just may not work.

    There is a boring and complicated explanation of ICSP circuit requirements somewhere on the Microchip site, but I would not bother searching for it.
    I think it suggests either 1K or 10K resistor (forget which) from PGC and PGD to your circuit, so your LEDs are out of spec. Having said this, I have found LED connections not to be a problem sometimes.

    To be certain, put jumper links between the PGC and PGD pins and your circuitry, then if you do get a conflict, you can remove the links to program.

    .... or just avoid these pins if you have enough spares.

    .... or use these pins only for push-button inputs, so that all that is connected is a 10K pullup/down resistor, assuming that you do not press the buttons

    This is my experience, and my understanding, anyway
     
    tracecom likes this.
  17. coldpenguin

    Active Member

    Apr 18, 2010
    165
    9
    Unfortunately, the general answer would have to be to read the ~100 page pdf from microchip. as the general answer would be that for a lot of PICs, this is the method of in-circuit debugging, so the pins must be usable.

    (whether or not the rest of your generic circuit can hadle it depends on the circuit, however PGC and PGD are just ttl I believe, it is MCLR you must be careful of)

    However, if you are not debugging, then using swtches/jumpers is suitable.

    Otherwise I believe the summary of the 100 pages was pretty much don't have capacitance on those two lines.
    Reckon most of the time LEDS are ok.
     
  18. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    On a general basis the PICKITs does not have very good driving capabilities at all. particularly capacitive loads. So keep the wires as short as you can from the PICKIT to the target. Up to around 15 to 20 cm should work fine though. If you just want to program. Use resistors to isolate the programmer from the circuit. You can also make a jumper so then programming only the PIC will be powered from the PICKIT. For debugging some pins must be dedicated for debugging. If you need a lot of pins. Go for a 40 pin critter. The extra cost is minimal.
    I also have to say that you can do a lot of debugging in the software simulator. So it is important that you also master this.
     
Loading...