After years of staying away from the Arduino--too many abstractions getting in the way of knowing how things really worked--I was drawn back by the Uno R4 Minima.
UNO ARRRR 4 MINNIMEE, MATE!
Shiver me Timbres!
Feature-wise, the R4 looked a bit like the cool and popular Teensy. It features a 32-bit Renesas RA4M1 ARM Cortex M4 processor, 14-bit ADC's and a built-in 12-bit DAC.
It's a performance improvement from the Uno R3's 8-bit processor and 10-bit ADC's.
I bought two R4 Minimas and updated my Arduino IDE to the current version.
I also purchased a few R4 workalikes from SEEED: the XIAO-RA4M1:
![]() |
| Seeed XIAO RA4M1 is a truly dinky Uno Minima R4--the connector seen here is USB-C, giving you an idea of its small size. |
The R4 can be easily programmed from the Arduino IDE; for me, plug it in and go.
After making sure a blink sketch worked, the next thing I tried was the analogWave.h library.
The library let me whip up audio frequency waveforms fast, fast, FAST, with only a few lines of code:
////////////////////
#include "analogWave.h" // Include the library for analog waveform //generation
analogWave wave(DAC); // Create an instance of the analogWave //class, using the DAC pin
int freq = 10; // in hertz, change accordingly
void setup() {
int pin = 0;
analogWriteResolution(12);
wave.saw(freq);
//limit of freq seems to be about 30hz to 10k for this library
}
void loop() {
// Read an analog value from pin A5 and map it to a frequency range
freq = map(analogRead(A5), 0, 1024, 0, 10000);
wave.freq(freq);
}
When I connected the R4's DAC to my scope I was pretty disappointed--the output looked "stair-step":
![]() |
| |
![]() |
| TriodeGirl's Audio output--looks much better--saw @ about 366hz. |
ATTINY412 and UPDI
| Attiny412--8 Pin SOIC SMD |
PROGRAMMING UPDI
The ATTINY 412 needed a toolchain; Bitluni's YouTube video got me started (here).
Using the "megaTinyCore" library I got a boring blink sketch to work using my Atmel ICE programmer.
Atmel's ICE documentation (here, go to page 40) was a bit crap about ICE > UPDI wiring, but I figured it out:
Next I tried to get an Arduino Nano going as a programmer, that meant getting a CH340 driver working, tricky on my Windows 11 Pro system; I followed the instructions from Sparkfun (here).
After a few reboots combined with unplugging and reconnecting the NANO, the CH340 was visible in Window's device manager; the Nano came to life with its preprogrammed blink.
Next I created an INO file and folder to upload UPDI code into an Arduino Nano clone.
I got the code from GitHub here; here's how I got the data onto the Nano.:
- Create new folder "jtag2updi" for the sketch << new directory must be named exactly this
- Put all the files from the repo: ino, cpp .h, blah blah, into this directory
- Open up the Arduino IDE
- Open the seemingly empty .ino file in the jtag2updi directory using Arduino sketch IDE
- Compile
- Upload to Nano
- Worked!
I DREAMT OF WIRES
Evening 1 the Nano UPDI toolchain worked but it stopped working soon after.
Try as I might to get firmware to upload--any firmware, to any UPDI ATTINY, using different NANO's--nope.
I even went back to the Atmel ICE--double nope.
That anxious night I dreamt of fixing the problem: soldering MCU's to the roof of a fast moving train, using my scope to look at logic levels while in a warm swimming in a pool, and best of all, talking tech with Cornelius from "Planet of the Apes."
No eureka moment!
I ended up finding an excellent ATTINY video from IMSAI guy (here) who laid out the 4 steps in the Arduino IDE that must be done right for any ATTINY UPDI upload to work:
- I had to choose the right board family (for the 412: Board > megaTinyCore > "Attiny412/402/212/202")
- I had to choose the right serial port (for me, the CH340 on the Nano programmer, found on Port 6 of my Windows 11 system)
- I had to choose the right programmer ("JTAG2UPDI")
- I had to choose the right processor (in this case, ATTINY412)
![]() |
| DAC output from ATTINY412--nice! |
An aside: PCBWAY
ATTINY 1624: Amazing ADC value!
![]() |
| To solder the TSSOP 1624's I dabbed some solder paste on 14-pin TSSOP to DIP adapters, dropped on the chips, and put them on a hotplate. After cleaning up the connections with solder wick, they worked! |
![]() |
| Go A's! |
![]() |
| Breadboard wiring for the 1624 ADC proof of concept |


























































