PWM Output
R2026bGenerate square wave on the specified output pin
Libraries:
STM32 Microcontroller Blockset /
STM32F1xx Based Boards
STM32 Microcontroller Blockset /
STM32F2xx Based Boards
STM32 Microcontroller Blockset /
STM32F3xx Based Boards
STM32 Microcontroller Blockset /
STM32F4xx Based Boards
STM32 Microcontroller Blockset /
STM32F7xx Based Boards
STM32 Microcontroller Blockset /
STM32G0xx Based Boards
STM32 Microcontroller Blockset /
STM32G4xx Based Boards
STM32 Microcontroller Blockset /
STM32H5xx Based Boards
STM32 Microcontroller Blockset /
STM32H7xx Based Boards
STM32 Microcontroller Blockset /
STM32H7RSxx Based Boards
STM32 Microcontroller Blockset /
STM32L4xx Based Boards
STM32 Microcontroller Blockset /
STM32L5xx Based Boards
STM32 Microcontroller Blockset /
STM32U5xx Based Boards
STM32 Microcontroller Blockset /
(Legacy) STM32 MBED Based Boards /
STM32F746G-Discovery
STM32 Microcontroller Blockset /
(Legacy) STM32 MBED Based Boards /
STM32L475VG-Discovery (B-L475E-IOT01A)
STM32 Microcontroller Blockset /
(Legacy) STM32 MBED Based Boards /
STM32F769I-Discovery
STM32 Microcontroller Blockset /
(Legacy) STM32 MBED Based Boards /
Common
STM32 Microcontroller Blockset /
STM32WBxx Based Boards
Description
The PWM Output block generates square waveform on the specified output pin. The block
input controls the duty cycle of the square waveform. You can provide a value between
0–100 as the block input. An input value of 0
produces a 0 percent duty cycle and an input value of 100 produces a 100 percent duty
cycle
Ports
Input
Parameters
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"stm32f1xxblockslib/PWM Output"
"stm32f2xxblockslib/PWM Output"
"stm32f3xxblockslib/PWM Output"
"stm32f4xxblockslib/PWM Output"
"stm32f7xxblockslib/PWM Output"
"stm32g0xxblockslib/PWM Output"
"stm32g4xxblockslib/PWM Output"
"stm32h5xxblockslib/PWM Output"
"stm32h7xxblockslib/PWM Output"
"stm32h7rsxxblockslib/PWM Output"
"stm32l4xxblockslib/PWM Output"
"stm32l5xxblockslib/PWM Output"
"stm32u5xxblockslib/PWM Output"
"stm32f7lib/PWM Output"
"stm32l475vglib/PWM Output"
"stm32f769ilib/PWM Output"
"stm32nucleodiscoboardslib/Common/PWM Output"
"stm32wbxxblockslib/PWM Output"
Example: add_block("stm32f1xxblockslib/PWM Output","myModel/myBlock",MakeNameUnique="on")
Version History
Introduced in R2018a