Just built a JDM style PIC (16f628a) programmer

*edit.  turns out I may have been using the wrong resistor which explains why the original schematic wasn’t working for me.  Looks like I used 15k instead of 1.5k.  So if your trying to use the JDM programmer, you can probably use the original schematic as is.

‘m pretty excited as I just got a home made JDM style PIC programmer working about 15 minutes ago.  I’m pretty new to electronics: I had an electronics project kit when I was about 8, and maybe 6 years ago I played with rs232 a little (making a loopback device and a simple 1 pin breakout box was the pinnacle I reached).  This programmer is really my 1st project.

The schematic I used is http://www.jdm.homepage.dk/newpic22.gif which comes from http://www.jdm.homepage.dk/newpic.htm.  I tried another schematic (newpic3) but it failed to work.  However the schematic I ended up using also did not work as-is so maybe the original design would have worked with the modification I ended up using.

I didn’t have any rs232 serial cables laying around when I started building the programmer, and apparently usb convertors tend not to work using a JDM style programmer so I had to purchase one.  I did not do particularly well at this and ended up buying a null modem cable by mistake.  I ended up building a small breakout box for rs232 lighting up leds for each db9 pin I was using in the programmer.  Soldering jumper wires to the db9 plug was really painful.  What I failed to realize is that I needed to solder both the wire and the cup (the little holder thingy for the wire connecting each pin) at the same time.  I had bought a “helping hands” tool from dick smiths to help with my soldering and only when I made a repair when one of the wires come unstuck did I realize that I could make the tool hold the wire and the db9 plug at the same time.

Anyway, I built the breakout box and started measuring voltages since only 1 pin was showing activity.  I realized that since I was getting activity on pins that should only be activated by the DCE (comms equipment) that I bought the wrong cable.

I bought a ton of stuff for this project actually.. multimeter, breadboard, components, soldering tools, pliers, alligator clips..

I made 2 modifications to the schematic I gave earlier.. I made rb4 connect to vss instead of vdd.  There is some people on the net who talk about this modification, and also on the webpage describing the jdm programmer it talks about doing it for the 16f627 which is apparently very similar to the 16f628(a).  I haven’t actually tested without this modification, so maybe its not necessary.  Something i’ll try tomorrow perhaps.

The second modification I did was removing R2.  I kept reading low voltages for rb7, and I had read that R2 wasn’t strictly necessary as a limiting resistor since rs232 limits current draw.  Once I removed R2, it worked!  I was extremely happy with this result especially since I know next to nothing about electronics – there was certainly quite a bit of luck involved.

To test the voltages I used ic-prog which enables you to test key voltages in the pic such as mclr, clock, data etc.  ic-prog works on vista providing you use the driver and enable it in the ic-prog options – this also fixes the ‘priveledged instruction’ error you might get when it starts up.  Another software programmer I tried using was winpic.

The way I checked that the programmer works was by modifying some of the code or data with the supplied hex editor, then programming it (via the software programmer).  It (the software programmer) automatically verifies that its worked by reading the code+data stored on the pic and comparing the results.

I haven’t actually written a real program as yet, or got a board to test it.  I need to buy a 5v voltage regulator, and a battery pack, and I might need another breadboard as I’m using the boards I have currently (with the programmer and a rs232 breakout box).  I am sure to attempt to use a vero board to make a more permanent programmer in the future.  This is something I am looking forward too.

I should also mention that the 22uF capacitor, C3, is a tantalum capacitor.  I read in some posts elsewhere that this was the right type of capacitor.  The other capacitor I used is an electrolyte type.  I also couldn’t find a BC547B transistor on the rack at dick smiths, even though it is in the online catalogue..  I used a PN2222A instead and found a datasheet on the net with the pin layoyut – which is reverse to that of the BC547B.

Ruxcon is on in less than 2 weeks.. I still haven’t finished my slides, and the code I’m releasing, I haven’t touched in about 2 months.  I guess I get carried away with whatever I find interesting at the time.. In recent times its been electronics.


3 responses to “Just built a JDM style PIC (16f628a) programmer

  1. good luck on completing your project. Thanks…

  2. Hope at least you will re-program the coffee machine key of ur university,and make free coffes for all sexy chicks 😛 and ofcoz also for u.
    And this is for ur health.
    The first make u relax.
    The second make u concetrated.
    And i think u need both for ur work and ur next speech.
    By the way USB TO SERIAL rs232 is usually a mess, it depends mostly on the CHIP made of it,
    anyway a common problem even if it works is the slow data exchange during the operation of reading and writing … Best way is native rs232 and rs232 cable not null modem 😛 just Zebra printers love null modem cables 🙂

    My best regards.
    I was jokin about the first part, hope u got it.
    Good luck.

    Hope one day u will make a machine to read ppl’s mind, coz i dont still understand what women want lol lol

  3. Silvio you decided to get your hands dirty?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s