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

Can't get GPIOTE to manually toggle GPIO pins.

I have a board with an NRF52832 and an LED driver. I wrote a function that bit bangs a serial stream to an LED driver. It works when I use the nrf_gpio.h library.

However, I wanted to implement a button that changes the led colors on a press. I changed my commands from the nrf_gpio.h library to the nrf_drv_gpiote.h library, for the interrupt support. I could only get the system to work while I was debugging, so I stripped the program down to make sure everything was still working, but it's not. 

Right now, all I have in my main is toggling a few GPIOs, and it only works on some of them, but not all of them. These GPIOs previously functioned correctly when I was using nrf_gpio.h.

int main(void)
{					
		ret_code_t err_code = nrf_drv_gpiote_init();
		
		static nrf_drv_gpiote_out_config_t config1 = GPIOTE_CONFIG_OUT_SIMPLE(false);
		nrf_drv_gpiote_out_init(3, &config1);
		static nrf_drv_gpiote_out_config_t config2 = GPIOTE_CONFIG_OUT_SIMPLE(false);
		nrf_drv_gpiote_out_init(8, &config2);
		static nrf_drv_gpiote_out_config_t config3 = GPIOTE_CONFIG_OUT_SIMPLE(false);
		nrf_drv_gpiote_out_init(11, &config3);
		static nrf_drv_gpiote_out_config_t config4 = GPIOTE_CONFIG_OUT_SIMPLE(false);
		nrf_drv_gpiote_out_init(9, &config4);
		
		while(1)
		{
			nrf_delay_ms(300);
			nrf_drv_gpiote_out_toggle(3);
			nrf_drv_gpiote_out_toggle(8);
			nrf_drv_gpiote_out_toggle(11);
			nrf_drv_gpiote_out_toggle(9);
		}
		
	return 0;
}

In this example, only pins P0.03 and P0.08 actually toggle. Pins P0.11 and P0.09 don't respond at all. Any ideas?

Related