Skip to main content

Subsection 11.6.3 The TB6612 as a Lookup

The driver has three logic inputs per channel, and a fourth pin for the whole chip. On the breakout the channel-A inputs are marked AIN1, AIN2 and PWMA; the datasheet’s table calls the same three IN1, IN2 and PWM. STBY must be HIGH for the driver to do anything at all, and on our breakout it is pulled up already.
Table 11.6.2. Channel A: the pins
Breakout pin Datasheet name Nucleo pin
AIN1 IN1 PA5 (D13)
AIN2 IN2 PA6 (D12)
PWMA PWM PA7 (D11), TIM14_CH1
Table 11.6.3. Channel A: the four modes, with STBY HIGH
IN1 IN2 PWM What the motor does
H L PWM Turns one way, at the duty cycle on PWM
L H PWM Turns the other way
H H either Short brake: both motor terminals driven LOW, so the back-EMF drives a current that opposes the rotation
L L H Stop: both outputs go high-impedance, so the motor coasts
Brake and stop are not the same thing. Brake shorts the two terminals together and the motor resists being turned; stop disconnects them and the motor spins down on its own. Use the brake for a wheel that must hold its position, and the coast for a flywheel that should spin down gently. The full table is Figure 11.2.20, on page 4 of the TB6612FNG datasheet.
The supply split. VM, the motor supply, comes from the regulator board at 5 V. VCC, the logic supply, comes from the Nucleo at 3.3 V, which is what makes the driver’s inputs safe to drive straight from a GPIO pin. Both share the board’s one ground.