UPDI power? - Page 1
Forum section: electronics / general

author: blazini36
author_rank: Regular Contributor
timestamp: May 26, 2023, 09:52:14 am
content: I know there are other ways to do this but I'm trying to avoid using a lot of components. I'm curios if there's any problems I'm not noticing with powering an Attiny through a BAT54C diode. Main issues I'm trying to avoid here are the programming device trying to power everything else on the PCB's 5v line or the PCBs 5v line backpowering the programmer. There's obviously going to be a voltage drop of upto 1v but that shouldn't be a problem. R4 is a DNP, just there in case there's an issue to slap a 0r resistor in there.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 26, 2023, 10:42:09 am
content: That should be fine. Obviously all the outputs are lower by the same amount, make sure that's not eating into any logic thresholds. Most CMOS inputs are 30/70% VDD, or "LVTTL" style (0.8/2.0V or thereabouts), so that should be fine, but beware any 20/80% ones (yuck!).A PMOS could be used for lower voltage drop, give or take if 5V is disconnected during programming or if a wired-OR controller is needed to switch between them.

author: blazini36
author_rank: Regular Contributor
timestamp: May 26, 2023, 12:12:24 pm
content: Thanks for the info. The only output is the MISO pin on this MCU. The "master" is an FPGA card, the manual doesn't specifically say the input threshold but it does state that "all IO is LVTTL". I actually have a 2nd Attiny on this PCB, UPDI and VCC is done the same way. It's outputs go to the same FPGA card and to a buffer and analog switch IC, a 74HCT1G125 and a 74HCT4066 which both appear to be "LVTTL" as well,

author: Faranight
author_rank: Unknown
timestamp: May 26, 2023, 12:46:09 pm
content: What UPDI programmer are you using? I know some programmers (i.e. my old AVR Dragon) use the Vcc pin on the ISP/UPDI header as Vtg to *sense* the board voltage, not to power the board.EDIT: For AVR ISP/UPDI there are two recommended pinouts by Microchip. For example, in the AVR32DD32 datasheet a standard 6-pin (3x2) connector and a 4-pin (1x4) connector are described.See chapter 4.4 or page 22 here:https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/DataSheets/AVR16-32DD28-32-DataSheet-DS40002441.pdf

author: ajb
author_rank: Super Contributor
timestamp: May 26, 2023, 08:31:07 pm
content: You may still have some power issues with this depending on what's connected to the MCU and how. Many ICs have protection diodes connected between their IO pins and their internal power rails. If you've got MCU pins connected to other ICs on the board, and the MCU drives any of those lines high while powered by the programmer, current can flow from the MCU pin, through those internal protection diodes, and into the 5V rail. What happens next depends on what's connected and how. With a light enough load, the rest of the circuit may power up and run more or less normally this way. With a larger load, you may brownout your power supply, or the MCU may not be able to source enough current, and the circuit may not operate correctly--or worse, may go into a self destructive state, either because it's not operating at the correct voltage, or because current is flowing in ways it isn't intended to.You can provide protection against this in the MCU firmware, by having it check how it's being powered before configuring any IO. You could do that by connecting a spare GPIO to the power pin on your programming connector with a pulldown and read the digital level to see if the programmer is conencted. Or since you seem to have an external reference voltage, you could check if that's present, either by reading the digital level, or by measuring the voltage with ADC--typically you can set the ADC to use the MCU's internal voltage reference and then measure the external reference voltage against that.

author: blazini36
author_rank: Regular Contributor
timestamp: May 27, 2023, 11:36:58 am
content: Quote from: Faranight on May 26, 2023, 12:46:09 pmThe datasheet recommends the 6 pin but it only uses 3 pins, page 20https://ww1.microchip.com/downloads/en/DeviceDoc/ATtiny424-426-427-824-826-827-DataSheet-DS40002311A.pdfIt's a waste of space to use 6 pins unless I wanted to support the official programmer which I don't. There's about 20 open source programmers out there and at some point I'll make the UPDI-HV programmer so I can set the reset to work. I don't recall any of them mentioning a "sense" function. For now I have this one I bought a long time ago...https://www.amazon.com/gp/product/B09X64YRLD/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

author: Faranight
author_rank: Unknown
timestamp: May 28, 2023, 02:14:09 pm
content: Fair enough. You won't be able to use standard cables in this case, but that doesn't seem to be a problem for you anyway, since you're using cheaper programmers. Just be careful not to mix the wiring.I've been using AVR Dragon, and lately Atmel ICE programmer. Both are also on-chip debuggers, and both of them have a voltage sense pin present.