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

PWM pins in nrf 52840 dongle for driving servo motors

Hello, I doing the code for driving servo motors using nrf52840 dongle, in datasheet i am not able to findout the PWM pins in so i tried driving with GPIO pin(P1.13) and not getting the accurate results, please provide PWM pin-outs or reference for the same.

Accepting immediate response.

  • Hi, I'm trying to setup the pwm on pin P0.9 but it does not work. I'm following the zephyr pwm blink example with nrf52840 adding this overlay configuration:

    &pinctrl {

        /********************** PWM **********************/

        pwm0_default: pwm0_default {
            group1 {
                psels = <NRF_PSEL(PWM_OUT0, 0, 9)>,
                    <NRF_PSEL(PWM_OUT1, 0, 10)>,
                    <NRF_PSEL(PWM_OUT2, 0, 12)>;
                nordic,invert;
            };
        };

        pwm0_sleep: pwm0_sleep {
            group1 {
                psels = <NRF_PSEL(PWM_OUT0, 0, 9)>,
                    <NRF_PSEL(PWM_OUT1, 0, 10)>,
                    <NRF_PSEL(PWM_OUT2, 0, 12)>;
                low-power-enable;
            };
        };
    };

    So, I'm moving from pin P0.13 to P0.9 and I dont get any singnal in the pin. If I replace P0.9 by P0.30 in the same code I see the expected pwm on pin 30. Any clue about it is not working for the other case?

  • P0.09 and P0.10 on the nRF52840 are set up to be NFC pins by default. To use these GPIOs as normal GPIOs, please add this line to your prj.conf file:

    CONFIG_NFCT_PINS_AS_GPIOS=y

    Best regards,

    Edvin

Related