Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: nick on June 22, 2008, 06:54:01 AM
-
Hi I am planning to build a circuit using ATmega128 (with 16MHz ext osc = 16MIPS?!) to achieve this:
11 pwm outputs - to servos, 50Hz
8 pwm inputs - from JR DS10RS Receiver (by polling pins continuously, not interrupt)
8 ADC inputs - read rpm, voltage..
1 USB in/out - by AVR-USB
this 128 is dedicated in 'only' the tasks listed above, is it computationally feasible??
I am wondering if the servos will act weird :p
-
What kind of resolution do you expect by polling?
-
10-bit, possible?
-
You want 10-bit resolution by polling? You will have to poll 1024 times in 1ms. It's doable but you won't be able to do much else while doing the polling. Not to mention that if the PWM channels aren't edge aligned you will pretty much have to poll the whole time. I see that as your biggest challenge, the rest of the stuff is just pretty mundane if you use the onboard hardware to your advantage.
Personally I would use Interrupt pins and set up a timer for whatever resolution I wanted, but that's not popular around here so you may want to ask how someone else would do it.
-
Right.... this is one of my concerns.
What about using ONE interrupt on 1 pwm and read 8 pwm channels with 10-bit resolution??