GPIO input response to analog voltage?

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

I want to use the "even" 3 pins of the 6-pin AVR ISP to power a Mega48 device and also to provide an analog control voltage on pin 4, which connects to MOSI. Unfortunately, for the M48, MOSI (PB3) is not an ADC input, so I would wire an ADC input pin in parallel with PB3.

The question is, what will happen when I drive that pin (and thus PB3) with an analog voltage, esp. one around Vcc/2? I know in general that's a Bad Thing, but how bad, exactly? Any thoughts?

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

Its a bad thing because both the N channel and P channel input transistors will be on at the same time and you will have "shoot-through" current from Vcc to ground.

It cannot be THAT bad because older AVRs did not have the disconnect feature on the ADC inputs. That is, I believe, a power reduction feature rather than a safety feature.

The severity is likely to vary from device to device as it will be a function of the FET gate thresholds and there is some variation in that. I think I would check, just for peace-of-mind. Monitor the power supply current. Note the value when an input is Vcc or ground. Then, note the value when the input is Vcc/2.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

Well, normally people do not bother to disable digital input feature to transform the ADC input pin to analog input only, so if you do that you are still basically driving one digital input in addition to purely analog input. See DIDR register or something called like that for reference.

I'd say that is not so bad. You could measure how much the AVR consumes current based on applied analog voltage. I think this will not break anything.