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

I'm new to embedded system terminology.May i know what exactly do you mean by instance in the PWM explanation of nRF52 api?

Module for generating a pulse-width modulated output signal.

This module provides a PWM implementation using timers, GPIOTE, and PPI.

Each PWM instance utilizes 1 timer, 2 PPI channels, and 1 PPI channel group plus 2 PPI and 1 GPIOTE channels per PWM channel. The maximum number of PWM channels per instance is 2.

Basically,I couldn't understand the above explanation!

Parents
  • Hi,

    When the documentation say it support multiple instances of the library, this means that you can setup the library multiple times to produce more outputs. Just like you can create multiple variables of the same type, for instance unsigned int, you can create multiple instances of the library. When you are out of resources (Timers, GPIOTE channels and PPI channels for PWM), you cannot create more instances of the library. Similar for variables, when you are out of RAM, you cannot create more variables.

    Note that the nRF52832 have hardware PWM peripheral that can be used for creating up to 12 PWM channels. The PWM library is soft PWM, implemented using other resources (Timers, GPIOTE, PPI), and controlled by software.

    You can read about TIMERS, GPIOTE, and PPI in the documentation.

    Best regards,

    Jørgen

Reply
  • Hi,

    When the documentation say it support multiple instances of the library, this means that you can setup the library multiple times to produce more outputs. Just like you can create multiple variables of the same type, for instance unsigned int, you can create multiple instances of the library. When you are out of resources (Timers, GPIOTE channels and PPI channels for PWM), you cannot create more instances of the library. Similar for variables, when you are out of RAM, you cannot create more variables.

    Note that the nRF52832 have hardware PWM peripheral that can be used for creating up to 12 PWM channels. The PWM library is soft PWM, implemented using other resources (Timers, GPIOTE, PPI), and controlled by software.

    You can read about TIMERS, GPIOTE, and PPI in the documentation.

    Best regards,

    Jørgen

Children
Related