does Arduino Mega2560 (based on ATMega 2560) has an input pull-up on analog inputs? Can I set the input pull-up as usual by software?
The reason is that I need to use the analog pins as extra digital inputs.
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.
Sign up to join this communitydoes Arduino Mega2560 (based on ATMega 2560) has an input pull-up on analog inputs? Can I set the input pull-up as usual by software?
The reason is that I need to use the analog pins as extra digital inputs.
A pull up makes no sense on an analog input.
The Atmega 2560 datasheet ADC section(page 268) makes no mention of pull ups on the analog inputs.
The digital section (page 67) shows the switchable pull ups.
If you use the pin as a digital input, you can enable the internal pull-up resistor for that pin.
This is true regardless of whether the same pin also has the ability to be used as an analog input.
The internal pull-up resistors on analog inputs are mentioned in a tutorial:
https://www.arduino.cc/en/Tutorial/AnalogInputPins
The following tutorials use this in their sketches:
http://www.edisondev.net/Arduino/ArduinoAnalogPullup http://tronixstuff.com/2011/01/11/tutorial-using-analog-input-for-multiple-buttons/
Typically "pull-up" is a function used for binary inputs (either high or low). It is not clear why one would even need "pull-up" in an an analog input? If you did need some sort of pull-up, it would be arranged externally since there is no way of offering a pull-up internally that would be appropriate for all analog sources.