Engee documentation

STM32 PWM

PWM signal generation on the specified channels of the selected timer.

blockType: CFunction

Path in the library:

/Interfaces/Targets/STM32/STM32 PWM

Description

To work with the block, install/update the support package. equipment.

Block STM32 PWM It is designed to generate a PWM signal on the specified channels of the selected timer.

Ports

Input

# CCRx — CCRx register
scalar

Details

The value of the CCRx register selected in the parameter Канал:, which represents the input power of the PWM.

Data types

uint32_t

Complex numbers support

No

Parameters

Main group

# Таймер: — the timer selected in CubeMX
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14

Details

The timer selected in CubeMX, configured in the PWM generation mode.

Values

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14

Default value

1

Program usage name

m_tim_num

Tunable

No

Evaluatable

Yes

# Канал: — the number of the PWM generation channel
1 | 2 | 3 | 4 | 5 | 6

Details

The number of the channel on which the PWM will be generated.

Values

1 | 2 | 3 | 4 | 5 | 6

Default value

1

Program usage name

m_channel

Tunable

No

Evaluatable

Yes

Configuring CubeMX to work with the PWM module

In the "Pinout & Configuration" tab, in the "Timers" column, select the desired timer for operation. TIM. In the "Mode" tab, select the channels on which you want to generate PWM signals. Switch these channels to the mode PWM Generation CHx.

stm32 pwm 1

Generate the code.