DIY UPDI high / low voltage programmer, UART switcher with reset possibility #556
Replies: 5 comments 3 replies
-
Cool, interesting approach to the 12v pulse. My plan (have a board design that will go on my wierd stuff mini panel in next board order. I'm trying to avoid any firmware being needed - and I think i've got the method figured out: RTS and DTR. There's a 4P2T switch on the board to swap between serial monitor and UPDI modes. In UPDI mode: Power is fed to a MAX662 (Actually, likely a fake from china - I;m not about to pay Maxims prices). the RX and TX pins are connected for UPDI, and DTR is routed to a 339. Other circuits of the 339 are used to sense the current voltage coming out of the MAX662, and it both listens to and can drive the UPDI line (that takes the logic level issue that is endemic to SerialUPDI out of the picture and protects it from 12v. It's powered with the +12v, and you can tweak the reference voltage to make sure that we can understand it. To do HV, it will assert RTS, pulling the MAX662 shutdown pin low through a diode, and turning on the 12v, waits until the voltage is determined to be high enough ( comparator pulls another line low in that case, going to a modem control input and an LED. When it sees that, it will then pulse DTR low, which through the comparator (to protect it from the 12v that the gate of the p-channel fet has to be pulled to) will deliver HV. We will release both lines at that point and begin our programming attempt. And it's got a switch to allow you to put the 12v pulse on a pin other than UPDI, because pretty soon we will need to have a way to do that ;-) |
Beta Was this translation helpful? Give feedback.
-
Nice programmer! I see your 12V pulse is quite fast (220μs) and there's some turn-off delay. Looks OK, but its possible that the pulse width and/or turn-off delay could be an issue in some rare situations. Unfortunately, the nature of the required HV pulse is poorly or incorrectly documented, however I've monitored its characteristics using an Atmel Power Debugger. Basically, their 12V pulse has razor sharp (ton/toff) with only 50μs duration. I've duplicated the 50μs pulse with my Updi-Key design (please copy/use any part of it). This works without fail on my bread-board proto-type. Also works independently of whatever development software you're using (even works directly with the MPLAB Snap debugger, converting it to HV UPDI). The analog switch I used in the design is fast, 12V tolerant and works really well. The boost converter for the 12V supply that I used is here (1.4-5.5Vin), this has light current loading effect ... worked while driven by an FTDI serial adapter that has 3.3V output that is internally derived from an output pin! (but of course, I recommend using an adequate 3.3V supply) |
Beta Was this translation helpful? Give feedback.
-
This is the UPDI signal (complete programming cycle) on the Power Debugger when programming an Attiny1604 with UPDI pin (PA0) set to GPIO (output) ... With UPDI set to GPIO, there's a double-break, then power-cycle, then 12V pulse, then Key code is sent prior to the programming phase. |
Beta Was this translation helpful? Give feedback.
-
Are you planning to use this with the Arduino IDE? I've noticed the Arduino IDE conveniently closes the serial port terminal connection during programming, so one port can be very easily shared for the two uses. But what is much less convenient is using terminal program (like |
Beta Was this translation helpful? Give feedback.
-
@Dlloydev Thanks for sharing the measurement, this is very helpful! I try to change the firmware so it also does a power cycle (just as in your design). I do not need to send the keys, because that is done by the PC python scripts. |
Beta Was this translation helpful? Give feedback.
-
Some while ago I came across this library for the handy ATTiny controllers with only one pin needed for programming. These controllers are very useful for compact Arduino compatible designs.
One thing I was missing was a UPDI programmer which switches after the programming -cycle back to the UART, so it can be used for tracing / debugging in the Arduino terminal (just like the ordinary Arduino boards).
So I designed some circuits for it.
so it can also be used when the target has a bootloader
After the flashing, the terminal gets active again, all over the same FTDI-USB-serial -interface.
It is build with common parts.
Here is a link to my Github repository, complete with schematics and Arduino-sketch!
https://github.com/TRudolphi/MegaTinyProgrammer_LowMemoryLib/blob/main/UpdiProgrammerSwitcher.md
I made the programmers on an experiment-board, I have not (yet) a pcb for it.
I hope this programmer is useful for other makers!
Beta Was this translation helpful? Give feedback.
All reactions