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

Some GPIO pins don't work in nRF52840

I was facing some issues getting PWM peripheral work on my custom nRF52840 board. And then I tried the pwm output on P0.08 instead of P0.06 and the signal came out just fine.

So I tried the following code snippet on a modified ble_app_hrs example on PCA10056 v0.9.0 board.

//Right after advertising_start(erase_bonds);  in ble_app_hrs example

    int i=0;
    for(i=0;i<48;i++){
      nrf_gpio_cfg_output(i);
      nrf_gpio_pin_clear(i); 
    }    

And measured all the GPIO voltages on the PCA10056. Then I replaced the nrf_gpio_pin_clear with nrf_gpio_pin_set() and measured the voltage on all the GPIO pins.

These are my observations:

Following pins are always at 0V, irrespective of pin_set or pin_clear:

P0.00, P0.01, P0.09, P0.10, P0.17, P0.19, P0.20, P0.21, P0.22, P0.23

Following pins are always at 3V, irrespective of pin_set or pin_clear

P0.06, P0.18

Rest of the pins work as expected i.e. 0V for  pin_clear and 3V for pin_set

I realise that P0.09 and P0.10 are NFC pins and P18 is reset. Also a brief look at boards.h shows that pins 17, 20-23 are QSPI pins. 

So is there something I should do to get back control of these GPIOs? Is there some documentation on this? 

Let me know. I am really stuck with this.  

Parents
  • Hi, I tried the same in a modified version of examples/peripheral/blinky and the same problem is happening although P0.06 is working.

    This is my entire code

    #include <stdbool.h>
    #include <stdint.h>
    #include "nrf_delay.h"
    #include "nrf_gpio.h"
    //#include "boards.h"
    
    /**
     * @brief Function for application main entry.
     */
    int main(void)
    {
        /* Configure board. */
        nrf_gpio_cfg_output(6);
        nrf_gpio_cfg_output(1);
    
        /* Toggle LEDs. */
        while (true)
        {
                nrf_gpio_pin_toggle(6);
                nrf_gpio_pin_toggle(1);                        
                nrf_delay_ms(2000);
        }
    }
    

     Here pin 6 is toggling on the PDK board, but not pin 1. 

Reply
  • Hi, I tried the same in a modified version of examples/peripheral/blinky and the same problem is happening although P0.06 is working.

    This is my entire code

    #include <stdbool.h>
    #include <stdint.h>
    #include "nrf_delay.h"
    #include "nrf_gpio.h"
    //#include "boards.h"
    
    /**
     * @brief Function for application main entry.
     */
    int main(void)
    {
        /* Configure board. */
        nrf_gpio_cfg_output(6);
        nrf_gpio_cfg_output(1);
    
        /* Toggle LEDs. */
        while (true)
        {
                nrf_gpio_pin_toggle(6);
                nrf_gpio_pin_toggle(1);                        
                nrf_delay_ms(2000);
        }
    }
    

     Here pin 6 is toggling on the PDK board, but not pin 1. 

Children
No Data
Related