DIY HV UPDI Programmer - Dlloydev/jtag2updi GitHub Wiki

Introduction

This HV programmer will allow using the additional configuration settings for the UPDI pin without the fear of getting locked out from the MCU. This programmer has 3 programming modes: UPDI, HV or PCHV (described below). The desired mode can be selected by switch or jumper.

Click to enlarge

Bill of Materials

Item Qty Part Number or Value Description
1 1 --- Solderless Breadboard
2 1 A000005 Arduino Nano (or UNO or Pro Mini)
3 1 LTC1262CN8 5V to 12V Converter, 30mA
4 1 SFH615A-3 Opto-isolator, 100-200% CTR
5 1 1N5817 Schottky Diode, 20V, 1A
6 1 470Ω Resistor
7 1 1KΩ Resistor
8 2 0.22μF Capacitor
9 2 4.7μF - 10μF Capacitor
10 1 SP3T Switch Mode selector (can use jumper wire)

Schematic

Click to enlarge

Assembly and Setup

  1. Connect the Hardware (everything except the 4.7μF - 10μF capacitor on the reset pin)

  2. Install megaTinyCore

  3. Install the HV Programmer Firmware

    ● Click on the green "Clone or download" button, then select "Download ZIP".

    ● Unzip this file in a folder on your PC, then load the sketch "jtag2.updi.ino" into the Arduino IDE.

    ● From the IDE, select Tools > Board > "Arduino Nano".

    ● Then select Tools > Port > (serial port used by the Nano).

    ● Then select Sketch > Upload.

  4. Connect the 4.7μF - 10μF capacitor to the Nano's reset pin. This will disable the auto-reset circuit and write-protect the firmware in case the user inadvertently selects Sketch "Upload" instead of Sketch "Upload Using Programmer".

  5. From the IDE, select Tools > Programmer > "jtag2updi (megaTinyCore)".

You can now use the Nano HV programmer to "Burn Bootloader" or to "Upload Using Programmer" from the Arduino IDE. Make sure to choose the appropriate board, chip and port setting for the target.

Functional Description

Programmer Mode Selection:

A7 Switch Prog Mode PA0 Configurations HV Pulse Power Cycle
GND OFF UPDI NO NO
3.3V HV UPDI, RESET YES NO
5V PCHV UPDI, RESET, GPIO YES YES

Status Led Operation:

Red and yellow LEDs are ON when in programming mode. On startup, the yellow LED will indicate overload status.

OVL Sense:

On startup, the OVL sense analog input (A6) will be checked. If the voltage on A0-A5 (target power) has dipped below 90% (4.5V), then the yellow LED will indicate overload status by blinking at 4Hz. The user will then need to correct the problem and press reset to clear.

UPDI Mode:

This mode would be used when the UPDI pin is configured as UPDI or for any target device that isn't HV tolerant.

HV Mode:

This mode applies the 12V UPDI enable sequence (HV pulse) at the start of the programming sequence. This temporarily reconfigures the UPDI/Reset pin to UPDI mode which will remain in this state until the next POR. This allows programming to occur when the pin is configured as Reset. A power on reset (POR) needs to occur for any fuse setting changes to take effect.

PCHV Mode:

Power Cycle High Voltage mode (PCHV) will initiate a power cycle and HV pulse at the start of the programming sequence. At the end of the sequence, a second power cycle will occur which causes any new fuse setting to take effect. The power cycle OFF duration has been set to 10ms. This mode would be used when the UPDI/Reset pin is configured as Reset or as GPIO.

⚠️ **GitHub.com Fallback** ⚠️