Hi engineers,
I want to use the pin P1.09(NRF_GPIO_PIN_MAP(1, 9)) as GPIO, but when I initiate it, it seems fail.
I've looked through the relevant issues here, but got nothing.
Cheers,
Sean
Hi engineers,
I want to use the pin P1.09(NRF_GPIO_PIN_MAP(1, 9)) as GPIO, but when I initiate it, it seems fail.
I've looked through the relevant issues here, but got nothing.
Cheers,
Sean
Hi Sean,
Which kind of failure you experienced? Can you provide more details?
Best regards,
Charlie
Hi Charlie,
I use function "nrf_gpio_cfg_output(NRF_GPIO_PIN_MAP(1, 9))" to configure it as output state.
And then I watch its register but change nothing.
This is P0.11.
This is P1.09.
Cheers,
Sean
Hi Sean,
Are you using a custom board or nRF52833DK? I only have an nRF52840DK on hand, but shouldn't have differences in using GPIO. I will get one nRF52833DK tomorrow, before this I want you to test on a common ground.
Can you test with the following main.c modified from nRF5_SDK_17.0.2_d674dde\examples\peripheral\blinky? You will see LED1 blink and P1.09 toggle every 2 seconds. My nRF52840DK works as expected.
#include <stdbool.h>
#include <stdint.h>
#include "nrf_delay.h"
#include "boards.h"
/**
* @brief Function for application main entry.
*/
int main(void)
{
/* Configure board. */
//bsp_board_init(BSP_INIT_LEDS);
nrf_gpio_cfg_output(NRF_GPIO_PIN_MAP(0,13));
nrf_gpio_cfg_output(NRF_GPIO_PIN_MAP(1,9));
/* Toggle LEDs. */
while (true)
{
for (int i = 0; i < LEDS_NUMBER; i++)
{
//bsp_board_led_invert(i);
nrf_gpio_pin_toggle(NRF_GPIO_PIN_MAP(0,13));
nrf_gpio_pin_toggle(NRF_GPIO_PIN_MAP(1,9));
nrf_delay_ms(2000);
}
}
}
/**
*@}
**/
Hi Sean,
Are you using a custom board or nRF52833DK? I only have an nRF52840DK on hand, but shouldn't have differences in using GPIO. I will get one nRF52833DK tomorrow, before this I want you to test on a common ground.
Can you test with the following main.c modified from nRF5_SDK_17.0.2_d674dde\examples\peripheral\blinky? You will see LED1 blink and P1.09 toggle every 2 seconds. My nRF52840DK works as expected.
#include <stdbool.h>
#include <stdint.h>
#include "nrf_delay.h"
#include "boards.h"
/**
* @brief Function for application main entry.
*/
int main(void)
{
/* Configure board. */
//bsp_board_init(BSP_INIT_LEDS);
nrf_gpio_cfg_output(NRF_GPIO_PIN_MAP(0,13));
nrf_gpio_cfg_output(NRF_GPIO_PIN_MAP(1,9));
/* Toggle LEDs. */
while (true)
{
for (int i = 0; i < LEDS_NUMBER; i++)
{
//bsp_board_led_invert(i);
nrf_gpio_pin_toggle(NRF_GPIO_PIN_MAP(0,13));
nrf_gpio_pin_toggle(NRF_GPIO_PIN_MAP(1,9));
nrf_delay_ms(2000);
}
}
}
/**
*@}
**/
Hi Charlie,
Thanks! It works. But why I cannot configure this pin before, maybe the demo I use has some problem?
Best Regards,
Sean
I guess so, please check the difference.
Thanks, i think the problem is fixed.