How does an avr micro controller sense input

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

can someone tell me how avr micro controller sense input and when avr gpio pin is configured as input but left as floating then why avr microcontroller mostly sense that pin as high in floating state.

If someone explain me with the help of internal gpio pin diagram then it will be great. 

thank you in advance.

Last Edited: Thu. Oct 17, 2019 - 12:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is that no longer part of the datasheet?

In the older datasheets all you are looking for was addressed, so that is all you would have to do then, read the datasheet on the GPIO section.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meslomp wrote:
read the datasheet on the GPIO section
 

i have read but didn't get the answer what i want to know.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If the pin is floating, then the value it senses is indeterminate. This is because the AVR is implemented in CMOS which has a very high input impedance.

However, the AVR has switchable pullup resistors.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi uc_coder

 

Try to read this from Microchip: https://microchipdeveloper.com/8avr:ioports

 

Notice the two reversed diodes, the pullup resistor and the mosfet controlling the pullup.

 

Diodes have a tiny reverse leak current, and the mosfet also have a tiny leak current.

 

If upper diode + mosfet leaks more than lower diode, then floating input tends to be high. Otherwise low.

 

This may differ from chip to chip and batch to batch. Generally, unconnected pins should not be allowed to float at all. Connect them to VCC or GND. A tiny electrostatic charge can kill a floating pin.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uc_coder wrote:
when avr gpio pin is configured as input but left as floating
As noted above, that is your first mistake right there. When you correct that the question is moot as the condition won't occur anyway.

 

BTW why would you even be reading input bits you know to not be connected to anything anyway? Is this whole thing really about "how do I read just the active bits from an 8 bit PIN value?". If so then AND MASKs are your friend. (this way you don't care whether unconnected bits return 0 or 1 anyway!)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 then why avr microcontroller mostly sense 

What do you mean by mostly sense?  If the pullup is eanbled, it should ALWAYS read high when the input is floating.

If floating with the pullup off, that is not a valid connection.  

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i not getting exact meaning of high impedance. can u plz explain. thank you in advance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uc_coder wrote:
i not getting exact meaning of high impedance. can u plz explain

wiki can: https://en.wikipedia.org/wiki/Hi...

Jim

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i not getting exact meaning of high impedance. can u plz explain. thank you in advance.

Air is high impedance...almost no current can flow....a logic gate input is high impedance, as it draws very little current (nearly zero).  A "high impedance point"  can't drive (effect) anything that is low impedance.   

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uc_coder  --  Please don't post your assistance requests as a project, which are for completed, functioning projects.

 

You should know that having been a member for 8 months.

 

I have flagged it for removal.

Last Edited: Thu. Oct 17, 2019 - 05:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

 

meslomp wrote:
Is that no longer part of the datasheet?

 

It's still there in the full xmega datasheet:

 

Note the beautifully circled circuit block. This is a Schmitt Trigger Input Buffer. Is is responsible for deciding whether your PIN voltage represents a high or low.

The Wikipedia article on the Schmitt Trigger is quite heavy going but it's worth the struggle, I couldn't find a good "newbie" guide that explained it simply and well.

 

Now you know what to search for, you can now do your own research at your leisure. (In other words; I haven't got the time to write an entire article on Schmitt Triggers)

 

 

Last Edited: Thu. Oct 17, 2019 - 09:28 PM