when to use pullups?re

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

I was just wondering if a given pin, configured as input, and used as either a UART Rx line, external INT line, etc... should have pullups enabled or not? Or does it matter? I hadn't thought this should be done until recently noticing that if my serial device was unplugged, or external lines not connected, I would have interrupts triggering erroneously... but enabling pullups seemed to fix this. So then I began to wonder if it was just considered standard practice to always enable them when using a pin as input for these types of reasons? I've read the datasheet many times looking for guidance and couldn't find it anywhere... so any comments would be greatly appreciated!

Thanks,
James

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

jdowns wrote:
I was just wondering if a given pin, [...] should have pullups enabled or not?
You should enable the pullup (or install an external pullup resistor) whenever there might be a condition in which the drive signal might be removed and you want the to go to the high state in that case. Similarly, if you want the input to go to the low state with no signal applied you should add an external pulldown resistor

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

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

Okay, thanks... so the pullup on a UART Rx pin won't interfere at all with the communication though?

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

No, unless you are doing something very unexpected with the hardware. If you just have a MAX232 there or something, it's nothing. Actually, then it would not matter if there is a pull-up or not, as the MAX232 output is always driving the RXD input.

- Jani

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

Jepael wrote:
[...] it would not matter if there is a pull-up or not, as the MAX232 output is always driving the RXD input.
However, you may need a pulldown on the RS-232 input to the MAX232 to keep the input in the idle state if the cable is disconnected.

Some RS-232 transceivers (e.g. the ST232) have internal pullups on their TTL inputs and internal pulldowns on their RS-232 inputs. The pullups on the TTL inputs will prevent spurious transitions on the RS-232 lines that might occur when the AVR is being reset and initializing.

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

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

The real MAX232 from Maxim has at least these RS232 input pull-downs built in. I am not sure about TTL input pull-ups, the 3V version (3232) might not have them, but the 232 has them I recall.

But yes, a good point, this must be taken into account in other situations too, not just RS232. I mean, the external pull-up or pull-down resistors are good to be there to keep the important lines idle or where they should be when the AVR is in reset state like being programmed.

- Jani