I have a few thoughts about B-x8 boards which I want to share:
According to the B-x8 controller schematic PWM pins of the motor driver connected to Vcc. I am wondering why do not we have an option to connect these pins to OCn pins of the AVR? PWM in AVR hardware is pretty convenient.
It would be nice to have pin AIN1 connected to the same port of the AVR as AIN2, BIN1 and BIN2 in order to allow to set motors in “one go”.
Soldering jumper which would allow to disconnect C6 might be helpful in connecting a debugger (debugWire).
Thank you for your suggestions. The reason why the PWM pins on the motor driver are connected to VCC is because the AVR’s hardware PWMs are connected directly to the direction inputs on the driver. This allows you to do hardware PWM control of the motor driver with only two pins per channel rather than three. For more information on how to use hardware PWMs for motor control, take a look at our application note on controlling motors with the Baby Orangutan B.
Additionally, the OrangutanMotors library provides some functions for using hardware PWMs on the Baby Orangutan B to control motors.
The consequence of using the hardware PWM outputs of the two eight-bit timers (timers 0 and 2) as the direction inputs for both motor driver channels was that they could not all be on the same port. We feel the benfits of being able to use hardware PWMs for these inputs, however, outweighs the benefits of being able to set all of the direction pins in a single atomic operation (as do the benefits of being able to control two motors with four I/O lines instead of six).
Unfortunately, the Baby Orangutans are pretty much as compact as possible, leaving no space for a jumper connection to C6. This capacitor serves to smooth out any noise on the Vcc line that might unintentionally reset the Baby Orangutan, but it is an optional component that is definitely not required for operation. If you want to use debugWire, I recommend you either desolder the capacitor or cut the trace.
What do you mean by “communication friendly”? If you’re talking about asynchronous serial baud rates, you can get close enough to the standard ones with 20 MHz, and 20 MHz makes the calculations for other timing easier. Also, 20 MHz is almost 10% faster than the speed you suggest, and that speed can be handy.
AVR provides “power of 2” based prescalers which allows, as you mentioned,
get close but not exact USART speeds. For example, 230400 bauds might be
problematic with 20MHz crystal: http://www.wormfood.net/avrbaudcalc.php