JDM programmer help, VPP voltage too high!

Status
Not open for further replies.

wassy

Newbie level 4
Joined
Mar 4, 2013
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,291
Location
Goucestershire, UK
Visit site
Activity points
1,388
Hi all,

I have built myself a JDM programmer using a tutorial over at "instructables" which can be found here: Business Card PIC Programmer.

A lot has been written about JDM programmers and from what I can tell, most of the problems people have stem from either too low a VPP voltage, or not pulling down any PGM pins used for low-voltage programming. My problem seems to be rather different from this. First off my desktop COM1 port and the circuit I believe I have faithfully reconstructed seems to be providing 15V on VPP, which is probably too high. Secondly, my current PIC (10F200) for my feeble first steps into the world of MCU programming doesn't appear to have an LVP option or PGM pin according to the datasheet.

The circuit seems to be constructed properly, I am using a desktop tower with COM1 port and under Linux, running the command line version of picpgm. Picpgm autodetects it as a JDM programmer and I tell it to read the PIC to verify if it is blank or not. I get an error

picpgm: /home/christian/picpgm_1751/picpgm/src/common/pic10fxxx.cpp:640: virtual UINT32 CPic10Fxxx::GetOSCCAL(): Assertion `(m_nOSCCAL & 0x0F00) == 0x0C00' failed.

BUT; then something very odd happened, whilst I had the multimeter pressed against the VSS and VPP pins, measuring the DC voltage, the programmer worked!! I was able to read the chip, what's more, I was actually able to program the chip (as long as I had my multimeter leads testing DC voltage between VSS and VPP throughout?!).

Does anyone have any idea why that might be? I thought it might be the high impedance of the multimeter, so tried a variety of 10M, 1M, 100K 22K resistors across VPP and VSS but that did not recreate the same effect as using the multimeter test leads. Can anyone hazard a guess as to why my VPP voltage is also so high?

There is ONE difference to the schematic: For some reason I ended up with a 5.6V zener diode in mine as opposed to a 5.1V zener. I didn't think it would make that much difference to the voltage though. I also have an LED between D1 and Q1 to show when it is programming. Many other JDM circuits also have this LED in them so i didn't think it was a big deviation from the design.

Any help appreciated.
 

To be honest JDM style programmers are never going to be reliable. They depend far too much on the individual coms port capability. However, in your case, change the Zener to the right voltage and also fit a capacitor of 100nF between VPP and VSS. I would also add one from VDD to VSS, especially if your wires to the PIC are longer than about 5cm (2 inches).

Not all PICs ahave LVP, the 10F2xx series do not support it. My data sheets for the 10F200 clearly show the VPP pin shared with GP3 and /MCLR. If your data sheet doesn't tell you this, get a new one from the Microchip web site.

Brian.
 
Reactions: wassy

    V

    Points: 2
    Helpful Answer Positive Rating

    wassy

    Points: 2
    Helpful Answer Positive Rating
Brian,

Thanks for the advice. I added the two 100nf caps between VPP->VSS and VDD-VSS as my lines from the JDM to the PIC are about 10cm long. This definitely improved things slightly. I was able to do a blank memory check on the 10F200 chip once (reads all flash to see if it has been programmed). I have now been able to successfully program my PIC12F509 with a couple of basic programs, so this has definitely helped immensely. It is still very temperamental though and I have only been able to program the 10F200 once, the 12F509 wouldn't program again this evening so obviously the lunar alignment change between yesterday and today was enough to throw it off (or my re-soldering of the 5.1V diode)

I changed the 5.6V zener to 5.1, this seemed to make little to no difference. The voltage across VPP and VSS still gets up to 15.2V when attempting to program.

I know the 10F200 doesn't have LVP, I only mentioned it to highlight that I wasn't tripping up over the problem some people seem to have reported where they don't pull down the PGM pin and their PIC ends up in LVP mode whilst in the middle of HV programming (or when trying to perform other high voltage operations such as full memory read).

I realise JDMs are not very reliable. I really just wanted to get a better understanding of MCUs and I thought a good way to do that would be to build my own programmer. I have done that now and it worked (to a fashion) so I can rest easy and move on to something like PICKIT2. It has helped me understand MCUs a lot better and many aspects oftheir operation such as clocking, voltage levels, etc.

I would still like to debug this a little more to see if I can improve it a bit more though. Do you know what current I could expect from the programmer to VDD, or from the programmer to VSS? The current going to VPP (with multimeter connected in series) is 0.2mA (200microAmp?!), even when attempting to program, the current going to VDD also seems very low, around 2mA I think (with no peripherals connected).

Is there a good way to step down the voltage at VPP to 13V (compared to VSS)? A resistor in series between the VPP line and the VPP pin of the PIC perhaps? or a 13V zener diode?

I might install a dual boot of windows XP at the weekend on the desktop tower as this currently only has linux, then I could try WinPic800 and its hardware debugging modes.

Thanks for your help, much appreciated
 

The maximum voltage allowed on VPP for most PICs is 13.5V so you may be damaging them. The voltage is fairly critical and on devices like the PicKit2 and 3 (but not all clones!) the voltage is programmable and regulated. The fulll programming specification is in document DS41228F on the Microchip web site. The best way to stabilize it is to use a 13V Zener diode or a 12V Zener diode and a two normal silicon diodes in series to give 13.2V but just as important is the sequencing of the VPP then VDD voltages which most programmers ignore. The current into VPP is very small and should be less than 0.45mA so your measurment is probably OK.

Adding Windows to a linux machine sounds like a backward step to me! What programming software are you using at the moment? I suggest MPLABX is a good solution for Linux users.

Brian.
 
Reactions: wassy

    wassy

    Points: 2
    Helpful Answer Positive Rating
Yes I thought the VPP voltage is probably not healthy for the PIC, i'll try your reccomendation and get some 13V zeners at the weekend if I have time. What do you mean by
or a 12V Zener diode and a two normal silicon diodes in series to give 13.2V
? Two normal silicon diodes in series, wouldn't that lower the 12V even further due to the forward voltage drop?

I have MPLABX for writing the assembler and compiling hex code, but I don't think you can use it to program with a non-microchip based programmer like JDM can you? I am currently using pgmpic to program the PICs as it claims to support 10F200 where as other linux programmers do not. I could try to program the 12F509 with another programmer I guess as that is more widely supported.

I agree, installing windows is a step backward, but it would only be dual-boot and only ever booted for this one purpose. I need to upgrade my server, then I could run a virtual machine instead Do you know if WinPic800 or similar will run in Wine? as I was going to try that, mainly because it has the hardware debugging option.
 

Adding the diodes in series adds their voltage drops together. 12 + 0.6 + 0.6 = 13.2V. Just remember that the Zener works backwards to the normal diodes. It should be cathode of the Zener to VPP, anode of the Zener to the anode of the normal diodes, cathode of the normal diodes to ground. Wired that way they prevent VPP going above 13.2V but still let it go to ground when it's turned off.

I'm sitting here surrounded by PCs, some with Linux and some with XP. I'd drop the XP in a second if I could keep functionality of all my programs, Linux is so much faster and more reliable. I use Ubuntu with MPLABX when I'm out and about but XP with a Pickit2 when I'm back at base. I recommend the Pickit2 as a programmer and there are Linux drivers on the Microchip web site for it. There is also this web site: **broken link removed** which looks very interesting.

I don't have Wine installed but if it gives access to the computer serial/parallel ports I don't see why it shouldn't work. The process of actually feeding data to the PIC while programming it is synchronous so the speed of operation shouldn't be an issue.

Brian.
 
Reactions: wassy

    wassy

    Points: 2
    Helpful Answer Positive Rating
I attach new version of JDM prog. from this forum,
maybe will help you to check your sch,
regards
 

Attachments

  • JDM_prog_Super_New.rar
    1.4 MB · Views: 168

So you're saying with a 13V zener diode, it should be wired from VPP to ground, with VPP still having a direct connection to the VPP pin of the PIC? Doesn't that sink all the current from VPP straight to ground. Please forgive my basic understanding of electronics

I have done a very crude MS Paint schematic. can you confirm that B is the correct way to insert the 13V zener into the circuit?



I tried setup A earlier today because I thought that was how it was supposed to go, this had the effect of limiting the voltage measured between VPP pin and VSS pin to 5V, which obviously didn't work either.

I got the windows version of picpgm to work in wine, but couldn't get WinPic800 or any others to detect the programmer. I think some of the programmers have a variable delay between VPP being pulled high and the CLK/DATA instructions being sent.

@pasicr: Thanks for uploading the advanced JDM. I have seen that on other forum postings. I'd probably like to make it at some point, but I wanted to start with something simpler, plus I will probably go out and buy PikKit2 next unless I manage to get my current JDM working properly. I am confident the schematic I have and the one I built is correct. I just need to tweak the levels it outputs. One of the big flaws of JDM I guess, as every serial port is slightly different.
 

Your second diagram is the correct one. A Zener diode works like an ordinary diode in one direction but has a controlled breakdown threshold in the other. Wired correctly as in the second diagram, if the VPP voltage goes higher than the Zener voltage, it starts to conduct and the current flowing through it holds the voltage at Zener level.

I still strongly suggest getting a Pickit, not only because it can program almost all PIC devices, EEPROMs and a few other parts but because it also has a built in logic analyzer and serial port. The other, less versatile approach would be to build a JDM style programmer with it's own power source so it doesn't rely on the serial port capability.

Brian.
 

Brian,

That seems to work. I added a 13V zener between VPP and GND and it is able to program, read, erase and re-program a 12F629 chip that I have. I need to do a bit more digging because my 10F200 and 12F509 still won't program. I have a feeling I may have damaged them with the high voltage previously. I'll order a handful more to test and play with but will depends when my next Farnell order goes in probably.

Only minor inconvenience is that the LED that I have in my JDM programmer (as per the schematic here, which is virtually identical to the one from the design I used over at instrucatbles, as in my first post) no longer lights up when programming. I'd rather have a working programmer though than a board with an LED that lights up occasionally

I will be getting a PicKit2 shortly I think, or at least borrowing my friends for a while to see if I really have goosed those other two PIC's.

Thanks again for your help.
 

The problem with LEDs on that kind of design is they can draw so much power relative to the ports capability that they can stop it working completely. Please remember that serial ports are not designed to power anything at all, they are basically signal input and outputs so any circuit trying to extract it's working power from them is potentially going to fail. It gets worse when the only way to stabilize voltages is to draw excessive curent from them to load the source more.

I would say go for a Pickit and also update the device list from the Microchip web site. Although they rarely announce it, they do keep the device list updated when new MCUs are released so the copy you get in the Pickit package will probably be out of date. There are numerous exact clones of Pickits (the whole design and firmware is on Microchip's web site) which work identically but there are also some that use a simplified power supplies which I would not recommend. The original uses a programmable and regulated MOSFET based voltage generator to provide an accurate VPP and has selectable VDD voltages as well, the cheaper clones usually do not.

Brian.
 

Thanks for the info. Would you recommend going for Pickit2 over Pickit3, I've heard people say that the version 2 is better, but I don't know why.
 

They are very similar. The '3' can program some of the newer devices that the '2' can't but I *think* some of the non-programming utilities were removed. If you are planning to use the more common varieties of PIC I would go for the Pickit 2, I have two of them here hooked up to the same PIC at the moment, one for programming and one for serial linking. I write PIC software most of the day and I haven't found a need for a PicKit 3 yet!

Brian.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…