This library implements a PWM output expander for AVR Atmega micro using CD4017.
With this library we can write a module to move servos using PWM.
A servo expansion module is already implemented as example, with this module you can run up to 36 servos @ 2.25degree precision per step or 9 servos @ 0.18 degrees of precision.
"High accurancy" is 1.0us of precision per step @16Mhz, normal accurancy is 12.5us precision per step @16Mhz.
The default frequency for servos is 50Hz.
If you run this sample at a different frequency you must update the countdown parameter of this library, and also you should test it to prove that the resource are enough to output the pulse to CD4017 at the desired frequency.
I've test it using some servos and scope for the remaining outputs.
This library was developed on Eclipse, built with avr-gcc on Atmega168 @ 16MHz.
Code
Notes
- read risk disclaimer
- excuse my bad english
Sir, is possible to controll each servos individually???
ReplyDeleteHello, yes it is.
DeleteI was not able to find avr_lib_cd4017_01.zip file in link.
ReplyDeleteHello, it's on page 1 (avr_lib_cd4017_01.zip, Apr 30, 2013 56.98KB) Unlucky google code has removed the direct link.
DeleteHello
ReplyDeletewhere you write code for AVR ?
Hello, you can find the code download link, tested on Atmel AVR ATmega8, in the blogpost description above.
Deleteno, I mean what type of program you use for writing code ?
ReplyDeleteI use Eclipse + AVR pluging, winavr as compiler.
Delete