I've been experiencing some odd behaviour when using external pullups with PB3 on an ATtiny1634 that makes me wonder if there is a leak to ground or undocumented (or documented) internal pulldown on this pin.
Some time ago I was trying to minimise current in power-down mode, and removing a 470k pullup from PB3 dropped the usage from 9uA to the expected 0.1uA. At the time, I just worked around it.
Recently while experimenting I tracked down some problems with a circuit addition back to this pin. I got the setup down to a single 4.7k pullup resistor on the pin and measured the output voltage. It showed up as roughly 2.5V with a 3.9V supply. This made me wonder if there was some kind of leak to ground via this pin.
I tried a range of resistors from 1k through to 470k as pullups on this pin and measured the voltage. For the resistors from 1k through 10k, the measured voltage was consistent with an approximately 10k resistor to ground internal to the MCU, within an acceptable margin of error. As the pullup resistance increased much above 10k, so did the effective resistance in the MCU.
I'm probably just going to work around it again by swapping pins around somehow, but I'm curious if anyone else is experiencing this, if it is a known fault, or something I'd missed in the documentation.
If you'd like to try for yourself, this is what is needed:
- Hook up a 1634 to about a 3.9V supply, use a decoupling cap, etc.
- Hook up a 4.7k between the 3.9V supply and PB3.
- Flash an image that has PB3 is set to input and with no pullup. I think this is the default.
- Measure voltage at the pin. If it is about 2.5V you are seeing the same thing as me. If it is about 3.9V then you are not.
PB3 has ADC8, OC1A, and PCINT11. Perhaps one of these systems can affect things? I do have timer 1 running, but OC1A on PB3 should be disabled. I'm not using ADC on the pin and I don't think I set ADMUX incorrectly. I don't use PCINT11.
The current setup is on a breadboard using a 1634 attached via a soldered breakout. I can't rule out a soldering mistake, breadboard issue, defective IC, IC damage, or a software problem. I am, however, curious if anyone knows if it is a wider issue, or is happy to try this with a minimal setup and confirm whether they see the same thing.