TIDUE59A May 2018 – September 2020
The brushed DC-motor driver, DRV8837, is used to provide a controlled current source to the motor. In this design, the CC3220S uses a three-pin interface consisting of two general-purpose input output (GPIO) signals and one PWM signal, to control the DRV8837. Figure 2-2 shows a simplified diagram of the interface between the CC3220 and DRV8837, where the Controller represents the CC3220 MCU.
The DRV8837 device behaves according to a PWM input scheme called the IN-IN interface. For this design, the control interface has been configured such that one GPIO from the CC3220 is used to control IN1, and a PWM is used to control IN2 (see Table 2-1). For a full description of the device logic, see the DRV883x Low-Voltage H-Bridge Driver data sheet.
nSLEEP | IN1 | IN2 | FUNCTION (DC MOTOR) |
---|---|---|---|
0 | X | X | Coast |
1 | 0 | 0 | Coast |
1 | 0 | 1 | Reverse |
1 | 1 | 0 | Forward |
1 | 1 | 1 | Brake |
In the software application for the TIDC-01005, P16 and P17 of the CC3220 are connected to IN1 and IN2 of the DRV8837, respectively. P16 is configured as a standard GPIO, and P17 is configured as a PWM output. P18 of the CC3220 is configured as a GPIO and connected to nSLEEP on the DRV8837. When turning the motor forward, P18 (nSLEEP) and P16 (IN1) are both set to a logic high and the duty cycle of the PWM output on P17 (IN2) is fixed to drive the motor at a constant speed. By duty cycling P17 with P16 high, the motor switches between the Forward drive and Brake modes, to turn forward at a controlled speed. When driving the motor in reverse, P18 (nSLEEP) is set to a logic high, and P16 (IN1) is kept as logic low, while the PWM output on P17 is set to a fixed duty cycle. By duty cycling P17 with P16 low, the motor switches between the Reverse and Coast functions, which causes the motor to turn backward at a controlled speed.