Author Topic: Is it possible to do more than one ADC at a time?  (Read 852 times)

0 Members and 1 Guest are viewing this topic.

Offline corrado33Topic starter

  • Supreme Robot
  • *****
  • Posts: 611
  • Helpful? 11
Is it possible to do more than one ADC at a time?
« on: April 22, 2010, 07:22:05 PM »
I was looking through the datasheet today for the AtMega8 (cause I have no way to mount my AtMega64 yet  :() and I was reading through the analog to digital converter section.  I don't know if I'm missing something or what, but I don't see any way to preform multiple ADC conversions consecutively.  Is this not possible (on the AtMega8 at least)?  What about on other AVRs?  If it's not possible, then how do people use multiple analog sensors?  Do they run one ADC, then switch the input pin, run another one, switch input again... etc?  I mean I could see this working, but... it'd be much better to be constantly monitoring sensors right?

Then again, I may be thinking totally wrong...

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: Is it possible to do more than one ADC at a time?
« Reply #1 on: April 22, 2010, 07:37:50 PM »
Yup, only one at a time. These atmegas are single-core processors, so everything is done one thing at a time.

To measure multiple sensors, the pins can all be set to input, it is just that you point the ADC to read each pin.

Offline corrado33Topic starter

  • Supreme Robot
  • *****
  • Posts: 611
  • Helpful? 11
Re: Is it possible to do more than one ADC at a time?
« Reply #2 on: April 22, 2010, 08:07:40 PM »
Interesting...I guess they process so quick that it doesn't really matter, cause you'll still be reading each sensor multiple times per second.  Or you could use more than one MCU if it was THAT important.   ;D

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: Is it possible to do more than one ADC at a time?
« Reply #3 on: April 23, 2010, 01:46:06 PM »
Other things to note:
1. You can get a quicker answer by using less accuracy
2. Most ATMegas also allow you to do a single conversion over 2 ADCs to give things like the difference between the two. Same as you doing 2 adc reads and then doing a substract.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

 


Get Your Ad Here