Hello Developers,
I am working with the nRF52833 microcontroller using segger embedded studio with the latest SDK. My issue is that I can configure and use all GPIOs except P0.18. I'm unsure why this is happening.
In my case, I am using a basic LED blink code with a green LED, but when I try to toggle it using P0.18, it does not work. However, all other pins function correctly.
Can anyone help me to resolve this issue?
#include <stdio.h>
#include <nrf_gpio.h>
//LED1
#define G_LED1 NRF_GPIO_PIN_MAP(0,18)
#define LDO_TRANS_PIN2 NRF_GPIO_PIN_MAP(1, 1)
void configure_pins(void)
{
nrf_gpio_cfg(G_LED1, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0S1, NRF_GPIO_PIN_NOSENSE);
nrf_gpio_cfg(LDO_TRANS_PIN1, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNEC_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0S1, NRF_GPIO_PIN_NOSENSE);
nrf_gpio_pin_set(LDO_TRANS_PIN1);
}
void delay_ms(uint32_t ms)
{
for (uint32_t i = 0; i < (ms * 850); i++);
}
void delay_s(uint32_t s)
{
delay_ms(s * 2000);
}
int main(void)
{
configure_pins();
while (1)
{
nrf_gpio_pin_toggle(G_LED1);
printf("G_LED1 status: %d\n", nrf_gpio_pin_read(G_LED1));
delay_s(1);
}
}