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

GPIO Digital Output Not Working

Why isn't this working?

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
static void gpio_init(void)
{
ret_code_t err_code;
//NB as #include "bsp_btn_ble.h" is already initiated within main.c we do not need to initiate GPIO here
if (!nrfx_gpiote_is_init) {
err_code = nrfx_gpiote_init();
APP_ERROR_CHECK(err_code);
}
nrfx_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(true); //GPIOTE_CONFIG_OUT_TASK_TOGGLE(false);
out_config.init_state = NRF_GPIOTE_INITIAL_VALUE_HIGH;
out_config.task_pin = true;
err_code = nrfx_gpiote_out_init(MPU_RESET_PIN, &out_config);
APP_ERROR_CHECK(err_code);
nrfx_gpiote_out_task_enable(MPU_RESET_PIN);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The MPU_RESET_PIN is set to : NRF_GPIO_PIN_MAP(0, 20)

I can not seem to be able to alter the state of the PIN. Whenever I read the PIN its always HIGH.

I have successfully managed to work with in inout on NRF_GPIO_PIN_MAP(0, 19) and I know pin 20 is available and not mapped elsewhere.