Other Parts Discussed in Thread: DRV8323, MSP430F5132
Hello,
I am trying to modify the reference design code such that the motor will freewheel (DRV8323 Sleep Mode), after the motor stops. Disable works after the initial run, but enable does not work on the second attempt to run. Can you tell me what I a doing wrong?
while(1)
{
cycle_count++;
//Enable low for sleep mode
if (SPEED_REF == 0) {
if (RUNNING == 1) {
PJOUT &= ~BIT5; //Disable DRV8323
_delay_cycles(2500); //100 us delay
RUNNING = 0;
DEBUG("Disabling driver\r\n");
}
}
else
{
if (RUNNING == 0) {
PJOUT |= BIT5;
_delay_cycles(250); //10 us delay
RUNNING = 1;
DEBUG("Enabling driver\r\n");
}
}