Hello,
I am using NRF52840 development board with SDK 15.2. I am using the template peripheral project since i want to get comfortable with the peripherals on the board. I have been trying to set some of the pins as outputs and then set them low or high with NRF_P0->OUT however i have not been able to change the output voltage on the pins. I am doing the following:
nrf_gpio_cfg(NRF_P0->PIN_CNF[14], NRF_GPIO_PIN_DIR_OUTPUT, GPIO_PIN_CNF_INPUT_Disconnect, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0H1, NRF_GPIO_PIN_NOSENSE);
nrf_gpio_cfg(NRF_P0->PIN_CNF[15], NRF_GPIO_PIN_DIR_OUTPUT, GPIO_PIN_CNF_INPUT_Disconnect, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0H1, NRF_GPIO_PIN_NOSENSE);
nrf_gpio_cfg(NRF_P0->PIN_CNF[16], NRF_GPIO_PIN_DIR_OUTPUT, GPIO_PIN_CNF_INPUT_Disconnect, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0H1, NRF_GPIO_PIN_NOSENSE);
then i either set the output low with this NRF_P0->OUT &= 0x00000000; or high with this NRF_P0->OUT |= 0xffffffff;.
When i connect an oscilloscope to the output pins, it does not matter whether i set them high or low with NRF_P0->OUT |= 0xffffffff; or NRF_P0->OUT &= 0x00000000; the voltage on the pin stays the same.
Can anyone help me with this, i am not sure what i'm doing wrong. I've also tried using nrf_gpio_cfg_output(NRF_P0->PIN_CNF[6]); and nrf_gpio_pin_clear(NRF_P0->PIN_CNF[6]); on the pins without any results. I've looked at some of the examples in the SDK hoever i dont want to use the bsp package since ill be developing on a custom board.