Adc and pin configuration help

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

Hi guys, a fast question:

Do I have to setup adc pins as input?

I don't see anything in the datasheet about this.

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

In any AVR datasheet look at the chapter called "I/O ports" and within that the "Alternative functions of PORTx" sections. Within each it shows the trigger conditions for which way a pin is used.

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

mmm I see there are internal overriding signals.

Am I right thinking that enabling ADC, will turn all ADC pins into analog inputs? And the digital input register is there to disable adc on any analog input I would use for other purpose?

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

If you look at, for example, doc7930 for the mega48/88/168, Figure 22-1 shows how the ADC is connected to the pins. Follow the instructions on setting the registers.