AVR ADC Multi Channel Input

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

I am a beginner in programming with AVR MCU and understand that setting ADMUX to values 0,1,2,3,4,5,6,7 will correspondingly enable ADC0,1,2,3,4,5,6, ADC7 AVR MCU ADC.

Hence :

ADMUX = 0b11000000; /* means ADC0 as Input and using Internal VRef*/

But if I want to use both ADC0 and ADC1 for input then what values in ADMUX I should set as 0b11000001 would mean ADC1 as input only. As such do I set in a loop values 0 and 1 in ADMUX and iterate?

Please let me know how can I select both ADC0 and ADC1 (more than one) ports for ADC input and read input value respectively.

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

What processor model ?, (they are not identical in operation.)

Do you want to do one differential conversion (ADC1 - ADC0) ? or two conversions ? (ADC0 then ADC1)

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

I am using CodeVision AVR for coding and Proteus for simulation. I am using ATMEGA 8535 MCU.

In actual I need to read two sensors values in-coming to ATMEGA 8535 ADC, hence I believe that I need two conversions i.e. what values each sensors are sending.

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

You need to read one channel and then the other. Only one channel of ADC in the AVRMega controllers. MUX is exactly what it saws, a mux that only selects the pin the ADC channel is going to be connected to at that point.

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

Thanks for the details. I would implement the same methodology.