Engee documentation

Artery PWM

Generation of a PWM signal at the output of the microcontroller timer.

blockType: CFunction

Path in the library:

/Interfaces/Targets/Artery/Artery PWM

Description

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

Block Artery PWM It is used to generate a PWM signal on a given timer channel. In the first step, the timer starts in PWM mode. The value at the input of the block determines the filling factor (borehole).

Configuring the AT32 Workbench

  1. In AT32 Workbench, select the desired timer (TMR1–TMR14, TMR20).

  2. Select the timer channel and set it to PWM mode A:

    artery pwm timer mode

  3. Configure the PWM parameters in Counter Settings:

    • Divider value (PSC) — divider;

    • Period Value (ARR) — PWM period (determines the resolution of the borehole).

    artery pwm timer params

  4. Generate the project (Generate Code).

Ports

Input

# CCRx — fill factor (duty cycle)
scalar

Details
Data types

UInt32

Complex numbers support

No

Parameters

Main group

# Таймер: — microcontroller timer number
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20

Details
Values

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

Default value

1

Program usage name

m_tim_num

Tunable

No

Evaluatable

Yes

# Канал: — timer channel number
1 | 2 | 3 | 4 | 5

Details
Values

1 | 2 | 3 | 4 | 5

Default value

1

Program usage name

m_channel

Tunable

No

Evaluatable

Yes