AfterIi stop pwm and uninit pwm, I can't disable a pin left high by the PWM. I am using sdk16 with softdevice 6.0.0 proximity example.
AfterIi stop pwm and uninit pwm, I can't disable a pin left high by the PWM. I am using sdk16 with softdevice 6.0.0 proximity example.
Hi,
Could you post the code you use to disable the pin?
Hi,
Could you post the code you use to disable the pin?
ret_code_t err_code;
app_pwm_disable(&PWM1);
err_code = app_pwm_uninit(&PWM1);
APP_ERROR_CHECK(err_code);
nrf_gpio_cfg_output(BUZZER);
nrf_gpio_pin_clear(BUZZER);
ret_code_t app_pwm_uninit(app_pwm_t const * const p_instance)
{
app_pwm_cb_t * p_cb = p_instance->p_cb;
if (p_cb->state == NRFX_DRV_STATE_POWERED_ON)
{
app_pwm_disable(p_instance);
}
else if (p_cb->state == NRFX_DRV_STATE_UNINITIALIZED)
{
return NRF_ERROR_INVALID_STATE;
}
pwm_dealloc(p_instance);
p_cb->state = NRFX_DRV_STATE_UNINITIALIZED;
return NRF_SUCCESS;
}
void pwm_stop(void) {
ret_code_t err_code;
app_pwm_disable(&PWM1);
err_code = app_pwm_uninit(&PWM1);
APP_ERROR_CHECK(err_code);
nrf_gpio_cfg_output(BUZZER);
nrf_gpio_pin_clear(BUZZER);
}
Hi,
1) So you are trying to set the pin low?
2) Do you get any error-codes returned somewhere?
3) What pin number is "BUZZER" ?
4) Maybe it's the buzzer that is pulling the pin high ?
The buzzer pin number is 20 . Not gtting any error code
Are you using a nRF52832-DK?
Note that pin 20 is connected to LED4.
Do you see the same issue with e.g. pin 4 ?