Background
This is a follow up to my earlier post by the same name, for LVP. Please read that first, since it discusses the basics. In this one, i will discuss HVP.
Current Status
I am able to program the PIC12F675 in HVP mode. As expected its quite slow, takes around 2-3 mins to burn a 500 byte program.
Hardware
Obtaining a High voltage > 9V from USB
i wanted to investigate whether a high voltage could be obtained from the USB port. There are voltage-pump/ charge-pump ICs like LM2623, MAX660,
The problem with Txd and flip-flop at 10V
i planned to supply the 10V to the flip-flop as supply, and use the flip-flops output to drive the VPP. However, i ran into an issue here. Txd, which drove the CLK of the flip-flop, was still at 5V, and while it could reset the flip-flop, it could not set it. Hence i kept the flip-flop at 5V, and added a NPN transistor to provide the 10V.
The VCC of the transistor was 10V from the ADM660. Output of the flip-flop was fed as input to base. emitter to ground. The Output from collector now provided the high voltage to VPP. Rbase=Rload=10k.
The working circuit
The circuit is powered by the usb port on the right. The Flip-flop with the LED indicating its output state is on the left. Next comes the transistor which changes the fip-flop output from 5V to 10V. Next comes the ADM660 voltage-doubler which provides the VCC of 10V for the transistor. Last is the PIC12F675, which gets its VPP from the transistor output.
Software
This time, i tried out a new software : pickle( old version is called k8048) from kewl.org, written in C. (This site also has a nice list of PICs that support LVP.) It supports a lot of PICs and modes, and is simple and easy to modify. I had to modify it, since it depends on the usb-serial-port to support the BREAK functionality, which my adapter does not.
The change is to introduce a new config param( bit-rule) VPP_TOGGLE_ON_PULSE, and alter the set_vpp() method so that it when VPP_TOGGLE_ON_PULSE is true, it sends a single 0 instead of the BREAK functionality.
The .k8048 file should be created in the home directory, and has the config.
the ktest command helps to check whether the pins have correct voltages.
For serial-port option, the connections are fixed in the code, not in the .k8048 file. So DTR->PGD, PGD->CTS,RTS->CLK
and Txd->Vpp. You need to follow these exactly.
The common reason
for "device not detected" is that Vpp is not properly applied. Confirm that you have a Vpp > VDD + 3.5 V. Check whether it turns on
and off correctly. Put an LED with a 10k resistor as an
indicator on it. It should be low before programming, and will go
high/low during programming, and go low after its finished.
The command to use for programming depends on the instruction-set of the chip. For 12f675, i used k14, since it has a 14-bit instructions set.
For validating device id, i use "k14 id".
For programming, k14 program <hexfile>
Do not set any flags(bitrules), unless you understand them.
The zip with the modified files is available as k8048_vpp_pulsed.zip under http://milunsagle.in/webroot/downloads/
Hi Manoj, You are making a great job thankx alots. When i downloaded the K8048_vpp_pulsed.zip file i can't find the "k8048.h" include file. is there a problem?
ReplyDeleteHi Yahia,
Deletemy zip file only has the changed files. you need to download the original k8048 zip and overwrite with my zip.
Thank you very much, Manoj.
DeleteHi Manoj, I know this is an old post, but do you have your last schematic with the added ADM660 and transistor?
ReplyDeleteThanks a lot!
hi martin, afraid not
Delete