Servo driver/reader with atmega 168

i am making a Servo driver/reader with atmega 168, it reads 9 servos and drives 9 servos.

Does this requires it to run on 16mhz crystal or is it good enough with 8mhz? ( having problem with fitting the crystal on my pcb).

Do I need to connect all vcc/gnd pins on the avr?

The servos are powered with 5-6volt from the motor regulator, this source is also going to power the avr. Do I need a 3.3V regulator and which one can I use, the smallest possible, and how big should the cap be for this.

Is it possible to drive the servos and meassure servo current with the same pin? (using adc pin and swap between input and output in software ?)

Can i use any pin to generate the total pulsetrain for the servos(to connect it to other devices etc) or the pwm pins?

Thanks for any tip on question

I am trying to make one like this, but which is a 1/3 the size and have serial output and can drive the servos and not just read them… <LINK_TEXT text="http://ppzuav.com/osc/catalog/product_i … ts_id=91

">http://ppzuav.com/osc/catalog/product_info.php?products_id=91

</LINK_TEXT>

I am using a double sided board and have the avr on side and the headers are smd instead of trough hole

Does this requires it to run on 16mhz crystal or is it good enough with 8mhz? ( having problem with fitting the crystal on my pcb).

That depends on your code - if you are using the serial port, I would use a crystal or ceramic resonator - depending on package, the resonator may be smaller, and can include the caps. Also, you may need the higher frequency to allow more instructions per timer tick.

Do I need to connect all vcc/gnd pins on the avr?

Yes, including AVCC and AREF. You may also need the LC filter on AVCC if you need a quiet ADC.

The servos are powered with 5-6volt from the motor regulator, this source is also going to power the avr. Do I need a 3.3V regulator and which one can I use, the smallest possible, and how big should the cap be for this.

If you need to run faster than 10 MHz, you will need to run the '168 on 4.5V or above. You will probably want a regulator and some decent size bulk capacitors to keep the servo noise from affecting the processor.

Is it possible to drive the servos and meassure servo current with the same pin? (using adc pin and swap between input and output in software ?)

Most servos don't like it if the pulse train goes away, so this won't work. Also, you would need some addittional hardware (current sense amp, mux) since the servo's power and pwm are different lines.

Can i use any pin to generate the total pulsetrain for the servos(to connect it to other devices etc) or the pwm pins?

The '168 doesn't have 9 channels of PWM, so you would need to do software pwm (using a timer). Therefore, you can use any pins.

/mike

Thanks for the help,

Which resonator and voltage regulater in the sparkfun library do you recomand?

Kim