Society of Robots - Robot Forum

Software => Software => Topic started by: corrado33 on April 22, 2010, 07:22:05 PM

Title: Is it possible to do more than one ADC at a time?
Post by: corrado33 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...
Title: Re: Is it possible to do more than one ADC at a time?
Post by: Razor Concepts 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.
Title: Re: Is it possible to do more than one ADC at a time?
Post by: corrado33 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
Title: Re: Is it possible to do more than one ADC at a time?
Post by: Webbot 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.