# Yet another UPDI programmer Mk II

**URL:** <https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056>\
**Category:** Showcase\
**Created:** [February 23, 2025, 11:34am UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056 "2025-02-23T11:34:17Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![dmjlambert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dmjlambert/32/221001_2.png) [@dmjlambert](https://forum.arduino.cc/u/dmjlambert)\
**Post date:** [February 1, 2026, 11:40pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/21 "2026-02-01T23:40:25Z")

</div>

Is it not normal for the CC1 and CC2 resistors to be 5.1K instead of 1M? Or am I mistaken?

---

<div class="post-metadata">

**Author:** ![outbackhut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/outbackhut/32/1099892_2.png) [@outbackhut](https://forum.arduino.cc/u/outbackhut)\
**Post date:** [February 1, 2026, 11:46pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/22 "2026-02-01T23:46:26Z")

</div>

Yes I’ve rectified that

---

<div class="post-metadata">

**Author:** ![trinakie](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/trinakie/32/1126418_2.png) [@trinakie](https://forum.arduino.cc/u/trinakie)\
**Post date:** [February 27, 2026, 7:39pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/23 "2026-02-27T19:39:19Z")

</div>

Thanks for sharing this schematic, it is very convenient to be able to use a single Arduino window for both programming and serial monitor. I am a bit confused on the working principle with the Schottky diode. I am not sure I fully understand how the TX of the USB-to-UART adapter can transmit data to the UPDI port given the diode orientation. Is it because the TX pin in the adapter is pulled low when data is transmitted and this then pulls low the UPDI pin in the MCU?

I have implemented a simple UPDI programmer with a cheap CP2102 board from aliexpress and just placed a 1kOhm resistor between TX and RX and then connected the RX port to the UPDI pin of the attiny1624 that I want to program. This works very well in Arduino with megatinycore. I guess your schematic for auto switching between programming and serial communication should work fine also with my CP2102 adapter, do you agree?

---

<div class="post-metadata">

**Author:** ![hmeijdam](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/hmeijdam/32/218564_2.png) [@hmeijdam](https://forum.arduino.cc/u/hmeijdam)\
**Post date:** [February 27, 2026, 8:34pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/24 "2026-02-27T20:34:17Z")

</div>

Yes the pulling low by the TX pin of the serial adapter is what’s doing the transmitting.

If the resistor works for you now and you just add the PNP transistor (with it’s base resistor) I think it will work just fine. My schematic does not change anything to your programming connections.

It only adds the transistor and the connection to the RX pin on the Attiny. But that RX pin is high impedance (input) pin, so doesn’t interfere with the voltage levels.

---

<div class="post-metadata">

**Author:** ![trinakie](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/trinakie/32/1126418_2.png) [@trinakie](https://forum.arduino.cc/u/trinakie)\
**Post date:** [March 12, 2026, 2:37pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/25 "2026-03-12T14:37:11Z")

</div>

I have now implemented the circuit in a small PCB. The schematich is below. I can succesfully see the UART data in Arduino serial monitor, but the program fails with the error below. I have also tried reducing the baud rate to the lowest available (57600) but it did not help. But if instead I implent the simpler circuit (removing R1, Q1, D1 and shorting R2) in a breadboard it works fine. Do you know what could be the problem? Should I try shorting R2 and D1? Or any other tip?

EDIT:  
I have now implemented in a breadboard the circuit in the schematic below and got the same error when programming. But then removed Q1 and its base resistor and then I can program succesfully the attiny. So the issue with programming arises when I add Q1 and R1.

**Arduino Serial monitor**

```arduino
By Quentin Bolsee and Spence Konde
Version 1.3.1 - Aug 2025
Using serial port /dev/ttyUSB0 at 57600 baud.
Target: attiny1624
Set fuses: ['0:0b00000000', '2:0x02', '6:0x04', '7:0x00', '8:0x00']
Action: write
File: /home/user/.cache/arduino/sketches/13870171F2DA4C1512A2C5C7DE307E65/Blink_LED.ino.hex
pymcuprog.programmer - INFO - Setting up programming session for 'attiny1624'
pymcuprog.deviceinfo.deviceinfo - INFO - Looking for device attiny1624
pymcuprog.serialupdi.physical - INFO - Opening port '/dev/ttyUSB0' at '57600' baud
pymcuprog.serialupdi.link - INFO - STCS 08 to 0x03
pymcuprog.serialupdi.link - INFO - STCS 06 to 0x02
pymcuprog.serialupdi.link - INFO - LDCS from 0x00
pymcuprog.serialupdi.link - WARNING - UPDI init failed: Can't read CS register. likely wiring error.
pymcuprog.serialupdi.physical - INFO - Sending double break
pymcuprog.serialupdi.physical - INFO - Double-break sent. Retrying.
pymcuprog.serialupdi.physical - INFO - Opening port '/dev/ttyUSB0' at '57600' baud
pymcuprog.serialupdi.link - INFO - STCS 08 to 0x03
pymcuprog.serialupdi.link - INFO - STCS 06 to 0x02
pymcuprog.serialupdi.link - INFO - LDCS from 0x00
pymcuprog.serialupdi.link - WARNING - UPDI init failed: Can't read CS register. likely wiring error.
Traceback (most recent call last):
  File "/home/user/.arduino15/packages/megaTinyCore/hardware/megaavr/2.6.12/tools/prog.py", line 289, in <module>
pymcuprog.serialupdi.physical - INFO - Closing port '/dev/ttyUSB0'

```

**Circuit schematic**

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/7/8/7/787a7fd93bb43546608e33fe50aac27a356c51e2.png)

---

<div class="post-metadata">

**Author:** ![hmeijdam](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/hmeijdam/32/218564_2.png) [@hmeijdam](https://forum.arduino.cc/u/hmeijdam)\
**Post date:** [March 12, 2026, 8:14pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/26 "2026-03-12T20:14:52Z")

</div>

I would short R3 first and then see if it works.

I have no resistors at all. Just the diode.

---

<div class="post-metadata">

**Author:** ![trinakie](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/trinakie/32/1126418_2.png) [@trinakie](https://forum.arduino.cc/u/trinakie)\
**Post date:** [March 13, 2026, 5:58am UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/27 "2026-03-13T05:58:32Z")

</div>

I have tried shorting R3 and if I only short this resistor the programming still fails as before.

If I just break the connection between the collector of Q1 and the UPDI pin, it works both with R3 not shorted as well as with R3 shorted. So, somehow the PNP transistor affects the UPDI signal and makes it fail. Unfortunately I do not have an oscilloscope available, so I cannot check what's happening to the UPDI signal.

 ![Screenshot from 2026-03-12 15-32-30_b](https://europe1.discourse-cdn.com/arduino/original/4X/e/2/0/e2092e8cd7d1b58960a2a0a251adf5faa104ac20.png)

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [March 13, 2026, 6:19am UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/28 "2026-03-13T06:19:02Z")

</div>

It could be that the DTR signal from your CP2102 programmer is not getting high enough to switch off the PNP transistor. It must get quite close to the 5v of the ATtiny side to switch it off. Has your programmer got a 3v3/5v switch? Or maybe try say a 1k pullup between DTR and 5v.

---

<div class="post-metadata">

**Author:** ![trinakie](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/trinakie/32/1126418_2.png) [@trinakie](https://forum.arduino.cc/u/trinakie)\
**Post date:** [March 13, 2026, 7:06am UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/29 "2026-03-13T07:06:06Z")

</div>

Thant's a good point thanks. I have measured the DTR pin and it is at 3.35V, not 5V as I was thinking (I was using the 5V supply to the attiny). I have tried now using the 3.3V output of the programmer as supply of the attiny and the programming works fine.

I guess with this circuit and programmer I can only program using 3.3V supply, unless I use a MOS to translate the DTR level from 3.3V to 5V. Do you have any smarter suggestion?

The programmer I am using is the one below from Aliexpress:

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/f/6/7/f67d9286a4a4dd3f51d52446292b62ee7c15efc8.jpeg)

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [March 13, 2026, 7:20am UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/30 "2026-03-13T07:20:40Z")

</div>

OK. Then I'd try pulling the base of the PNP to 5v with a 1k resistor and put a blue or white led between R1 and DTR (cathode on programmer pin DTR ). You could probably use instead two red leds in series or a 3v3 zener diode.

**EDIT**  
corrected. see post #33

---

<div class="post-metadata">

**Author:** ![trinakie](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/trinakie/32/1126418_2.png) [@trinakie](https://forum.arduino.cc/u/trinakie)\
**Post date:** [March 13, 2026, 8:26am UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/31 "2026-03-13T08:26:45Z")

</div>

Thanks, so you mean something like this?

 ![Screenshot from 2026-03-12 15-32-30_c](https://europe1.discourse-cdn.com/arduino/original/4X/4/c/0/4c0e3e897e144cf1791e787b312377d532717a22.png)

My guess is that when DTR = 3.3V the LED is off, there is no current flowing in R1 and in the pullup resistor, the base of Q1 is at 5V and the programming should work. When DTR = 0V, if 5mA will flow through the pull-up resistor, the base of Q1 will be at 0V. Then some current will flow between the DTR pin and base of Q1 through the LED and R1. Is this the working principle?

Do you think a green LED with Vf of 2.3V would be enough? (I do not have blue, white or red LEDs available at the moment)

---

<div class="post-metadata">

**Author:** ![hmeijdam](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/hmeijdam/32/218564_2.png) [@hmeijdam](https://forum.arduino.cc/u/hmeijdam)\
**Post date:** [March 13, 2026, 8:32am UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/32 "2026-03-13T08:32:12Z")

</div>

Aha, that’s a good point! I am sure when I tested my pile of serial adapters I did not think about the voltage of the DTR pin. Maybe the ones that did not work at all had 3.3V DTR.

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [March 13, 2026, 9:10am UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/33 "2026-03-13T09:10:27Z")

</div>

The led is inverted in your diagram. I see I gave an ambiguous description because I meant the DTR label on R1. Sorry. If you have a green, then try it. 2 or 3 silicon diodes in series (not Schottky) could also work.  
The forward voltage of the diode/led prevents the base being pulled from 5v to 3v3 when the DTR is high.  
**EDIT**  
Because of the voltage divider formed by R1 and the new 1k resistor, it could be that only one silicon diode may be enough. I'm assuming in all this that DTR is pulled close to 0v when "LOW"

---

<div class="post-metadata">

**Author:** ![trinakie](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/trinakie/32/1126418_2.png) [@trinakie](https://forum.arduino.cc/u/trinakie)\
**Post date:** [March 13, 2026, 12:41pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/34 "2026-03-13T12:41:13Z")

</div>

Got it, thanks. I have realized that I have some SMD blue [LEDs](https://eu.mouser.com/ProductDetail/Kingbright/APT3216LVBC-D?qs=6oMev5NRZMHkh%2FkgOlUYsw%3D%3D) with 2.65V forward voltage, I will try as soon as I get access to a microscope as I need to cut the PCB trace between the DTR pin and R1 to insert the LED. I will report back sometime next week when I test your suggestion. Thanks again.

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [March 13, 2026, 1:25pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/35 "2026-03-13T13:25:17Z")

</div>

I'm not sure I understand what you have already built. If that circuit with R1, Q1 etc. is a external add-on, then surely it would be easier to add the led on your external circuit instead of making a deep cut into the adapter board further, it doesn't matter at which end of R1 thr led is placed because it simply has to be in series with the Q1 base circuit.  
I'd try it on a breadboard anyway to check it out first.

---

<div class="post-metadata">

**Author:** ![trinakie](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/trinakie/32/1126418_2.png) [@trinakie](https://forum.arduino.cc/u/trinakie)\
**Post date:** [March 13, 2026, 4:21pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/36 "2026-03-13T16:21:43Z")

</div>

I haven't shown the details of the PCB I did so I understand that it can be confusing. It is a board that can be plugged directly to the CP2102 programmer. So when I wrote about cutting the trace between R1 and DTR I meant the trace in my PCB:

 ![Screenshot from 2026-03-13 16-38-32_b](https://europe1.discourse-cdn.com/arduino/original/4X/7/f/1/7f1a3655090470a793e32bde2f65aa76f4e7b32c.png)

I have tested this in the PCB using a green LED with 2.3 forward voltage and the programming works fine. However, the serial communication doesn't work properly, I just see weird characters in the Arduino serial monitor and if I measure the voltage at the base of Q1 is always 5V, it never change after programming has finished. Do you think it's due to the low Vf of the green LED?

EDIT: I have tested replacing the green LED with two series 1N4001 diodes but still the serial monitor doesn't work while programming works. The base voltage of Q1 stays at 4.24V when not programming and goes to 4.75V during programming.

 ![Screenshot from 2026-03-13 17-15-29](https://europe1.discourse-cdn.com/arduino/original/4X/6/3/d/63db9e4108435c1c25e13741a2ce1b7e2f40665f.png)

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [March 13, 2026, 9:02pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/37 "2026-03-13T21:02:24Z")

</div>

> [@trinakie](#):
>
> I have tested this in the PCB using a green LED with 2.3 forward voltage and the programming works fine. However, the serial communication doesn't work properly, I just see weird characters in the Arduino serial monitor and if I measure the voltage at the base of Q1 is always 5V, it never change after programming has finished.

That the Q1 base is always at 5V is odd. If you short the DTR pin to ground, does the LED light even dimly ? If not, does reversing the led make a difference.

That CP2102 programmer is a bit of a mystery to me. Unfortunately I don't have one and I'm not sure how strongly the DTR pin is pulled to 3v3 or pulled to 0v so I can only suggest some further experiments.

One simple thing to try would be to put 5v via a 1K resistor directly on the DTR pin of the CP2102 with neither the LED nor the additional 1k pullup resistor on the base of Q1. That is with the circuit you have displayed in post #25. The pins on the CP2102 chip are 5v tolerant according to this: [https://www.silabs.com/documents/public/data-sheets/CP2102-9.pdf](https://www.silabs.com/documents/public/data-sheets/CP2102-9.pdf)

---

<div class="post-metadata">

**Author:** ![hmeijdam](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/hmeijdam/32/218564_2.png) [@hmeijdam](https://forum.arduino.cc/u/hmeijdam)\
**Post date:** [March 14, 2026, 1:53pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/38 "2026-03-14T13:53:20Z")

</div>

If you desolder R1 put it vertical you can vertically add the led on the other pad and make a “bridge” out of them with a lottle solder.

At least that is how I once put two resistors in series, as I did not have the right value anymore.

---

<div class="post-metadata">

**Author:** ![trinakie](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/trinakie/32/1126418_2.png) [@trinakie](https://forum.arduino.cc/u/trinakie)\
**Post date:** [March 14, 2026, 3:05pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/39 "2026-03-14T15:05:53Z")

</div>

I have tried the setup with 1k pull-up resistor from base of Q1 to 5V and with green LED in series to R1. I connected however the cathode to ground instead of connecting it to the DTR pin. In this case the LED emits light and there are about 2mA current through it and voltage across the led is about 2.3V. The voltage at Q1 base is 4.3V. If I replace the green LED with one 1N4001 diode, the Q1 base voltage is about 4.15V, thus still very far away from 0V.

I have tried removing the 1k pull-up at Q1 base, removing the series LED (or diode) and connecting a 10k pull-up resistor between DTR pin and 5V. Connected back R1 to the DTR pin and the programming fail. Vb is 4.15V when DTR is 0V and 4.3V when DTR is 3.3V.

I think the best solution (but difficult to apply in my current PCB) is to implement a level shifter using a BSS138 as below:

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/6/e/6/6e61722e715cbb41db2cf7bfa38889784f754507.png)

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [March 14, 2026, 7:38pm UTC](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/40 "2026-03-14T19:38:31Z")

</div>

> [@trinakie](#):
>
> I think the best solution (but difficult to apply in my current PCB) is to implement a level shifter using a BSS138

I tend to agree. That is a classic I2C level shifter and it may be good to get a cheap one from Aliexpress and experiment with it on a breadboard before committing to PCB.

[Previous page](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056.md?page=1)

[Next page](https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056.md?page=3)
