I'm trying to find the Thevenin resistance of an I/O pin for the ATmega644. I see on the datasheet that there is a 20-50 kohm range of internal pull-up resistance. So with that, I can create a circuit modeled thus (ignore all values):
The voltage source is from the GND and I/O pin and the resistor in the diagram is the pull-up resistor. I only care about this pin when it is HIGH so I am assuming that the Veq=Vcc. Thus Req is the pullup resistance when high.
Am I missing something here? I'm looking for the output Thevenin resistance.
Answer
The information you gave specifies the Thevenin equivalent when the pin is configured as an input. Veq will be the same as Vcc and Req will be the pull-up resistance from the datasheet. The input capacitance might also be important, depending how you use the input.
When you configure the pin as an output, the equivalent circuit will change. Req will be much lower. Veq will depend on whether the output value is high or low (and Req probably depends also).
When calculating the Thevenin equivalent circuit, its good to remember that Veq is the open-circuit output voltage; and Req is given by Veq/Iss, where Iss is the short-circuit output current.
Microcontroller data sheets don't always give you everything you need to know to answer your question. Here's the closest thing to relevant lines from your datasheet (p. 316):
This says that with a 5 V supply, if the load is 20 mA or less (the negative sign indicates current going out of the pin) the high level voltage will be at least 4.2 V. You can guess that the open-circuit output voltage will be very close to 5 V (or you can measure it on a demo board to be sure). That implies the Req is no higher than (5.0 - 4.2) / 0.020 = 40 Ohms.
In any case, these estimates are all very rough. They all depend on the assumption that the output driver has linear characteristics. In reality, the behavior is likely to have substantial nonlinearities, so its better to design using the specs that are guaranteed in the datasheet, rather than make guesses about Thevenin equivalent circuits.
For example, if you design your LED load to draw less than 20 mA, you know that you'll get at least 4.2 V out of the output pin. That should be enough to choose your LED current limiting resistor, or tell you that you need an external transistor buffer to drive your LED.
Also, be sure to check Note 3 after the quoted table in the datasheet where it gives some limits for total I/O current in case you are driving multiple LEDs from different pins.
No comments:
Post a Comment