PWM Output
Add-On Required: This feature requires the Embedded Coder Support Package for STMicroelectronics STM32 Processors add-on.
Libraries:
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F1xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F2xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F3xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F4xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F7xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32G0xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32G4xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32H7xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32L4xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32L5xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32U5xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F746G-Discovery
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32L475VG-Discovery (B-L475E-IOT01A)
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F769I-Discovery
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32WBxx Based Boards
Description
Use the PWM Output block to generate a square waveform on the enabled channels using the timer module.
The block input controls the duty cycle of the square waveform for each channel.
If you set Duty Cycle unit parameter to
Percentage
, an input value of 0 produces a 0 percent duty
cycle and an input of 100 produces an output with 100 percent duty cycle on the
corresponding channel. If you set the Duty Cycle unit parameter to
Counts
, the block writes input value to the capture
compare register of the corresponding channel.
If you select the Enable frequency input, the block writes the corresponding input to the autoreload register of the timer to set the counter period.
Note
You can run a Simulink® model containing PWM Output block in Connected IO mode on STM32 Processor Based Boards. For more information, see Communicate with Hardware Using Connected IO.
Examples
Ports
Input
Output
Parameters
Extended Capabilities
Version History
Introduced in R2021b