Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Support => Pirate PIC programmer => Topic started by: ian on January 24, 2010, 04:22:41 pm

Title: PIC/AVR high voltage programming adapter
Post by: ian on January 24, 2010, 04:22:41 pm
I used this:
http://www.nomad.ee/micros/mc34063a/index.shtml (http://www.nomad.ee/micros/mc34063a/index.shtml)

Vin      5      V
Vout  13      V
Iout       10mA
Vripple    200   mV(pp)
Fmin    100   kHz

Ct=271 pF
Ipk=62 mA
Rsc=4.839 Ohm
Lmin=437 uH
Co=3 uF
R=180 Ohm
R1=1.6k R2=15k (12.97V)

To calculate the parts value for the MC34063, but I didn't order the right parts so I had to make some substitutions.

I used:
Cin = 10uF tantalum
Cout=4.7uF
Rsc=1.5ohm
ct=220pf (too small!)
l=630uH/0.12A
Title: Re: PIC/AVR high voltage programming adapter
Post by: Sjaak on January 24, 2010, 08:23:12 pm
Ian, here is an alternate method of creating a higher voltage, just in case the chip is hard to obtain in large quantities.

http://spritesmods.com/?art=ucboost (http://spritesmods.com/?art=ucboost)

BTW i get one when the finial design is out !
Title: Re: PIC/AVR high voltage programming adapter
Post by: ian on January 24, 2010, 09:18:11 pm
I did the same thing here:
http://dangerousprototypes.com/2009/12/ ... er-update/ (http://dangerousprototypes.com/2009/12/10/bus-pirate-pic-programmer-update/)

but by using the mc34063a I saved a signal line and made an AVR high voltage programmer on the same board. The mc34063 is really common from multiple manufactures, availability shouldn't be a problem (hopefully).
Title: Re: PIC/AVR high voltage programming adapter
Post by: Sjaak on January 24, 2010, 10:30:27 pm
Oops, I saw it before, but guessed the new design was an update of it (new pcb). Please forget my last post. :D
Title: Re: PIC/AVR high voltage programming adapter
Post by: Sjaak on February 02, 2010, 11:08:05 pm
Is the schema somewhere available? I cant find it anywhere :(
Title: Re: PIC/AVR high voltage programming adapter
Post by: ian on February 03, 2010, 08:00:16 am
I haven't published it yet because the values aren't all worked out. Would you like a copy?
Title: Re: PIC/AVR high voltage programming adapter
Post by: Sjaak on February 03, 2010, 12:32:44 pm
sure!

The voltage isn't that critical, right?
Title: Re: PIC/AVR high voltage programming adapter
Post by: ian on February 03, 2010, 12:39:27 pm
Do you want a through-hole PCB or a SMD kit too? pppd's friend sent some extra parts I needed, they should be here soon. THen I can send a kit.
Title: Re: PIC/AVR high voltage programming adapter
Post by: Sjaak on February 03, 2010, 12:58:42 pm
The schematic is fine for now ;) I just want to take a look at it.

SMD will be my choice, only if the components aren't to small and the pcb is stackable. :D
Title: Re: PIC/AVR high voltage programming adapter
Post by: haley0918 on February 13, 2010, 06:23:46 am
I'd just received the high voltage programming board from the Free PCB Sunday. May I know where can I find the full schematic and the parts list of it?
Title: Re: PIC/AVR high voltage programming adapter
Post by: pppd on February 13, 2010, 12:00:13 pm
I don't know for sure yet, but I am afraid this adapter can't be used as HVSP for AVRs. There are too few pins available. In the HVSP mode there are 7 pins required:

Code: [Select]
1. RESET 12V
2. VCC   5V
3. GND   GND
4. SCI   SERIAL CLOCK IN
5. SDI   SERIAL DATA IN
6. SII   SERIAL INSTRUCTION IN
7. SDO   SERIAL DATA OUT

The VCC could be connected to an external power supply, but it won't help as we still need to control SCI, SDI, SII, RST and get data back from SDO.

Please correct me if I am wrong.
Title: Re: PIC/AVR high voltage programming adapter
Post by: ian on February 13, 2010, 12:08:25 pm
Could be, I'm not entirely sure. I thought fuses were set through the 4 wire ISP connection with a programming voltage on reset, if there's a different interface then it's likely that it won't work.

This was originally designed solely as a PIC programming adapter, and I thought why not add AVR too? There wasn't a whole lot more thought to it than that, so this is a very early (dangerous?) prototype:)
Title: Re: PIC/AVR high voltage programming adapter
Post by: pppd on February 13, 2010, 12:58:01 pm
Is the design final? Because if there is one more controllable pin left on the BP side we could do something about it.
Title: Re: PIC/AVR high voltage programming adapter
Post by: ian on February 13, 2010, 01:03:00 pm
No, it can be changed. This was just a first draft. I looked at the datasheet and indeed an additional pin is required. I'm not sure where to get it though, because we're already using all 5 Bus Pirate pins.
Title: Re: PIC/AVR high voltage programming adapter
Post by: pppd on February 13, 2010, 02:18:37 pm
Then maybe AVR ISP should be removed altogether as it can only serve as regular serial programmer, in which case the RESET pin should be 0-5V and not 12V. I am not sure the HVSP should be used to perform in-circuit programming so it would require a separate socket for the AVR anyway.
Title: Re: PIC/AVR high voltage programming adapter
Post by: Sjaak on February 13, 2010, 02:42:29 pm
@ian: Dunno if you agree with this.. But you've got two extra pins on the isp connector which you can use. Also you can use the 3.3 or 5v out as an output (dunno the speed which you can achieve but it is quick enough to apply 12v to the circuit) Also there is a 3.3 available (not switchable tough)

I realize this is a bit against the design of bp, but an extra feature won't hurt ;)
Title: Re: PIC/AVR high voltage programming adapter
Post by: ian on February 13, 2010, 02:46:10 pm
I didn't think about it not working in-circuit.

I guess it's still nice as a 'standard' ISP pinout that you can connect to a target with a 2x3 cable.
Title: Re: PIC/AVR high voltage programming adapter
Post by: pppd on February 13, 2010, 03:03:24 pm
I agree, especially when you have cables that fit already :)

I just can't live with the 12V being wasted :) I think I will need to design a simple adapter which will utilize ATtiny2313 to drive the HVSP, and BP will be used as a UART/SPI proxy.. Maybe it's not the nicest solution, but at least I will use the 12V and get to reset 8 pin ATtiny chips.
Title: Re: PIC/AVR high voltage programming adapter
Post by: Sjaak on February 13, 2010, 03:56:29 pm
Sounds a bit like cheating ;P I would take a PIC instead, otherwise it would like the PIC can't do it and an AVR can..
Title: Re: PIC/AVR high voltage programming adapter
Post by: pppd on February 14, 2010, 11:18:56 am
[quote author="ian"]I'm not sure where to get it though, because we're already using all 5 Bus Pirate pins.[/quote] I have very little idea about electrical circuits but why do we need two PINs ( CS & AUX ) to control the 12V on RST/MCLR? Is this something PIC need? Maybe there could be a jumper to choose whether you want to use PIC or AVR?
Title: Re: PIC/AVR high voltage programming adapter
Post by: ian on February 14, 2010, 02:41:43 pm
CS pulls the MCLR/RESET pin to ground to reset the PIC or AVR (PIC pin won't tolerate the +12volts), AUX switches the 12volt supply on and off through a PNP/NPN transistor pair.
Title: Re: PIC/AVR high voltage programming adapter
Post by: pppd on February 14, 2010, 03:15:32 pm
The algorithm to enter the AVR HVSP is pretty simple, just a few steps:

1. SDI, SII, SDO, Vcc down to 0V
2. Apply 4.5 - 5.5V to Vcc
3. Wait 20-60us and apply 11.5 - 12.5 to RESET
4. Release SDO
5. Wait at least 300us before sending any instructions

The RESET pin remains high at 12V throughout the entire programming process, so it could be controlled with CS as it is now. Just the power supply would need to be ON, but as we already can control it with setting PowerUp/Dn on BP side I guess it would be okay? For AVR to work this would require the VTarget to be connected directly or through a jumper to the BP 5V.
Title: Re: PIC/AVR high voltage programming adapter
Post by: Sjaak on February 14, 2010, 10:25:23 pm
[quote author="ian"]
CS pulls the MCLR/RESET pin to ground to reset the PIC or AVR (PIC pin won't tolerate the +12volts), AUX switches the 12volt supply on and off through a PNP/NPN transistor pair.
[/quote]

Doesn't need the pic to have +12v on the mclr pin to program it?

I could only find AN910 (microchip) about programming devices pic12, pic16 and pic18. Are there any other application notes or papers that describe the other pics? or are they simular?

for the avr part I have found avr910 (notice the same number as microchip coincidence or what?), but haven't dived very much into it..
Title: Re: PIC/AVR high voltage programming adapter
Post by: ian on February 15, 2010, 07:51:26 am
Quote
Doesn't need the pic to have +12v on the mclr pin to program it?

The target PIC MCLR pin needs +12-+13, but the Bus Pirate pin that controls the VPP can only tolerate 5.5volts. 12/16/18 all need the +13VPP, but newer PICs (like the Bus Pirate) just use a special pattern on the MCLR pin @ VCC. (as I understand it, I'm not (yet) a PIC programming expert).
Title: Re: PIC/AVR high voltage programming adapter
Post by: Sjaak on February 15, 2010, 07:14:06 pm
Got any links to documents? I'm just curious, but i couldn;t find anything on the new pics.

What I've found:

AN910 describes pic12, 16 and 18.
AVR910 describes the low voltage avr
Title: Re: PIC/AVR high voltage programming adapter
Post by: ian on February 15, 2010, 07:27:46 pm
For PIC24F there's this from the family reference manual:
http://ww1.microchip.com/downloads/en/D ... 39716a.pdf (http://ww1.microchip.com/downloads/en/DeviceDoc/39716a.pdf)
http://www.microchip.com/stellent/idcpl ... NextRow=51 (http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2575&fragment15_NextRow=51)

I didn't read it, but I think it is probably the programing specs. There are also family manuals for the 30F and 33F. The USBPICPROG app and firmware currently program the 12/16/18 and 30, but not the 24F or 33F.
Title: Re: PIC/AVR high voltage programming adapter
Post by: SineWave on March 24, 2010, 03:10:12 am
Hi, trying to find the schematic or BoM in order to complete my programmer. Thanks.
 - Adam
Title: Re: PIC/AVR high voltage programming adapter
Post by: ian on March 24, 2010, 10:00:29 am
Here are the schematics for both the through-hole and SMD version. Sorry about that.

Note: I used C4=10uF with no problem.
Title: Re: PIC/AVR high voltage programming adapter
Post by: SineWave on March 24, 2010, 11:44:13 am
Thank you very much. I was surprised that the board you sent was the SMD version. I managed to find an SMD MC34063A in a spare cigarette lighter to usb adaptor. Will let you know how I go. :)
 - Adam
Title: Re: PIC/AVR high voltage programming adapter
Post by: ian on March 24, 2010, 11:56:16 am
Sorry about that. I'm moving and things are a little crazy the last few weeks.
Title: Re: PIC/AVR high voltage programming adapter
Post by: Sjaak on March 25, 2010, 11:05:25 pm
Some prelimary support for programming pics: http://dangerousprototypes.com/forum/in ... 39#msg3539 (http://dangerousprototypes.com/forum/index.php?topic=291.msg3539#msg3539) with a binmode on its way.

Noticed I don't have a hvp adapter, but an early prototype Ian made ( http://dangerousprototypes.com/2009/12/ ... er-update/ (http://dangerousprototypes.com/2009/12/10/bus-pirate-pic-programmer-update/) ). But the commands are the same (after applying the Vpp)
Title: Re: PIC/AVR high voltage programming adapter
Post by: Sjaak on March 27, 2010, 01:09:23 pm
@ian: I saw in the other topic ( http://dangerousprototypes.com/forum/in ... 68#msg3568 (http://dangerousprototypes.com/forum/index.php?topic=412.msg3568#msg3568) ) you are trying to program a pic16f628.  These have two modes of programming a hvp and lvp one. you can select this by an extra pin (PGM). I know it is a HVP adapter (duh :P) but we can use MISO for this purpose. I would also like a way to pass through the buspirate power supply to the target.
Title: Re: PIC/AVR high voltage programming adapter
Post by: Sjaak on May 18, 2010, 11:15:17 pm
http://hackaday.com/2010/05/17/magicall ... ent-143117 (http://hackaday.com/2010/05/17/magically-repair-avr-chips/#comment-143117)

They asked for it ;) too bad there aren't enough pins..
Title: Re: PIC/AVR high voltage programming adapter
Post by: Jim on May 19, 2010, 03:14:52 am
If people really, really want parallel programming as well you could easily throw some gpio port expanders onto the adapter.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01392184448session_write_close ( )...(null):0
20.01422316040ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01422316816Database_MySQL->query( ).../DatabaseHandler.php:119
40.05742455544Database_MySQL->error( ).../Db-mysql.class.php:273