4.8 Timer (TIM)
4.8 Timer (TIM)
Running light on GPIOB
timer
The STM32 offers different kind of individually configurable timers:
General-purpose timer (TIMx): They may be used for a variety of purposes, including mea-
suring the pulse lengths of input signals (input capture) or generating output waveforms
(output compare and PWM).
Basic timer (TIM6 and TIM7): They may be used as generic timers for time-base generation
but they are also specifically used to drive the digital-to-analog converter (DAC). In fact,
the timers are internally connected to the DAC and are able to drive it through their trigger
outputs.
Advanced-control timers (TIM1 and TIM8): It may be used for a variety of purposes, in-
cluding measuring the pulse lengths of input signals (input capture) or generating output
waveforms (output compare, PWM, complementary PWM with dead-time insertion).
The timers consist of a 16-bit auto-reload counter driven by a programmable prescaler. The timers
are completely independent, and do not share any resources. They can be synchronized together
(not TIM6 and TIM7).
In the Vision configuration wizard the timers TIM1 ... TIM4 can be configured directly. The other
timers have to be configured using the FwLib.
4.8.1 Configuration
In the configuration wizard (see Figure 4.9) the timer interrupt has to be enabled and configured.
The function
void TIM1 UP IRQHandler (void)
Lukas Kohler
Figure 4.9: Timer Configuration Wizard
gets called after the TIM1 period has expired.
2
Electrocardio
The Electrocardiogram
• Ecg: electrical ma
from the body surfa
• monitoring of heart
The Ecg signal can b
electrodes placed on the l
below.
Josef Goette
33
Need help?
Do you have a question about the STM32 Cortex-M3 and is the answer not in the manual?