Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Avoid floating input pin on microcontroller

Status
Not open for further replies.
Hi, everyone. I designed this partial circuit myself. This is a "slave" AVR. The idea is that the general purpose input/output pins of the slave AVR are connected directly to a DB25 connector. (Don't ask me why I'm using DB25 or why I'm not using ordinary chip-to-chip protocols). The idea is that a master circuit may or may not be plugged in to this DB25 connector. If it is, then it will supply +5 volts through a 220 ohm resistor into "slave present". It will then go through the 220 ohm resistor on the slave AVR's side and into the input pin of the AVR. What I want to make sure is that if the DB25 is not connected to a master - and therefore the slave present line is floating - that it will read as 0.

In order to do this, do I connect a very large value resistor from slave present to ground? If so, what value do I need to ensure that +5 volts going through 2 x 220 ohm resistors will read as "high" and a floating line will read as "low"?

Richard
 
It's EXTREMELY non-critical, pretty much anything in a huge range will do, try 10K upwards - but even considerably lower than that would be fine - personally I'd probably aim for between 10K and 100K. Anything outside that range would probably depend on the exact connections and reasons.
 
Check to see if the port pins in question have an internal "weak pull-up" and/or "weak pull-down" that can be enabled.
 
having your cake and...

Howdy, on a Freescale, the pullup is ~30k, so a 10k to ground can indicate presence. After detection you can use it as a signal line, you turn off the pullup and the 10k can be driven through. Or, you use an output line from either the local or remote uC to provide the low reference, that can be turned off too. Fun Stuff... <<<)))
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top