I'm going to repeat some stuff covered by various other posts over a long period. Sorry 'bout this but was hard to find a relevant 'starting post' and I guess this more to do with 'thinking aloud' rather than I cry for help.
I'm trying to come up with a good motor driver guide for general low voltage servos or DC motors eg from Tamiya and their dual geabox.
Servo:- Admin has given lots of code examples for the $50 robot onwards. But my preference, I now think, would be to use the PWM solution http://www.societyofrobots.com/robotforum/index.php?topic=1827.msg12082#msg12082
as this all goes on in the background and doesn't rely on timing of your main loop. Adding interrupt driven timers for delays/compares also seems to make sense - ie 'I am a sonar so only resample every 100ms to prevent ghost echoes'. So with an ATMega8 then we can only control 2 motors this way. (NB additional motors/servos can stlll be controlled directly via the OUT port as per admin $50 robot).
DC motor:- So you now require some kind of H-Bridge to control the motor. My two thoughts are:-
1) L293D - cost about $5. A 16pin package that allows Left/Right/Forwards/Stop. Needs 3xpins from the mcu per motor. Probably (?) also needs some of these pins to come via PWM to control the speed info so that its not just full fwd/reverse etc. Given that the ATMega8 has limited pins then this seems like a good answer if you only have 2 motors.
2) something like the Pololu Dual Serial Motor Controller - approx $35. This allows you to daisy chain lots of 'them' together and control approx a max of 60 motors (each with a speed of 0 to 127 in forward or backward mode) via one serial line. Previous posts (including from Admin) have said that the problem is that it uses, for the ATMega8, the one-and-only precious serial port. So no more talking to LCDs/Hyperterminal etc. However, if you are trying to control a biped with umpteen degrees of freedom then the fact you can control 60ish motors over one serial line may be a bonus. It does all the PWM stuff for you.
Have also looked at creating an H Bridge from discrete components - which is fine and you can find links from Wikipedia - but, unless you are going to make many of them, then the cost appears higher than examples above.
Finallly - some of the Orangutan boards seem like good value for money (not a plug). Given they are based on Atmel AVR chips - with an ISP programmer, a two motor HBridge, ATMega 168, various switches/LEDS/Pots for £16 (say $30). May well be a good intro for newbies - as they could make stuff with no (?) soldering.
As mentioned at the start. This is 'brain in progress'. So any thoughts/comments/criticisms and particularly alternatives are welcome.