Author Topic: Totem pole pull up resistor  (Read 1734 times)

0 Members and 1 Guest are viewing this topic.

Offline Jr.MaxwellTopic starter

  • Contributor
  • Posts: 23
  • Country: gb
Totem pole pull up resistor
« on: January 15, 2020, 09:06:06 am »
Hello,

I'm new to microcontrollers and trying to master how to deal with it's pins. I would like to know if there are any applications where I use pull up resistors in totem poles? And why is there even tri state- when will I ever want a pin in HI-Z state? I've googled it intensivaly, finding the use for pul up resistors in open drain outputs though.

Thank you for your time :)
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7454
  • Country: pl
Re: Totem pole pull up resistor
« Reply #1 on: January 15, 2020, 09:30:04 am »
Hi-Z is for pins which can be either input or output or inactive, depending on circumstances. Think, multiple devices sharing one communication bus such that only one is allowed to drive it at a time and some/any/all of the other devices may choose to receive.

Normally you don't need pull resistors on a push/pull output, but if the output can go Hi-Z and you want the line to have a defined state, a resistor makes sense.
 

Offline Jr.MaxwellTopic starter

  • Contributor
  • Posts: 23
  • Country: gb
Re: Totem pole pull up resistor
« Reply #2 on: January 15, 2020, 09:44:47 am »
But why would I need to put the rest of the lines in HI-Z, why not just in LOW state?
 

Offline mvs

  • Frequent Contributor
  • **
  • Posts: 370
  • Country: de
Re: Totem pole pull up resistor
« Reply #3 on: January 15, 2020, 09:46:21 am »
MCU GPIOs are usually configured as Hi-Z inputs during power on and reset. It is done because it is safe for MCU, but it may not be safe for your circuit. You should use external pull up or pull down resistors to define the state in this case.

 

Offline george.b

  • Frequent Contributor
  • **
  • Posts: 383
  • Country: br
Re: Totem pole pull up resistor
« Reply #4 on: January 15, 2020, 10:45:42 am »
But why would I need to put the rest of the lines in HI-Z, why not just in LOW state?

That depends on what you're doing. Imagine your microcontroller is on a bus where other devices are communicating. What happens if a device tries to transmit "1", but the microcontroller is pulling a "0"?
If, instead, the microcontroller is set to tristate (hi-Z), then it won't interfere with whatever is happening on the bus.
Tristate can also be used for charlieplexing: https://en.wikipedia.org/wiki/Charlieplexing
 

Online paulca

  • Super Contributor
  • ***
  • Posts: 4367
  • Country: gb
Re: Totem pole pull up resistor
« Reply #5 on: January 15, 2020, 02:17:59 pm »
A 0 on a pin can often mean it's directly connected to ground. 

If you read it, you get a LOW.  Fine.

If however you have another device sending a 1, or have anything with a non-zero voltage connected to that pin it could sink a very large amount of current through the MCU and burn it out.

I believe Hi-Z means the pin is in a high impedance state, so even if you connect a 30Amp PSU to it will only draw microamps and the MCU survive.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17429
  • Country: us
  • DavidH
Re: Totem pole pull up resistor
« Reply #6 on: January 19, 2020, 07:38:20 pm »
A pull-up resistor is sometimes used with a bipolar (TTL) output to pull the output up beyond what a TTL output will.  For instance this can be done to allow 5 volt TTL which only gets up to about 3.5 volts without help to drive 5 volt CMOS.

Because historically NPN and NMOS devices were prefered, TTL and NMOS outputs were usually active low so a pull-up resistor on an inactive output results in a safe state.  The alternative requires PNP or PMOS transistors which are lower performance.

For tristate I/O pins, a pull-up or pull-down might be used to force the signal into a known state when not being driven.  Some drivers have a "bus hold" function which applies the appropriate pull-up based on the output voltage so the output state will be weakly held.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf