Other Parts Discussed in Thread: MSP430G2131,
Tool/software: Code Composer Studio
Hey everyone!
Hello,
I am working with a motor driver evaluation module (DRV8837EVM) where I have replaced the existing MCU (G2131) with an FR2111. The idea is to get everything functioning the way it was with the G2131 but with the FR2111.
The hardware is set up, I have identified where the PWM is coming from and have adjusted the duty cycle accordingly, and the DC motor runs as intended. The idea is to enable this device to be able to toggle the direction of the motor from clockwise to counter-clockwise and vice versa. Currently, I am able to do this by connecting the PWM signal to test point IN1 to have it turn counter-clockwise and to IN2 to have it turn clockwise.
The goal is to have it connected to a GPIO so that I may be able to toggle this action. Is my code optimal in achieving this? Can my current method of changing the direction of the motor be improved on?
Below is the code currently on the MSP430G2131 regarding this operation:
Below you'll see the code currently on my MSP430FR2111:
Any help is greatly appreciated. Thank you!