PWM Init
Supported Targets: Olimexino, E407, P405
Contents
General information about PWM Init
A 'PWM Init' block configures one of the STM32 timer modules for PWM functionality, allowing a PWM signal to be generated on up to 4 timer channels and their associated output pins. Additionally, a function-call subsystem can be connected to the IRQ output. The subsystem will execute each time a PWM period completes.
The generation of the PWM signal can be enabled and disabled per channel.
The frequency of the PWM signal is configured on a module level. So the same configured frequency is used on all enabled channels.
The timer module 1 on the STM32 (TIM1) has a special feature on the first 3 channels. It can output 2 signals on 2 micro controller pins where the second signal is the inverted of the first signal.
Block
Mask
Block inputs (inports)
Input: The value of the duty cycle in 100/1023[%].(512=50%, 1023=100%).(uint16)
Block parameters
Parameter | Description |
---|---|
Output pin | Select the output pin where the PWM signal should be generated. |
Sample time | Sample time of the block. The Sample time (in seconds) defines the rate at which the block is visited by the real-time scheduler of the target. The value of the Sample time has to be an integer multiple of the base sample time of the model. |