General I/O electrical characteristics on XMEGA D devices

Go To Last Post
3 posts / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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);


    // * "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


    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. 


Quoting the user ka7ehk on this post 


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've got the idea for that calculation from the user theusch on this post)


I hope I was able to more or less explain my questions...if not feel free to ask for clarification. Thanks a lot!

This topic has a solution.
Last Edited: Fri. Sep 9, 2016 - 02:29 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


1) The activation of the seeing the presence pulldown resistor will be delayed by the input sync circuits, about 2 clock cycles.

(See Figure 14-7 on page 33 of the datasheet)

2) VIH-MIN gives minimum level the input is guaranteed to be interpreted as high. The actual point where this may occur depends on temp, voltage, noise, die fab lot, etc.

3)  Table 32-7 on page 68 of the datasheet indicated the typical Pull/buss keeper resistance is 25K, but keep in mind it is not an actual resistor. Input impedance without pull up/down is in the multi megaohm range as indicated by a typical leakage of < 0.01 uA.


You will not have an exact pull up/down resistance value as they vary due to (same as previous list). If you want to measure resistance R1, do not use internal pull down; use an external resistance of known value.


Edit: emphasis added.

David (aka frog_jr)

Last Edited: Thu. Sep 8, 2016 - 02:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks!!! This helped a lot