The new range of AVR Dx microcontrollers from Microchip are proving to be very useful and showing a lot of potential for future projects. These are an evolution of the older Atmel AVR micrcontrollers such as the ATmegas and AT90USB etc. These add features such as configurable logic blocks (think mini GALs), load more peripherals and timers, one port that can run at a different IO voltage (avoid line drivers for SD cards) and integrated OP Amps and comparators.
The main problem I had when starting to use them was programming them. They do not use the old SPI based ICSP of the ATmegas or even the one wire programming pin / reset line seen in some of the Atmel ARM chips. No, these use UPDI, the Unified Program and Debug Interface.
I mention the ARM OPD as that combined program and reset pin would have been beneficial here on low pin count devices (they make these down to 14 pin now). They have a separate reset pin which can only be used as an input with a weak pullup. It can't be configured as an actual reset pin, other than by programming a fuse which warns that it will break UPDI programming if you do. It would have been nice if it was a combined reset and programming pin and one more general IO pin.
Unfortunately this is not supported by any of the programmers I currently have (and lets not talk about the Atmel Snap which claims to support lots of things but I can never get any of them to work more than once if at all).
I did look into a few other things at this point. There is an Arduino core for these microcontrollers which looks interesting, and I had some success using an Arduino acting as a jtag2updi programmer with avrdude command line, but at the time that was still experimental.
Determined to at least try these chips out, I thought I would look at the "all in one" solution, the AVR Curiosity Nano.
This has an integrated programmer / debugger, and that did seem to work. I did a bit of prototyping on another project using one of these on a breadboard.
That was proving a viable setup, so I ended up integrating one into the prototype of the Minstrel 4D.
That worked out well, but was obviously not a practical option for subsequent boards.
It says in the manual that the programmer section on the Curiosity Nano can be used to program external devices, this just needs three wires (ground, power sense and UPDI)
There are pads on the back that have to be cut which disconnect the programmer from the onboard device.
Let's give this a go.
I was pleased to be rewarded by a flashing LED on my test chip.
Time to make that (more) permanent.
I covered the board in heatshrink, so I could use it as just a programmer (only two wires are used here, just ground and UPDI).
That worked well during the development of the Minstrel 4D and another couple of products I am working on.
Now as I move towards production, I need a different solution.
Looking around again and nothing jumped out as supporting these chips.
So I made this.
Again, this is relying on the programmer on Curiosity Nano board. I did look at whether I could replicate this circuitry, but there are a lot of parts only available in small packages (if they are available at all in 2022), and the Curiosity Nano boards are actually available and only about £15 each, so it didn't seem worth the effort.
The actual onboard device is redundant, but still decorative at it's jaunty angle.
Only power and the UPDI data line are connected to the ZIF socket, and they can be switched off to allow the device to be safely removed.
That should allow me to program the microcontrollers for the kits.
But also I have fitted a header so that I can still program the Minstrel 4D prototype.
The firmware is pretty much done, but I want to be sure before I go through many tubes of microcontrollers, programming each one, as I don't want to have to go back and do that again.
The Minstrel 4D is available for preorder from The Future Was 8 bit. The parts are all here and the kits are currently being assembled to ship in the next few months.
More info in a previous post:
You can support me via Patreon, and get access to advance previews of posts like this and behind the scenes updates. These are often in more detail than I can fit in here - I skipped over a lot of time I wasted trying to get the Atmel Snap programmer to work. Read all about how bad it must have been to deserve this main image for the Patreon post.
This now also includes access to my new Patreon only Discord server for even more regular updates.