Author Topic: external pullup resistor control circuit  (Read 1911 times)

0 Members and 1 Guest are viewing this topic.

Offline jtronixTopic starter

  • Regular Contributor
  • *
  • Posts: 125
external pullup resistor control circuit
« on: May 23, 2016, 04:04:22 am »
how to enable and disable external pullup resistor to microcontroller pin because i'm using one port pin for two applications.. For one application need external pullup resistor whereas for the other application pullup not required.
 

Offline jnz

  • Frequent Contributor
  • **
  • Posts: 593
Re: external pullup resistor control circuit
« Reply #1 on: May 23, 2016, 04:22:36 am »
... Maybe you should draw a picture of what you are trying to do.

The obvious answer is use a different micro pin as an output that is then tied to your line with a resistor. Output on that pin and your other line now has a pull-up.

But... Since you wrote you want to share a pin on your micro... I'm guessing you don't have a spare output pin for this. That being the case, I don't know, someone really clever might be able to make a pulse-aware mux or something, but don't look into that I'm mostly just daydreaming.
« Last Edit: May 23, 2016, 05:15:58 am by jnz »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: external pullup resistor control circuit
« Reply #2 on: May 23, 2016, 11:02:10 am »
"How to enable and disable external pullup resistor to microcontroller pin because i'm"

The easiest answer would be to out them on different pins.

If. That's not possible, use a transistor plus a resistor as pull up or pull down.
================================
https://dannyelectronics.wordpress.com/
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12852
Re: external pullup resistor control circuit
« Reply #3 on: May 23, 2016, 11:09:55 am »
As Jnz pointed out, assuming the pullup voltage is equal to the MCU Vdd, you can usually get away with a simple resistor to another I/O pin.  Set it as output high to enable the pullup or as an input to disable it.   If you want to use one pin to control multiple pullups, it gets a lot more complex . . .   If you don't have any spare I/O pins and cant add an I/O expander, you are FUBARed unless you want to resort to a switch or jumper.
 

Offline spudboy488

  • Regular Contributor
  • *
  • Posts: 136
Re: external pullup resistor control circuit
« Reply #4 on: May 23, 2016, 11:39:04 am »
If the first function is an input (needs a pull-up) and the second function is a digital output (I/O, PWM, etc.), you can leave it in. You may need to use a higher resistance for the pull-up if there is an issue with the output being able to drive the line low but that shouldn't effect the input function.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: external pullup resistor control circuit
« Reply #5 on: May 24, 2016, 06:48:44 am »
Some MCUs have got an internal pull-up that you can control directly (e.g STM32, MSP432, even AVR IIRC).

If the internal pull-up value is OK for your application, it's up to you to check (or you could provide more info).

If not, and if the I/O characteristic are not exceeded, you might be able to always leave the external pull-up in the circuit with no real adverse effects.

You did not specify if the pull-up is needed when the pin is configured as input or output (==Open Drain).

In the first case, no issue with an internal or external pull-up of reasonable value.

In the second, the usual trick for GPIOs that do not provide a real Open Drain mode is to use the Data Direction as the output register, while keeping the actual Data Register at 0: setting the DDR to output will yield a 0, setting it to input will yield a pulled up 1.

Nandemo wa shiranai wa yo, shitteru koto dake.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf