Documents » Baby Orangutan B User's Guide »9. Motor Driver Truth Table
Motor 1 is controlled by pins PD5 and PD6, and motor 2 is controlled by PD3 and PB3. These pins are connected to the ATmega48/168’s four eight-bit hardware PWM outputs, which allows you to achieve variable motor speeds through hardware timers rather than software. This frees the CPU to perform other tasks while motor speed is automatically maintained. The suggested procedure for using hardware PWM outputs to control the motors is as follows:
Using these PWM settings, OCR0B = 255 is equivalent to holding PD5 low while OCR0A = 0 is equivalent to holding PD6 high. As you can see from the truth table above, in this state M1B will be connected to your battery’s positive terminal and M1A will be connected to ground. Decreasing OCR0B to something less than 255 decreases the percentage of time PD5 is low, causing M1B to alternate between VIN and GND (and hence causing motor 1 to alternate between drive and brake). Similarly, OCR2B = 255 is equivalent to holding PD3 low while OCR2A = 0 is equivalent to holding PB3 high. In this state, M2B will be connected to your battery’s positive terminal and M2A will be connected to ground. |
||||||||||||||||||||||||||||||
|
Home
|
Contact
|
About
|
Forum
|
US toll free: 1-877-7-POLOLU |