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

Parents
  • 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.

  • 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.

Reply
  • 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.

Children
No Data
Related