The Unified Program and Debug Interface (UPDI) is Microchip’s proprietary interface for programming and on-chip debugging, and has become the standard on AVR MCUs after Microchip’s purchase of Atmel. Being a proprietary interface means that even entry-level programmers like the Atmel-ICE are rather expensive at over $100. That’s when for [Scott W Harden] the question arose of whether the much cheaper MPLAB Snap board (~$34) could be used as well for AVR UDPI purposes.
The stages of grief that [Scott] went through before he had it working involved among others the updating of the MPLAB Snap board firmware, getting yelled at by the Microchip Studio IDE when attempting to use the Snap for AVR MCU programming, and ultimately fixing the board following the relevant Microchip Engineering Technical Note (ETN #36) that specifies the removal of a 4.7 kΩ pull-down resistor (R48) on the Snap board. This allows the UDPI line to be pulled high by the MCU.
As the ETN notes, an external pull-up may also be used to override the pull-down, which would leave the ICSP functionality of of the Snap intact. As [Scott] mentions in his conclusion, it feels as if UDPI AVR support with the Snap is really an afterthought for Microchip. Meanwhile there are also more DIY solutions as [Scott] adds, which are useful for just flashing the MCU. An example is with a USB-TTL serial adapter and pymcuprog.
The problem with DIY solutions like jtag2updi, ftdi2updi, and their kin is the effort required to assemble them, and the uncertainty of long-term support as the UPDI ecosystem keeps evolving with new devices and new features. The MPLAB Snap with resistor mod may be just that middle ground between an Atmel-ICE and reverse-engineered OSS projects.
(Featured image: MPLAB Snap resistor mod illustrated, from Microchip ETN #36)
“Meanwhile there are also more DIY solutions as [Scott] adds, which are useful for just flashing the MCU. ”
Is a “more than” missing?
Who would even use Microchip these days when they are out of stock of nearly everything. A total failure on MC part to have no other resources to make silicon. Where others were able to.
I’d rather use Microchip than support CCP or EU.
Please elaborate (if possible (I might be triggering hate speech, but I’m aim for technical and social arguments))
I thought the reasons to avoid Microchip had more to do with the godawful trainwreck they’ve made of their documentation (“Oh, you wanted a reference manual? Have a usually-broken website with 47 separate PDFs for various peripherals and aspects of the CPU instead, and some of the peripherals in your chip just won’t be covered”), the driver library code that’s riddled with “My Fir5t ardUinO SkEtch” level bugs, and support that ghosts you for a month or two at a time.
Agree to Disagree, Mike
On balance all vendors/manufacturers had serious stock problems. All of them, no exceptions.
But recently you can see gradual improvement in this situation.
My occupation is 95% Supply Chain Management.
Microchip isn’t out of stock, and neither are most other manufacturers. You’re just not a big enough client to afford a supply contract, and there’s no reason for a manufacturer to cater to you, specifically, instead of customers who buy millions of units at a time.
I feel like Microchip is bitter no one wanted to use PICs with proprietary compilers and stupid expensive/complicated programmers. Now they bought Atmel and are trying to get people used to more crappy support for stuff.
Embrace and extinguish approach.
Unfortunately they chose to do so AFTER ARM and RISC-V microcontrollers came into vogue.
Yes, developing DIY/modded programmers for proprietary chips is doable. Heck we’ve done it myself. But there is the risk (as you’ve noted) of ending up kinda stuck when the manufacturer introduces new chips, unless you devote effort to keeping up with their product introductions. And then there is the issue of verifying that the DIY programmer works with each new chip. This can be tricky. Microchip has a whole staff devoted to adding support for new products to their “ICE” debugger/programmers and making sure they keep working. If you can build cheaper programmer hardware for their chips, so can Microchip. Believe me, they have zero incentive to creating a barrier-to-entry by overcharging for their programmers. My recommendation: Work with them. Start by contacting your local rep.
Take your wallet to your local sales representative and the willingness to take your money elsewhere.
Capitalism only works when sellers and buyers do need each other.
> an afterthought for Microchip.
Well, yeah. I can see it now. “With the external programming pins connected to general purpose IO pins of the powerful SAMxxx, we’ll be able to support ANY protocol!” “You did WHAT???!”
I am using Snap for almost 2 years for programming ATtiny202 without any problems. Of course I had to modify the Snap according to ETN #36 MPLAB® SNAP AVR UPDI/PDI/TPI Interface Modification as mentioned in the artcile here. Snap is also great for debuging.
Yesterday I finished the Laser Cat Toy with ATtiny202 using random number generator, 2 PWM for servo control a custom delay function to fit program into 2 kB of ATtiny Flash.
https://www.youtube.com/watch?v=6FISEYpp3zI
https://www.youtube.com/watch?v=PSJurUUFpoA
Regarding “even entry-level programmers like the Atmel-ICE are rather expensive at over $100”:
The PICkit 4 is another middle ground. It is less than $80. It supports UPDI.
It comes in an enclosure, supports more devices than the Snap board, has other capabilities vs the Snap. (see difference at https://www.microchipdeveloper.com/snap:versus-pk4)
Do people use programmers for UPDI?? I always used `serialupdi` on AVRDude (before that: pyupdi, pymcuprog) with an FTDI UART and a resistor. Super simple, highly portable.
i am using an xplained nano eval board as a updi programmer for attiny and found it very easy to remove 3 zero ohm links and worked easily and cheaply
In case you are interested, I found this:
https://github.com/wholder/MegaTinyIDE/blob/master/resources/documentation/programmers.md
that is a good summary, i am using the cheap ATTiny416-Xplained-Nano – there are three zero ohm links to remove and then the updi pin is free to program other attinys – in the ide you need to change a setting to allow the programmer to talk to chips other than attiny416 – i have only tried it with other attiny x1x chips and it works well, not sure about megas, etc
WHy not just use Pickit4 ?