Switchable Pullup/Pulldown for ADC

Thread Starter

mtechautomotive

Joined Feb 11, 2009
16
Hi,

I am looking to create an automotive circuit that allows my MCU which is doing the ADC to (via softweare and other GPIO pins) enable or disable a series of pullups or pull downs:
1- 5V 10K Pullup
2- 10K Pulldown to Gnd
3- No Pulldowns/Pullsups

I have 16 channels to handle, so looking for most cost effective methods!

Thanks in advance,
 

k1ng 1337

Joined Sep 11, 2020
1,036
Hi, what microcontroller are you using and why do you want to use pull resistors with an ADC? Some microcontrollers have internal pull resistors on GPIO pins which can be enabled on demand.

Also, it might be a good idea to draw a diagram or flow chart because you have 16 channels doing mystery stuff. You'll get better responses if you paint the entire picture of your setup.
 

Ian0

Joined Aug 7, 2020
10,277
Most microcontrollers have pull-ups which you can switch on and off.
Some also have pull-downs, but the accuracy of the resistors is not good.
If your micro is not equipped, then just use another GPIO pin with a resistor connector attached to it.
 

BobTPH

Joined Jun 5, 2013
9,296
What do you expect the result to be when you read an ADC input with a pullup or pulldown?
 
Last edited:

Thread Starter

mtechautomotive

Joined Feb 11, 2009
16
Hi the circuit has an opamp beftwnee the sensor signal and the MCU, so cant use intneral PU/PDs. Use pullups for things lioke thermisters to act as top half of potential divider to 5v.
 

Papabravo

Joined Feb 24, 2006
21,322
Hi,

I am looking to create an automotive circuit that allows my MCU which is doing the ADC to (via softweare and other GPIO pins) enable or disable a series of pullups or pull downs:
1- 5V 10K Pullup
2- 10K Pulldown to Gnd
3- No Pulldowns/Pullsups

I have 16 channels to handle, so looking for most cost effective methods!

Thanks in advance,
I cannot imagine why anybody in their right mind would want to do this.
 

Thread Starter

mtechautomotive

Joined Feb 11, 2009
16
I cannot imagine why anybody in their right mind would want to do this.
Its very common on aftermarket ECUs (in fact all of them pretty much).

Sometimes you use a channel for a thermister, in which case you need to pull the channel high vuya say 1k to 5V. Sometimes, you want it to be a simple 0-5v input from a voltage output sensor like oil pressure, in which case no pullup, and sometimes you need it for noisy stuff which needs to be pulled low gently (via 1Mohm) such as lambda sensors. The idea is to give the user flexiubility in what a specific pin on the ECU will be used for.

The current design is RealWorld pin -> Unity gain opamp -> MCU, hence we cannot use MCUs pullups (and thats dangerous anyway for automotive, but we need to source 5V via 1K, Gnd via 1Mohm or just leave as floating ADC input. :)
 

ElectricSpidey

Joined Dec 2, 2017
2,889
What you want is possible using analog switches such as the CD4066 or possibly tri-state buffers, but the bugaboo is going to be the control system for 16 channels. The least parts might be shift registers but that will require a good bit of coding.

Actually, your best bet might just be a second MCU or FPGA.
 

Papabravo

Joined Feb 24, 2006
21,322
Its very common on aftermarket ECUs (in fact all of them pretty much).

Sometimes you use a channel for a thermister, in which case you need to pull the channel high vuya say 1k to 5V. Sometimes, you want it to be a simple 0-5v input from a voltage output sensor like oil pressure, in which case no pullup, and sometimes you need it for noisy stuff which needs to be pulled low gently (via 1Mohm) such as lambda sensors. The idea is to give the user flexiubility in what a specific pin on the ECU will be used for.

The current design is RealWorld pin -> Unity gain opamp -> MCU, hence we cannot use MCUs pullups (and thats dangerous anyway for automotive, but we need to source 5V via 1K, Gnd via 1Mohm or just leave as floating ADC input. :)
You have explained the environment you will be operating in but have given no clue as to why this should be the case.
 

BobTPH

Joined Jun 5, 2013
9,296
But you seem to be looking for a solution you can change on the fly, and the problem you are solving does not require that, they would be set once then never changed. The way to do this is include a spot on the board for each pullup or pulldown, then install the resistors as needed.
 

ElectricSpidey

Joined Dec 2, 2017
2,889
I just noticed that you changed your resistor requirement, so you can forget about the tri-state buffers although they would still work it would be pointless to use them.

That one change doubled your output requirements from 16 to 32.
 

Thread Starter

mtechautomotive

Joined Feb 11, 2009
16
You have explained the environment you will be operating in but have given no clue as to why this should be the case.
Some customers will want to use inputs for different applications than others, yet the HW will be the same, so, its giving flexibiklity. A bit like SW selectable CAN termination resistors for the Bus .

Cant have it as resistors to be fitted. User sopftware selectable is very common, see here:
https://www.google.com/search?q=ecu...rlz=1C1CHBF_enGB812GB812#imgrc=76RTmyYdJJ2_vM
 

ElectricSpidey

Joined Dec 2, 2017
2,889
If you are using the same resistor values for the pullup and the pulldown then you only need one output.

That output can pull low, high or go high-z.

But if you need 2 different resistor values then it seems pointless to use them.

You can still use them but you will need 2 to do the job on each channel, then you might as well just use analog switches...less control lines.

NO wait...you would still only need 2 control lines.
 
Last edited:

Papabravo

Joined Feb 24, 2006
21,322
Some customers will want to use inputs for different applications than others, yet the HW will be the same, so, its giving flexibiklity. A bit like SW selectable CAN termination resistors for the Bus .

Cant have it as resistors to be fitted. User sopftware selectable is very common, see here:
https://www.google.com/search?q=ecu...rlz=1C1CHBF_enGB812GB812#imgrc=76RTmyYdJJ2_vM
You certainly have a way with avoiding the answers to uncomfortable questions. Customers sometimes force awful decisions. It doesn't make them right.
 
Top