SLVAF75 August 2021 DRV10987
When the DRV10987 powers up, it cannot move to I2C mode. When powering up, it operates in PWM or analog mode according to the value stored in EEPROM. When the power is on, the motor parameters are not yet accurately determined, and if low is not applied to the speed pin, unexpected motor operation may occur. If it is necessary to apply low to the speed pin at the beginning of booting from the microcontroller, and the DRV10987 boots first when power is on, a pulldown resistor is needed. In the initial stage of power on, pulldown is applied to the speed pin or input low from the microcontroller to enter sleep. Before entering sleep, there is already a speed command and it is not a non-zero value. For this reason, Step1 is omitted in this implementation. However, there is a caveat here. Even if you proceed with Step2, Step3, and Step4 with SpeedCtrl value of 00, it does not enter sleep. Before proceeding to Step3 and Step4, there must be a non-zero value in SpeedCTrl. To operate I2C speed mode, the register setting is required after power up.
int main(void)
{
/*** STOP WATCHDOG TIMER ***/
WDTCTL = WDTPW | WDTHOLD;
Init_Clock();// Sys_CLK_init();
P1OUT &= ~BIT5;// P1.5 out put, Speed pin voltage low 0V. go into sleep mode
P1DIR |= BIT5;
GPIO_I2C_Init();