This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PCA10005 GPIO: unable to drive a high voltage level.

Hi,

I have the following code running on NRF51822:

int main(void)
{
    // Configure GPIO 08 (P1.0) as output.

  nrf_gpio_cfg_output(8);
   // Set HI on GPIO 08(P1.0)
   nrf_gpio_pin_set(8);

...
}

However, when I check the voltage at pin 29 of connector P1 on the PCA10005 board (which I believe corresponds to GPIO 08) using a multimeter, I find that it reads 0V. What should I be expecting & is there any additional configuration required in order to drive a HI (3.3V) on GPIO pins.

Regards, NK

  • Hi,

    If you look at the GPIO section of the nRF51822 reference manual, it would appear that GPIO pins are set to low by default. You need to do a nrf_gpio_pin_set(8); in order to get the high value on the pin.

  • Hi John,

    Apologies if it was not clear - I think some of the formatting in my original post got removed, but I do have that statement in my code above. I would appreciate any pointers on how I could debug the fact that inspite of having the "nrf_gpio_pin_set" statement in my code, I am still not seeing a HIGH voltage level on the GPIO pin.

    Thanks, NK

  • I took a second and reformatted the code and now I see what you mean. I'm a bit confused as I don't recall the part having a P1, only P0. Keep in mind that the pin number you are passing to these functions isn't the physical pin number on the part. It is the logical pin number in the GPIO block. I'll assume you are using the QFN48 for this next statement: If you want to set physical pin 8 high, that is P0.4 so you would pass a 4 to the cfg_output and pin_set functions.

  • Hi John,

    Thank you for reformatting. "P1" in my post is referring to the "connector P1" on the PCA10005 board (i.e., the NRF51822 development kit board). On this board, the logical pin number 8 in the GPIO block is routed to pin 29 of the connector P1. And that is where I am checking the voltage using a multimeter.

    Actually, I also refer to a "P1.0" which refers to logical pin 8 in the GPIO block - also pin 0 of GPIO port 1. The connector being labeled P1 probably adds to the confusion!

  • At the end, it turned out to be a grounding issue - I was using the DK without the NRFGO motherboard & hence had to hook up the VCC & GND manually. The GND connection was not perfect due to which the LED was not lighting up.

Related