1

I have this ATtiny1616 breakout board and I'm attempting to upload an Arduino sketch to it following this documentation, but I'm getting the error "A programmer is required to upload" upon uploading a simple blink sketch. I have the following parameters set in the IDE:

Board: ATtiny

Chip: Attiny1616

Programmer: Serial UPDI: Slow 57600 baud

I am using this USB-Serial adapter and it is connected to the ATtiny like so:

USB Vcc -> Vin

USB GND -> GND

USB RX -> 1k OHM

USB TX -> 1k OHM

1k OHM -> UPDI

And I have an LED connected to pin 5 of the ATtiny:

PIN 5 -> LED -> 220 OHM -> GND

Any help would be greatly appreciated. Thank you.

Edit: Below is the circuit. I also thought that maybe I had RX and TX mixed up, so I tried switching those connections but that didn't work either.

enter image description here

Edit 2: Using Arduino IDE 1.8.19 I get this error:

pymcuprog.pymcuprog_errors.PymcuprogError: UPDI initialisation failed

mfusco
  • 11
  • 2
  • The error message seems to imply that you have not selected an appropriate programmer from the list available in the IDE tools menu ( bottom of page). The Adafruit recommendation (your link) is SerialUPDI - SLOW: 57600 baud. – 6v6gt Mar 18 '24 at 05:19
  • Thank you for your response, however as per my OP I have that parameter set. – mfusco Mar 18 '24 at 13:26
  • are these header pins soldered on the PCB or you simply plug the header pins to the breadboard? – hcheung Mar 18 '24 at 14:55
  • I just have male header pins connected from the jumper cables to the breadboard. – mfusco Mar 18 '24 at 16:36
  • I guess then you are using Arduino IDE 2.x. There is a known behaviour difference between that and 1.x which can cause confusion leading to your error message. See https://forum.arduino.cc/t/a-programmer-is-required-to-upload/1101631 . If this solves it then write your own answer with a bit more detail. – 6v6gt Mar 19 '24 at 01:44
  • Thank you for that. Using IDE 1.8.19, no longer is there the programmer error but I get a different error now in the updated OP. – mfusco Mar 19 '24 at 19:49
  • If you Google for that error message you find some variants of the circuit added between the usb/uart adaptor and the attiny. Some with a Schottky diode and some with other resistor values. The values may also depend on whether the usb/uart adaptor has resistors in series with TX and RX. If that usb/uart adaptor is 3v3 like the Adafruit version, you could also try powering tha attiny at 3v3 – 6v6gt Mar 20 '24 at 00:25

2 Answers2

1

Please make sure that your USB to serial adapter is working well. If the adapter itself is faulty, it can create problems. Also, check if you have all the necessary drivers installed.

Here is another tutorial regarding how to program the ATTiny1616 Breakout board using the MegaTinycore library. You can find it here :
https://www.pcbway.com/project/shareproject/ATTiny1616_Minimal_Breakout_board_QFN_bad990fc.html

tepalia
  • 64
  • 1
0

In order to use a USB-Serial adapter as a SerialUPDI programmer, it needs to wire it as the diagram shown below

                        Vcc                     Vcc
                        +-+                     +-+
                         |                       |
 +---------------------+ |                       | +--------------------+
 |                     +-+                       +-+                    |
 |                     |      +----------+         |                    |
 |                  TX +------+   1k     +---------+ UPDI               |
 |                     |      +----------+    |    |                    |
 | USB-Serial Adaptor  |                      |    |  Target AVR Board  |
 |                     |                      |    |                    |
 |                  RX +----------------------+    |                    |
 |                     |                           |                    |
 |                     +--+                     +--+                    |
 +---------------------+  |                     |  +--------------------+
                         +-+                   +-+
                         GND                   GND
hcheung
  • 1,361
  • 7
  • 13
  • Thank you for your response, however upon connecting the ATtiny as described in your post I'm still getting the same error. I'm updating my OP with a picture of my connections. – mfusco Mar 18 '24 at 13:33
  • What IDE are you using? Arduino IDE with MegaTinyCore? or something else? – hcheung Mar 18 '24 at 14:22
  • Yes, I'm using the Arduino IDE with MegaTinyCore. I also would like to note that in attempt to getting it to work, I pressed the "Burn bootloader" button, when using an Arduino to try to connect to the ATtiny. Could that have messed something up? – mfusco Mar 18 '24 at 16:37
  • No idea. I never use the boot loader. In fact, I nowadays don't even use MegaTinyCore and Arduino IDE often, I mostly just have VS Code, AVRDude and bare metal. I think you should consider soldering the header to the board, the problem you are facing might just be bad connection. – hcheung Mar 19 '24 at 00:09
  • "burn bootloader...". This can cause a problem if it succeeds in uploading a bootloader because it has the potential to convert the updi pin to a reset pin preventing further updi programming and needing a high voltage programmer to undo it. However, if you chose the board variant something like "attiny 1616 without optiboot " then "burn bootloader..." simply updates fuses. On these Attinys with a low pin count a bootloader is not recommended. The term "burn bootloader" in the IDE causes much confusion because it may not mean burn bootloader. – 6v6gt Mar 20 '24 at 00:59
  • Errata: With the MegaTinyCore, loading the bootloader does not automatically convert the UPDI pin to a reset pin on the attiny 1616. See https://forum.arduino.cc/t/programming-and-implementing-attiny1616-with-breakout-board-error-a-programmer-is-required-to-upload/1232433/14 – 6v6gt Mar 20 '24 at 17:19