Using an ATmega (the 48/88/168/328 family, if relevant) with a very weak supply, the internal pull-up resistors have proven to draw too much current.
The microcontroller is driven at very low clock speeds, with a supply between 2 and 3 V, with everything non-essential turned off, so that it uses less than 100 µA. This is all fine, but the device needs a few buttons. If I just connect the buttons to the ground, and use the integrated pull-up resistors, a single button, when pressed, can draw more current than the rest of the microcontroller. This would lead to the collapse of the power supply. Therefore I intend to set the pins to "tri-state", and use a much higher external pull-up than the integrated 20-50 k.
However, I have trouble specifying the value of the external pull-up. Obviously, I would like to have it as large as possible, while still being able to reliably detect a high logic level.
My problem is, that I couldn't find in documentation how high the high-Z really is. Searching through several forums the only indication was that it's measured in megaohms. But how high is it really? And what is the lowest value it can take? How can I find it out, besides trying to contact the manufacturer directly?
I wouldn't trust in an empirical method, as the internal pull-ups are specified in the datasheet as 20-50 k, a very generous range, so I guess the impedance in tri-state could also vary significantly.
I tried it with 330 k, and it worked, with a tolerable current draw in the 10 µA range. One method would be to increase the resistor until it no longer works, and then take a value significantly lower than that. However, as I don't know how much the impedance of the pin in tri-state mode can vary between devices, I doubt this would be the best approach.
Does anyone have more information or experience about it?