PWM Capture

<< Click to Display Table of Contents >>

Navigation:  STM32F0 Target > Block References > On-chip Peripherals > TIM >

PWM Capture

Previous pageReturn to chapter overviewNext page

User Interface

How this block appears in a Simulink model?

stm32f0_tim_pwmcapture_block

What can be configured?

stm32f0_tim_pwmcapture_mask

Configuration item

Selectable option/ Value

Description

Timer

(Select time module for available list)

List of timers available depending on MCU part

Capture pin

(Select Pin for capture)

Note: available pin for selection depending on selected timer module.

Capture Pin Type (Pull-Up/Pull-Down)

None | Pull Up | Pull Down

Pin type for select capture pin

Capture Edge

Rising | Falling


Capture data type

double | single

Recommended use "single" for data type, to optimize math calculation code.

Sample time (sec)

(sampletime)

Specify block sample time

Capture Edge

pwm_capture_diagram

Output port

1. READY

Return status of PWM capture operation, value is non-zero when data is ready.

2. +Width (sec)

Positive pulse width value, in unit of seconds.

3. +Duty (%)

Positive duty cycle value, in percentage.

4. Frequency (Hz)

PWM frequency, in unit of Hz.

When to use this block?

Use this block when input signal is PWM, to analyze its frequency and duty cycle. Maximum input frequency should lower than 10kHz, and minimum is 0.33Hz.

Note

1. Selected timer module must not conflicted with other timer function.

2. Selectable pin for capture the input signal (available pins depending of selected Timer module).

3. The block use input capture interrupt approach, it may effect to overall system timing if input frequency too High (Lower than 10kHz is recommended).

Demo