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.

Parents Reply Children
  • Ohh I am so sorry i didn't know that. So for this response

  • Hello,

    It may be true that we often refer to the examples in the SDK, but to answer your original question: Any of the pins can be PWM pins. See the dongle pinout here. Choose any of the pins that you have access to.

     

    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,

     This is a quite vague description of the issue. You tried using pin P1.13. How did you use it? what was the observed behavior? How did you set up the PWM? 

    Remember that we don't know anything about your application, nor the behavior of the chip when you run your application. This is why it is often useful to refer to examples, as  did here. In many cases, you would compare your implementation with that example, and look at the differences/similarities, and even maybe find out why the application is not working the way you intended it to do. Slight smile

     

    Akshay Khairkar said:
    Anyway it is working now.

     I interpret this as this ticket can be closed for now. 

    Best regards,

    Edvin

  • 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