Timer Peripherals
Create Simulink® models with the timer peripherals such as Encoder, Higher Resolution Timer, PWM, Timer, Timer Capture and more available with STM32™ Microcontroller Blockset. Configure the Simulink model to interface with supported target hardware using model configuration parameters.
Support for STM32 processor based boards with Simulink uses STM32CubeMX graphical tool. STM32CubeMX tool is a graphical interface that you can use to configure peripherals of STM32 processors and generate peripheral initialization code for the STM32 processors that you select. You can configure the STM32 processor based boards to use the STM32CubeMX project with Simulink to generate code and deploy the code to the hardware.
Blocks
| Encoder | Measure rotation of encoder in counts (Since R2022b) |
| Higher Resolution Timer | Generate high resolution pulse width modulated waveforms (Since R2022b) |
| PWM Output | Generate square waveform on enabled channels using timer module (Since R2021b) |
| Timer | Starts timer counter and provides current counter value (Since R2022b) |
| Timer Capture | Output the capture compare register value (Since R2022b) |
Topics
- Configure STM32CubeMX with Simulink
Configure STM32 processor-based boards using an STM32CubeMX project in Simulink.
- Set Up Scheduling Options for STM32 Processor-Based Boards
Configure single-rate or multi-rate scheduling on an STM32 processor.





