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

PWM on nrf52840

i have just blinked the LED and trying to pwm 

i have written a simple led blinking program like this one below


#include <stdbool.h>
#include <stdint.h>
#include "nrf_delay.h"
#include "boards.h"
#include "nrf_gpio.h"

#define led_pin 27
/**
* @brief Function for application main entry.
*/
int main(void)
{
/* Configure board. */
nrf_gpio_cfg_output(led_pin);

while(1)
{
nrf_gpio_pin_toggle(led_pin);
nrf_delay_ms(500);
}

}

#####################################

a simple one, 

now i need to get to do pwm like short and sweet like this one 

---------most importantly i am using segger embedded studio---------------

can anyone tell how to do pwm in this nrf52840

please!!!

Parents Reply Children
  • The driver code (implementation) is provided as-is, and not intended to be used. When it comes to the WPM driver example that is also quite complex but remembers that the PWM peripheral is most sensible for more complex signals since it can "play out" a waveform from RAM via DMA etc. If you just want a simple to use PWM implementation then the PWM library is just as good in most cases (provided you have available TIMER, PPI and GPIOTE channels).

Related