Hi,
In our application we use a motor. In the case that the watchdog would trigger while the motor is running, we need to stop the motor. For this we need to set the PWM signal to 0 in the watchdog event handler. However I noticed that when I run
while (app_pwm_channel_duty_set(&PWM0, 0, 0) == NRF_ERROR_BUSY);to set the PWM signal to 0 percent, it doesn't stop the motor in the watchdog event handler. I think this might be because my PWM period is 20Khz, and I read somewhere it can take more then 2 PWM periods to change the value. This might be too long for the watchdog event handler, because when I set this value manually it immediately stops the motor.
Is there a way to disconnect the PWM immediately from a pin and set the pin to 0 with very low latency?