Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Support => Topic started by: ian on December 11, 2009, 10:11:03 am

Title: PIC programmer SMPS draft
Post by: ian on December 11, 2009, 10:11:03 am
Draft SMPS for Bus Pirate PIC programmer. This isn't final, so the license is Creative Commons-BY-SA-NC.

I have a demo firmware that will hold the output at 13volts, but there's still a problem enabling the PNP transistor (VPP out drops to <2volts). It might be my transistor pinout is wrong, or maybe the 1n4148 is a bad switcher, or maybe the whole design is flawed (using the NPN instead of a FET).

I'll do more testing after the web platform project is out the door.
Title: Re: PIC programmer SMPS draft
Post by: s3c on December 11, 2009, 02:18:59 pm
Thanks for the link Ian, the two transistors connected to VPPEN turn the output voltage on and off I'm guessing what's the transistor connected to MCLR for?
Title: Re: PIC programmer SMPS draft
Post by: ian on December 11, 2009, 02:26:47 pm
The transistor on MCLR is to pull it low to reset the PIC. (The PIC has a pull-up resistor on MCLR).
Title: Re: PIC programmer SMPS draft
Post by: ian on December 11, 2009, 03:05:21 pm
I looked at a few other high-side switches and fixed the problem. All the current was draining out the base of the PNP, it needs a 10K resistor between the PNP base and NPN collector. Now it works fine.
Title: Re: PIC programmer SMPS draft
Post by: ian on December 11, 2009, 03:31:31 pm
Corrected schematic image.
Title: Re: PIC programmer SMPS draft
Post by: s3c on December 12, 2009, 03:24:55 am
Guess this is just my lack of analog experience but why not just turn off the VPPEN output, not tying it to ground but what's the difference?
Title: Re: PIC programmer SMPS draft
Post by: ian on December 12, 2009, 07:56:24 am
You're not the only one, I'm a mostly digital guy myself.

Which switch do you mean?

Q4 and Q2 enable/disable the 13volt supply to the MCLR pin. The voltage has to rise to 13volts pretty fast or the PIC just sees it as a reset command and doesn't enter programming mode. The SMPS takes longer to get to 13volts than the specs allow, so the transistor pair is required to switch it quickly.

Q3 is used to pull the MCLR pin low for a reset. It's a transistor version of a reset button. A pullup resistor on the PIC PCB holds MCLR high (holds it at V+ - 3.3volts, 5volts, whatever) for normal operation, grounding it resets the PIC.
Title: Re: PIC programmer SMPS draft
Post by: s3c on December 12, 2009, 02:10:35 pm
Why the 100Ohm on the MCLR resistor? The pullup on the board and the 10k should avoid excessive current and get your reset a bit closer to ground.
Title: Re: PIC programmer SMPS draft
Post by: ian on December 12, 2009, 03:34:18 pm
I'm not yet sure about R4 or R7, it depends if the programming firmware uses Q3 to ground VPP. If yes, then R4 is needed, but I haven't confirmed this in the code yet.
Title: Re: PIC programmer SMPS draft
Post by: 0x3333 on December 12, 2009, 07:57:46 pm
Hi!

About the PWN, what is the Frequency and duty cycle?
Title: Re: PIC programmer SMPS draft
Post by: ian on December 12, 2009, 08:23:17 pm
I used these spreadsheets to calculate the proper period and duty cycle for my 680uH/0.66A inductor @3.3volt-5volt supply and 13volts output:

http://www.instructables.com/id/High-Vo ... SMPSBoost/ (http://www.instructables.com/id/High-Voltage-Switch-Mode-Power-Supply-SMPSBoost/)

The final inductor will probably be SMD/680uH/0.12A.

( ! ) 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.00992066808session_write_close ( )...(null):0
20.01022198384ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01022199160Database_MySQL->query( ).../DatabaseHandler.php:119
40.05532337872Database_MySQL->error( ).../Db-mysql.class.php:273