Pullup on UPDI line? #699
-
I'm trying to get the serial UPDI to work on an Attiny202 which has a 10k pullup to Vcc. I can't get UPDI initialization to succeed, even though I've combed through all the instructions and followed them closely (my TTL has no internal resistor, I'm sure of it, and can confirm the resistance between Tx and Rx is 4k65). I'm wondering whether this pull up could be interfering, especially if my cable is transmitting at 3v3. Does this change the resistance I need to have between Tx and Rx? Could it stop the thing from working? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It will turn it into a resistor voltage divider, likely preventing a LOW from being low enough to be reliably recognized. Don't use a pullup if using SerialUPDI. SerialUPDI is a lovely little hack, but it just barely works - it is not tolerant of other crap connected to the UPDI pin. Especially not when built with a resistor. I usually use a schottky diode in parallel with the resistor - with just the diode, the falling edges are fine, but the rising edges aren't, and not all serial adapters work reliably at higher speeds There are a bunch of factors conspiring against this working. First, serial adapters don't always drive all the way to 0V. Second the pin on the target is not a real I/O pin with full drive strength. It's one of those weakass garbage output pins that you always get from an AVR when you set the HV tolerant pin to act as I/O. There's presumably a technical reason for it being difficult to make the pin that survives 12v during special programming modes have decent output drivers. The output impedance is like 2k (ie, half a milliamp of current will be 1V away from the power rails,. see datasheet table 31..10, I/O pin characteristics). Think about that for a second. It need the voltage to be less than 35% of Vdd to recognize a low, or > 60-65% for a guaranteed high input. Even against 4.7k resistor to Vcc (from the idle TX line of SerialUPDI is uncomfortably close to not working. I think the only hope of having it work with 10k pullup in place is to replace the 4.7k resistor with a schottky diode (must be schottky) Note: Modern DA/DB/megaAVR have Reset and UPDI on separate pins, and while reset can be fused to be an input it doesn't even have output drivers and UPDI can only be used as UPDI pin. The upcoming DD-series and EA-series will have an option to set UPDI to be a (full strength) I/O pin - but reset can only be reset or input, and if UPDI is set to act as an I/O pin, the HV pulse needs to be applied to reset, not UPDI, which I was rather proud of deducing from the DD preliminary datasheet (I was later able to get confirmation from Microchip) That was about 17 months ago, and still no DDs are available. \o/ Using the JTAG2UPDI firmware on a nano allows much lower series resistance, maybe 470 ohm series resistor (to prevent excessive current if the devices get out of sync and try to drive the line in opposite directions) will be more tolerant of other stuff dangling off the UPDI line. Why is there a pullup there on your boards anyway? You don't need it unless you're fusing the pins to act as reset and doing autoreset, but that means you have to disconnect the autoreset circuit anyway because that 0.1uf capacitor will destroy any hope of UPDI programming via any method. |
Beta Was this translation helpful? Give feedback.
-
On the boards I sell, if I'm disabling UPDI, I program the board first, and then bridge a pair of pads on the back to connect reset circuit. I think your only hope to make it work with SerialUPDI would be to drop the resistor between Rx and Tx and replace with schottky diode per the recommendations. |
Beta Was this translation helpful? Give feedback.
It will turn it into a resistor voltage divider, likely preventing a LOW from being low enough to be reliably recognized. Don't use a pullup if using SerialUPDI. SerialUPDI is a lovely little hack, but it just barely works - it is not tolerant of other crap connected to the UPDI pin. Especially not when built with a resistor. I usually use a schottky diode in parallel with the resistor - with just the diode, the falling edges are fine, but the rising edges aren't, and not all serial adapters work reliably at higher speeds
There are a bunch of factors conspiring against this working. First, serial adapters don't always drive all the way to 0V. Second the pin on the target is not a real I/O…