RTEMS: Working with PWM

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Working with PWM
Board Support Packages » ARM » Atmel/Microchip SAM E70, S70, V70 and V71 » Contributed Code

The PWM driver provides the interface to configure and use the PWM peripheral.

The PWM macrocell controls square output waveforms of 4 channels. Characteristics of output waveforms such as period, duty-cycle, dead-time can be configured.
Some of PWM channels can be linked together as synchronous channel and duty-cycle of synchronous channels can be updated by PDC automatically.

Before enabling the channels, they must have been configured first. The main settings include:

- Configuration of the clock generator.
- Selection of the clock for each channel.
- Configuration of output waveform characteristics, such as period, duty-cycle etc.
- Configuration for synchronous channels if needed.
  - Selection of the synchronous channels.
  - Selection of the moment when the WRDY flag and the corresponding PDC transfer request are set (PTRM and PTRCS in the PWM_SCM register).
  - Configuration of the update mode (UPDM in the PWM_SCM register).
  - Configuration of the update period (UPR in the PWM_SCUP register).

After the channels is enabled, the user must use respective update registers to change the wave characteristics to prevent unexpected output waveform. i.e. PWM_CDTYUPDx register should be used if user want to change duty-cycle when the channel is enabled.

For more accurate information, please look at the PWM section of the Datasheet.

Related files :
pwmc.c
pwmc.h.