I wanted to create a stand alone board that could drive servos and that could be controlled over USB. I used an ATMega328 and the
FT232RL. This final board as you can see is mostly all surface mount components. Below you can see my first prototype board, all through hole and could only control four servos, while this one can do eight.
This final board can be powered by either the USB or the barrel jack connector that powers the servos. I have noticed an issue that if the servos move to fast, it seems to be resetting the FT232RL, which is not such a big deal though since it is not plugged into the USB if it is being powered only by the barrel jack. The servo PWM is all done by my own interrupt driven code instead of using the hardware PWM for several reasons. The board runs at 16MHz and is capable of producing PWM signals from .5ms to 3ms (this is limited in software but can be changed to smaller or larger values). I used an ATMega328 for this, which is probably overkill for controlling servos (and man are they hard to find these days!), ATMega168 could e a drop in replacement, and many lesser micros could do the job as well.
This board also served as an experimental board to learn more about Atmel micros, since before I mostly used PIC (see senior project). Also, I wanted to practice more with surface mount components which is a bit intimidating, but turned out to be not such a big deal. I actually much prefer surface mount now. Again I used Eagle and sparkfun’s library. Also, I did all of the software development in in Linux which is sweet and the main reason I moved from PIC to atmel. You can install a GCC toolchain for the ATMega and us make and other build tools as you would normally. I even got a Makfile to have a “make install” rule to automatically program the chip with avrdude! Awesome!
The source code and Eagle project fies are available below. The code is not fully complete for the eight channel Rev. 2.0 board, only the first six servos work right now. I screwed up on the aove board and connected the last two servos to the wrong pins on the uController, this is fixed in the Eagle project. The menu and commend interface has not been fully updated to support all eight servos, but I will complete this soon and should not be too hard to figure out on your own.
Download Code + Eagle Files Here
Note:
If you want to compile this code, you will need a few things, if you are running Ubuntu/Debian install these packages:
- gcc-avr
- binutils-avr
- avrdude
- avr-libc
- (build-essential … etc standard c dev stuff)



[...] Servo Controller [...]
[...] with AVR microcontrollers. He has worked with PIC microcontrollers in the past and used the goal of developing a servo controller board as his motivation to try the grass on the other side of the fence. He found he likes the AVR line [...]
Nice project! Always interesting to see what people are building
Did you solder it by hand? I tried to solder a similar sized ARM chip recently and found I couldn’t do it. Perhaps I should try again. Perhaps it’s smaller than the avr you used, not sure.
Yes, I soldered it by hand. The way I usually do it is put flux on all of the pads, put the chip in place and hold it down with one finger. Then I get a little drop of solder on th tip of the iron and just touch the tip to each pin and solder will just get sucked down to the pad/pin. Some times if there is too much I drag across multiple pins. Even if you get bridging, its usually not too hard to clean up. I would say definitely try again.
Another really easy way to solder IC’s like that is to put a little solder on the iron tip, dip it in the flux (don’t dip it too deep, just touch the surface of the flux) and then immediately solder a few pins. There will be enough solder on the tip to tack down a couple pins, and you can keep touching the iron tip to the flux every few pins if that helps.
I usually use a little more solder on the iron tip, and hit the flux every few pins, then I clean the tip and go back across the pins to clean them, using only flux on the iron tip. With this method, and a little practice, you should be able to solder a TQFP44 IC in about 30 seconds. If you get a solder bridge, no worries! Dip your clean iron tip in flux, and try to “paint” the solder bridge away from the IC. The tip will suck up a small amount of the bridge solder, and you should clean this off and repeat. You can remove even the worst bridges with this method, all while keeping the IC hardly warm to the touch.
Nice work!
The solder on mine didn’t get pulled easily to the pins. I suspect that the copper wasn’t clean enough and I should use more flux perhaps. I should find a few cheap chips to practice on
Hi Eric,
thanks for sharing your project!
I know this is one of the most often asked questions when dealing with µCs.
What is the value of the capacitors for the crystal oscillator? These thin package quartz resonators often state a load capacitance of 12 pF. If I assume 5 pf for the AVR pins and layout, this leaves 7 pF, or two times 14 pF (15pF is next standard value) in series for the load capacitors.
Are these assumptions correct? Have you determined the safety factor for the oscillation willingness that Atmel describe in their application note?
Ulrich, this is a good question! I also thought about this for a while using roughly similar assumptions. 15pf is probably reasonable. The Atmel spec sheet gives a range from 12-22pf. So ultimately I just started with 22pF and was prepared to try a lower value if it did not work. I had no issue with the 22pF caps and so I left those on there. Sorry to say I don’t have any better advice.
[...] This post was mentioned on Twitter by krsnsk, IEEE UTSA. IEEE UTSA said: http://seiferteric.com/?page_id=37 http://fb.me/FaeUY1M4 [...]