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

How to define PIN in nrf52?

I want to used p1.01 and p1.2 and p0.13,so how to defined it.

I do like 

#define led0 13 to used pin p0.13 its working but how to define pin P1.01 and all

Parents Reply
  • Hi Shadab,

    Not sure how you test this, anyway let's find a common ground.

    In nRF5_SDK_17.0.2, there is a simple example on examples\peripheral\blinky. Make sure the original blink example works, then you can modify it like below to verify if pins at GPIO1 works or not. 

        /* Configure board. */
        //bsp_board_init(BSP_INIT_LEDS);
        nrf_gpio_cfg_output(NRF_GPIO_PIN_MAP(1,10));
    
        /* Toggle LEDs. */
        while (true)
        {
            //for (int i = 0; i < LEDS_NUMBER; i++)
            //{
                //bsp_board_led_invert(i);
                nrf_gpio_pin_toggle(42);
                nrf_delay_us(0.5);
            //}
        }

    Here both NRF_GPIO_PIN_MAP(1,10) and 42 points to oin1.10. You should see the pin toggle with the help of a logic analyzer or oscilloscope.

    Best regards,

    Charlie

Children
Related