1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Yet another PIC parallel port programmer

Discussion in 'Microcontrollers' started by eblc1388, Jan 29, 2006.

  1. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,235
    Likes:
    641
    Location:
    Derbyshire, UK
    A couple of small points:

    1) I would strongly advise using current limiting resistors on the LED's, it's not a nice way to treat either the LED's or your parallel port!.

    2) The lack of capacitors round the regulators, it's essential to have capacitors on their inputs and outputs to guarantee their stability. It might work OK for now, but could be unstable under certain circumstances, or if built by someone else.

    I consider it pointless taking minimal parts count to extremes, it tends to produce unreliable, unrepeatable, designs!.
     
  2. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    I alreredy solderd it all togeter
     

    Attached Files:

  3. eblc1388

    eblc1388 Active Member

    Joined:
    Jan 25, 2005
    Messages:
    2,228
    Likes:
    18
    Location:
    UK
    I have built many PIC programmers so this time I try to make this a little different.

    Instead of using two 9V batteries or AC adapter to power the programmer, I decided to try using a 9V and a 3V lithium battery combination. I don't know whether it is a good idea but one will never know unless one tried. It program all my PICs, including the 16F88.

    The circuit diagram is a slight modification of the BrokeBenji design but still using two opto-couplers. I have to use very large values of LED resistors because I don't want to change my batteries too soon. :D

    I have measured the idle current of the 9V battery to be 3.4mA when there is no programming activities.

    You can find the circuit below and the corresponding WinPic800 settings. Note that I have use parallel port dataline D2 for Vpp control and D3 for Vdd control which is to match with my other programmers. So this is a bit different to Someone Electro's circuit and settings he just posted.

    The programmer is shown in the following post. Enjoy.
     

    Attached Files:

  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. eblc1388

    eblc1388 Active Member

    Joined:
    Jan 25, 2005
    Messages:
    2,228
    Likes:
    18
    Location:
    UK

    Photos of the programmer.
     

    Attached Files:

  6. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    Nice one.The first batery powerd programer ive ever sean.

    I hate changing baterys so i used an wall wart.

    And dangit myne is just a litle too big to fit in a tic tac box.
     
  7. eblc1388

    eblc1388 Active Member

    Joined:
    Jan 25, 2005
    Messages:
    2,228
    Likes:
    18
    Location:
    UK
    Nigel has been using two 9V batteries for his P16Pro40 for ages.
     
  8. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    oh well i never payed atention to that.
     
  9. i_build_stuff

    i_build_stuff New Member

    Joined:
    Jul 21, 2005
    Messages:
    135
    Likes:
    1
    Location:
    Pittsburgh, PA (USA)
    Are PGD, PGC, MCLR, VDD, VSS the only pins on the PIC that have to be connected to program it?

    I've been fighting with this thing since yesterday and it still has yet to recognize or program a PIC. All the pins are producing the right voltages when I click them on / off in WP800, but for some reason it never reads back anything but zeros.

    Maybe the LPT D0 is holding the ACK pin down + not letting the PIC reply?

    So far, I've tried it with a 16F84A, an 18F1320 and a 16F873A.
     
  10. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    The <Ack> pin is an input so it really shouldn't interfere with <D0>...

    Depending on the PIC you're using, the 'erased' state leaves LVP (low voltage programming) enabled and a 'floating' PGM pin on the PIC will create problems (you can't put the PIC into high voltage program/verify mode)...

    Another issue that may be critical for this simple design is the length of the parallel port cable... I had to make a custom 18 inch (45.72 cm) cable for my old P16PRO40 parallel port programmer before it would work correctly...

    Please try grounding the PGM pin on your PIC and tell us if that helps?

    Regards, Mike
     
  11. i_build_stuff

    i_build_stuff New Member

    Joined:
    Jul 21, 2005
    Messages:
    135
    Likes:
    1
    Location:
    Pittsburgh, PA (USA)
    OK, I haven't tried your suggestions yet, but I did get it to identify the PIC correctly. What I did was place a 150 ohm resistor between D0 and ACK.

    Apparently, my parallel port draws a fine line between "active" and "HI-Z"--when I took the PIC out and probed around, there was no way to change the ACK pin from the PIC's connector (it was "stuck" to D0).
     
  12. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    Well, now that I think about it, that makes sense and I suspect that's why all those old 'Tait style' parallel port programmers used 74LS05 or 74LS07 open-collector driver chips...

    You may well have uncovered the flaw in this very simple design...

    Regards, Mike

    <added>

    I wonder if the modification below would eliminate the problem? It should provide isolation similar to that of the 'Tait style' designs but would require flipping the <Dout> polarity in the programming software...
     

    Attached Files:

  13. eblc1388

    eblc1388 Active Member

    Joined:
    Jan 25, 2005
    Messages:
    2,228
    Likes:
    18
    Location:
    UK
    Adding the resistor is a good decision and you need to move the PGD connection to ACK rather than the D0 line. I have added this resistor to my previous circuit I posted.

    To Mike: I see no good reason to use another buffer for the D0 output. The D0 line is not supplying current to the PIC but only pull down the voltage(provided by the ACK line) on the PGD line so the PIC sees a LOW.
     
  14. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,235
    Likes:
    641
    Location:
    Derbyshire, UK
    It's not there as a buffer, it's there to provide an open collector output, so you can read the PIC (or indeed verify it). It's a 'nicer' solution than a series resistor.

    As Mike suggested, this was the main reason for open collector buffers in the Tait designs, the second was to facilitate the Vpp switching. The third reason (for the buffer at all) was to give an extra layer of protection to the parallel port.
     
  15. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    The MOSFET was added simply to provide an open-drain output for the "wired-OR" circuit requirement (where more than one output needs to drive the same line)... In this case both D0 from the PC and PGD from the PIC need to be able to drive the line...

    The resistor mod' will work fine too... It'll only need to dissapate a few milliamps at 5 volts when the two driving signals oppose each other...

    Regards, Mike
     
  16. eblc1388

    eblc1388 Active Member

    Joined:
    Jan 25, 2005
    Messages:
    2,228
    Likes:
    18
    Location:
    UK
    TTL output is very good in sinking current but can only source very little current. This has no problem because TTL inputs usually default to high logic level.

    What I meant in the previous post is that you are effectively adding another stage to the existing TTL output stage. The following image is a typical output stage of a LS373 latch.

    The D0 line is logic HIGH when the PIC is driving the PGD line so an additional 100R resistor is there to "protect" the D0 line output though it is not really absolutely necessary because of the TTL internal 100R resistor. The additional 100R is there to reduce the PIC internal driving current instead.
     

    Attached Files:

  17. i_build_stuff

    i_build_stuff New Member

    Joined:
    Jul 21, 2005
    Messages:
    135
    Likes:
    1
    Location:
    Pittsburgh, PA (USA)
    Here's a "fixed" version that tested OK for me.

    D0 = Dout (inverted)
    D1 = Clock
    D2 = N/C (could be used for Vdd with minor changes)
    D3 = VPP
    ACK = Din

    [​IMG]
     
  18. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    I would rather make the Vdd controlable. Because some PICs want Vdd before Vpp some the oposite.Meaby thats why he codnt program an 16F88.
    It just takes reconecting that resistor to D2
     

Share This Page