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

How to set GPIO pin to 0 volts

Hi, i am working on PWM Library example in which i a m configuared GPIO pin P0.25. then i am getting voltage variations 1.3 to 2.8 volts.

the problem is when i disable the PWM and also by calling PWM_uninit. i am still getting some constant voltage that is 1.5 volts. i want to make this voltage to 0. how can it is possible.

Thankyou.

Parents
  • As noted nrf_gpio_cfg_output(25) will set port0.25 as an output. nrf_gpio_pin_clear(25) will set port0.25 to 0 volts.

    However, this is reliant on the port0.25 line not being driven high by other hardware on your board. Have you made sure that this isn't the case?

    You could check this by setting the pin as an input and leave it free floating e.g. nrf_gpio_cfg_input(25, NRF_GPIO_PIN_NOPULL); , and then measure the voltage.

    If a voltage is read that is somewhere in between ground and supply voltage then try grounding the line momentarily, to discharge any held charge, and then rechecking. A non-zero or near zero voltage will indicate that the line is being supplied form somewhere.

Reply
  • As noted nrf_gpio_cfg_output(25) will set port0.25 as an output. nrf_gpio_pin_clear(25) will set port0.25 to 0 volts.

    However, this is reliant on the port0.25 line not being driven high by other hardware on your board. Have you made sure that this isn't the case?

    You could check this by setting the pin as an input and leave it free floating e.g. nrf_gpio_cfg_input(25, NRF_GPIO_PIN_NOPULL); , and then measure the voltage.

    If a voltage is read that is somewhere in between ground and supply voltage then try grounding the line momentarily, to discharge any held charge, and then rechecking. A non-zero or near zero voltage will indicate that the line is being supplied form somewhere.

Children
No Data
Related