Timer
R2026bLibraries:
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 /
STM32L4xx Based Boards
STM32 Microcontroller Blockset /
STM32L5xx Based Boards
STM32 Microcontroller Blockset /
STM32U5xx Based Boards
STM32 Microcontroller Blockset /
STM32WBxx Based Boards
STM32 Microcontroller Blockset /
STM32H7RSxx Based Boards
Description
Starts timer counter and provides the current counter value as output for the selected timer module. Also enables the interrupts selected in configuration parameters.
Counter is started during model initialization only when Start Timer during
model initialization parameter is selected in the configuration
parameters.
To start/stop the counter in runtime, deselect the Start Timer during model
initialization parameter in the configuration parameters and select
Enable input to enable/disable timer option in the block. An
input of 1 to the corresponding input port will start the counter and
0 will stop the counter.
Examples
Ports
Input
Output
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/Timer"
"stm32f2xxblockslib/Timer"
"stm32f3xxblockslib/Timer"
"stm32f4xxblockslib/Timer"
"stm32f7xxblockslib/Timer"
"stm32g0xxblockslib/Timer"
"stm32g4xxblockslib/Timer"
"stm32h5xxblockslib/Timer"
"stm32h7xxblockslib/Timer"
"stm32l4xxblockslib/Timer"
"stm32l5xxblockslib/Timer"
"stm32u5xxblockslib/Timer"
"stm32wbxxblockslib/Timer"
"stm32h7rsxxblockslib/Timer"
Example: add_block("stm32f1xxblockslib/Timer","myModel/myBlock",MakeNameUnique="on")
Extended Capabilities
Version History
Introduced in R2022b



