ADC pin with interal pull-up

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

Hi all,

Is there a way to use an ADC pin with internal pull up enabled? I am using ATmega169PV.

Regards,
Vignesh

Cheers,
Vignesh

If everything seems to be coming onto your way, then you are probably driving on a wrong lane..

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

You can't. Why would you want to?

Leon

Leon Heller G1HSM

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

Sensing a 300mV AC signal, need to bias to midway of ADC, missed putting a resistor on the PCB :(
V

Cheers,
Vignesh

If everything seems to be coming onto your way, then you are probably driving on a wrong lane..

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

You'll have to add the resistor, somehow. If it's only 300 mV, you probably need to amplify it, anyway.

Leon

Leon Heller G1HSM

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

Quote:

You can't.

I cannot agree with that. Although not on a '169, I have two apps that do that very thing, on thermistor channels to change the "bias resistor" value in order to measure in the "overtemp" range compared to the normal range linearized by the bias resistor.

Do the new V or P series disallow this somehow? I wouldn't think so, but I don't think I ever tried to use the feature on those. Now I'd also have to check if the pullup has an effect if DIDRx is set--I'd think not.

So it might be true for some generations, but certainly not for all AVR models.

Where we use the feature, it is for coarse measurements and the pullup value from chip to chip and batch to batch was "close enough". You'd have to calibrate if you needed accuracy. I wouldn't think the effective value would drift over time, temperature, and Vcc level but it might.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

leon_heller wrote:
You can't.

Except in the case of a dedicated ADC pin, which cannot be configured as a GPIO. There is nothing that says you can't use the internal pull-up. The ADC pins are just GPIO's that are set as inputs. In fact you can read the ADC value of the pin, even if it is configured as an output. Now if you set the PUD bit, then indeed you can't use the internal pull-ups.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

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

Hmmm, interesting answers, I've never tried to read an multiplexed ADC pin which is configured as an input pulled up. Interesting exercise.

I agree with the fact that strength of internal pullup varies across chips and production batches. Missed out in layout having a resistor tied to ADC pin and Vcc, and now suffering with PCB :(

Cheers,
Vignesh

If everything seems to be coming onto your way, then you are probably driving on a wrong lane..