Skip to main content

Programming Voltage SMPS

This little plank is an adjustable Switch Mode Power Supply that generates a 5-16volt programming voltage (VPP) for microcontroller and EEPROMs. This includes PIC 12F/16F/18F (13volts), ATmega (12volts), and various other chips. Includes FETs to switch the voltage on and off, and short to ground.

  • 5-16volt output
  • VPP control (high/ground)
  • Feedback output clamped to ~4.7volts (protect Bus Pirate)
  • VPP output clamped to ~18volts (protect humans)
danger

Programming Voltage SMPS is "in development". If hardware is available it has passed basic functionality tests, but there isn't full documentation or support just yet. At this stage, it's best suited for developers who are comfortable with hardware and firmware development. Or for those who want to follow along.

Overview

The circuit is a copy of the Microchip PICkit 2 programmer, with a few modifications.

Switch Mode Power Supply (SMPS)

Inductor L1 charges from the Bus Pirate power supply. A pulse width modulated signal switches FET (Q4) to discharge the inductor into the output capacitor C15 through Schottky diode D2. This is the voltage boost.

A voltage divider (R22, R24) brings the output into a safe range for the Bus Pirate to measure. If the voltage gets too high, the PWM is disabled. If the voltage drops too low, the PWM is enabled. This is the SMPS feedback loop.

Voltage Clamps

So far we have the bog standard SMPS from a PICkit2 programmer. Since this board will be used for development, we added a few guardrails to protect the Bus Pirate, the target chip and humans.

4.7volt Zener diode D4 clamps the output of the resistor divider somewhere between 4.4 and 5volts, which is safe for the Bus Pirate. A 5.1volt diode might seem ideal, but cheap Zeners have a wide tolerance - 4.8-5.4volts for a 5.1volt Zener. The 4.7volt Zener is a safer choice.

VPP output is clamped at 16volts by Zener diode D3. D3 is an 18volt Zener, but with slop it could be anywhere from 16.8 and 19.1volts. If the voltage gets too high, the Zener conducts to ground. There’s no protection resistor so in the worst case scenario the Zener burns out “open” and shorts the SMPS to ground. The board will be ruined, but it will prevent runaway output.

caution

The Zener diodes are a safety feature, not a guarantee. It’s possible to damage the Bus Pirate or target chip if the SMPS is misused. When developing new code, especially, enable a current limit in the Bus Pirate power supply configuration.

VPP Control

Two FETs (Q1, Q3) form a high side switch that controls VPP to the target chip. Another FET (Q2) shorts VPP output to ground, usually used to reset the target chip. The Bus Pirate controls these FETs through IO1 and IO0.

Pinout

The Programming Voltage SMPS has two headers, one for the Bus Pirate and one for the target chip.

VPP Header (target)

PinNameVoltageFunction
1VPP5-16voltsRaw output from the SMPS for debugging
2VPP_TGTGND-16voltsSwitched output for target VPP
3VOUT_TGT1-5voltsBus Pirate power supply output for target power
4GNDGNDGround
5IO41-5voltsBus Pirate IO4 for programming target (various)
6IO51-5voltsBus Pirate IO5 for programming target (various)
7IO61-5voltsBus Pirate IO6 for programming target (various)
8IO71-5voltsBus Pirate IO7 for programming target (various)

The VPP header pinout is roughly similar to the PIC ICSP header used in older Bus Pirates: VPP_TGT, V+_TGT, GND, PGD, PGC.

Control Header (Bus Pirate)

PinNameFunction
1VOUTBus Pirate power output
2VPP_LOWVPP pin control, short to ground
3VPP_HIGHVPP pin control, enable SMPS output to pin
4VPP_PWMPWM signal that controls the SMPS
5VPP_ADCFeedback voltage from the SMPS
6IO4Bus Pirate IO4
7IO5Bus Pirate IO5
8IO6Bus Pirate IO6
9IO7Bus Pirate IO7
10GNDGround

IO0 t o IO3 control the SMPS and switch VPP output to the target chip. IO4 to IO7 are available for programming the target chip: SPI, 2 wire protocols, etc.

Schematic

Programming Voltage SMPS schematic and PCB are available in the Bus Pirate 5 hardware repository.

BOM

ItemQuantityReference(s)ValueFootprint
11C130.1uFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder
21C1410uF/16V/CASE-ACapacitor_Tantalum_SMD:CP_EIA-3216-18_Kemet-A
31C1547uF/25V/CASE-DCapacitor_Tantalum_SMD:CP_EIA-7343-31_Kemet-D
41D1LEDLED_SMD:LED_0805_2012Metric
51D2BAT54WPackage_TO_SOT_SMD:SOT-23
61D3BZT52C18W (18V)Diode_SMD:D_SOD-123
71D4BZT52C4V7W (4.7V)Diode_SMD:D_SOD-123
81J1Conn_01x10Connector_PinSocket_2.54mm:PinSocket_1x10_P2.54mm_Horizontal
91J4Conn_01x08Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_Horizontal
101L1680uHLibrary:L_YP0504
111Q1MMBT3906Package_TO_SOT_SMD:SOT-23
123Q2, Q3, Q4MMBT3904Package_TO_SOT_SMD:SOT-23
131R12KResistor_SMD:R_0805_2012Metric
141R229K1Resistor_SMD:R_0805_2012Metric
151R23100KResistor_SMD:R_0805_2012Metric
161R243K3Resistor_SMD:R_0805_2012Metric
173R25, R27, R2910KResistor_SMD:R_0805_2012Metric
181R28100RResistor_SMD:R_0805_2012Metric

Resources

Get Bus Pirate

Community

Documentation

Bus Pirate 5 documentation is broken into hardware and firmware sections. Here's some other fun stuff you might enjoy.