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

GPIO pins don't work as expected.

Hi to everyone!

I have a custom board (based on nRF52832) with two LEDS and other GPIO ports. In some point of the code I have to activate one device by setting one port to 1. This is designed like that for power saving. But I realized this device never turns on.

Unless there is other way, I use the function nrf_gpio_cfg_output to configure the port and the functions nrf_gpio_pin_set and nrf_gpio_pin_clear to turn the device on and off, respectively.

After some tests I detected that even the LEDs (and the other GPIO ports) are not working correctly (but in nRF52832DK they worked). If I use nrf_gpio_cfg_output with one LED, then this LED lights up until I use again nrf_gpio_cfg_output with other port (for example with the other LED).

After configuring (I hope) the LEDs as output, when I use nrf_gpio_pin_clear the LEDs lights up and when I use nrf_gpio_pin_set the LEDs turn off. So the result I get is exactly the opposite I expected.

Any Ideas why this is happening?

Could be a problem with crystals or something like that?

Thanks in advance!

Parents
  • Based on your information, I am assuming you bought the board from some company and did not design it yourself.

    The most likely reason the LED activity is backward is that LED's are commonly sinked and not sourced via the IC. The reason for this is that there is a limit to how much current one can have the IC (nRF SoC) source but generally it can sink to ground much more. Thus power for the LED's comes from a separate connection to Vdd and the cathode of LED is connected to gpio.

    So, a clear turns it on and a set turns it off.

    You should probably start first by securing a schematic to the nRF based board. It will probably illustrate the reasons for your other gpio issues.

Reply
  • Based on your information, I am assuming you bought the board from some company and did not design it yourself.

    The most likely reason the LED activity is backward is that LED's are commonly sinked and not sourced via the IC. The reason for this is that there is a limit to how much current one can have the IC (nRF SoC) source but generally it can sink to ground much more. Thus power for the LED's comes from a separate connection to Vdd and the cathode of LED is connected to gpio.

    So, a clear turns it on and a set turns it off.

    You should probably start first by securing a schematic to the nRF based board. It will probably illustrate the reasons for your other gpio issues.

Children
No Data
Related