TIM_OnePulse_Init Example Description

Configuration of a timer to generate a positive pulse in Output Compare mode with a length of tPULSE and after a delay of tDELAY. This example is based on the STM32C0xx TIM LL API. The peripheral initialization uses LL initialization function to demonstrate LL Init.

The pulse is generated on OC1.

This example uses 2 timer instances:

TIM1_CH1 delay and pulse length are measured every time a pulse is generated. Both can be observed through the debugger by monitoring the variables uwMeasuredDelay and uwMeasuredPulseLength respectively.

Both TIM1 and TIM2 are configured to generate a single pulse (timer counter stops automatically at the next update event (UEV).

Connecting TIM1 OC1 to TIM2 TI2 allows to trigger TIM2 counter by pressing the User push-button.

Keywords

Timers, Output, signals, One Pulse, PWM, Oscilloscope, External signal, Autoreload, Waveform

Directory contents

Hardware and Software environment

How to use it ?

In order to make the program work, you must do the following :