This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52832 GPIO Pin 13 not toggle

Hi:

I am developing my project based on ble_app_uart example. The development bench is  SDK13.0, the chip is nRF52832.

One problem I have now is that: I configure Pin12 and Pin13 as output to drive LEDs, and try to toggle it in 100Hz. The result is Pin12 works normally as expected, but Pin13 is always HIGH. 

I use a timer to trigger to toggle pin12 and Pin13, as the code showed below:

void timer_handler(nrf_timer_event_t event_type, void* p_context)
{
if (event_type==NRF_TIMER_EVENT_COMPARE1)
{
// nrf_gpio_cfg_output(BSP_LED_2);
// nrf_gpio_cfg_output(BSP_LED_3);
nrf_gpio_pin_toggle(12);
nrf_gpio_pin_toggle(13);
NRF_GPIO->PIN_CNF[12] |= (GPIO_PIN_CNF_DRIVE_H0H1 << GPIO_PIN_CNF_DRIVE_Pos);
NRF_GPIO->PIN_CNF[13] |= (GPIO_PIN_CNF_DRIVE_H0H1 << GPIO_PIN_CNF_DRIVE_Pos);
}
}

Thanks  a lot

Jacky

Parents Reply Children
No Data
Related