Controller: ATxmega32D3 @12Mhz, Vcc=3,3v
IDE: Atmel Studio 6,2
Toolchain: AVR8 GCC\Native\3.4.1061
Hello. I have a few questions regarding the general I/O electrical characteristics on XMEGA D devices. They are all related. Any help would be very appreciated
1. What is the minimum wait time required before reading a I/O PIN set as input after the internal pull-down resistor has been activated?
2. What is the tolerance on the VIH-MIN (min. High level input voltage) under the one specified on the datasheet 0.7 * VCC (@VCC = 2.4 - 3.6V)?
3. While on the topic: what is the value of the internal pull-down resistor and input impedance?
1. Please see code:
// * Goal: Recognize how many LEDs are connected (nothing will be connected or disconnected during run-time) // * If a LED is connected it applies a voltage on the I/O pin // * Connected as: Vcc -> LED -> R1 (180 ohm) -> Pull-Down -> GND PORTB.DIR |= (0<<LED_1); PORTB.PIN7CTRL = PORT_OPC_PULLDOWN_gc; // LED_1 // * "counter" will be incremented although there is NO LED_n connected // // * But if a small delay is used the error disappears and also during a debugging session _delay_us(1); if (PORTB_IN & (1<<LED_1)) counter++; // ... // * After the recognition the LED-Pins are set as outputs and used to blink
2. As you might already be suggesting this was not a very good set-up for doing this recognizion (but this is a design I need to work with...). The I/O pin (the pull-down resistor) gets a voltage of approx. 1,8v when the LED is connected, which is below the suggested min. on the datasheet
0.7 * VCC (@VCC = 2.4 - 3.6V) -> 0.7 * Vcc(3,3v) = 2,31v
Nevertheless the controller senses a HIGH state and does the recognition!!! always ... why?
3. Just by reading the datasheet "Figure 33-372.I/O Pin Pull-up Resistor Current vs. Input Voltage", and knowing the current flowing on my small circuit I can verify more or less what I measured with the multimeter-> a pull-down resistor value of around 23Kohms.
The "issue" is that the pull-up or pull-down "resistors" are not resistors.
They are really FETs that are biased barely ON. So, while they behave more or less like resistors, they do so with a lot of variation. And, they are nonlinear. The apparent value changes with bias voltage BECAUSE IT IS AN FET. As the voltage level gets close to Vcc on a pull-up, the apparent value drops because the FET is saturating. Ditto ground and pull-down.
So if I want to just use the set up: Vcc -> R1 -> Pull-Down -> GND, how can I calculate the current flowing on R1 if I still don't know how the voltage will be divided, because I don't know the Pull-Down value...I think I am missing something here
About the general input impedance, I get this discrepance:
Info from the datasheet: IN Input leakage current I/O pin max. 1 µA -> @Vcc(max)=3,6 -> 3,6Mohms ------> 8Mohm (with Multimeter)
I hope I was able to more or less explain my questions...if not feel free to ask for clarification. Thanks a lot!