View source for HANcoder/STM32/Blocks/PWM Init
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
Templates used on this page:
Return to HANcoder/STM32/Blocks/PWM Init.
You do not have permission to edit this page, for the following reason:
The action you have requested is limited to users in one of the groups: Administrators, Bureaucrats.
You can view and copy the source of this page.
Templates used on this page:
Return to HANcoder/STM32/Blocks/PWM Init.
Supported Targets: Olimexino, E407, P405
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.
Input: The value of the duty cycle in 100/1023[%].(512=50%, 1023=100%).(uint16)
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. |