Professional Documents
Culture Documents
5 10377 PDF
5 10377 PDF
5 10377 PDF
Application note
Introduction
This application note is intended to provide practical application examples of the
STM32F10xxx TIMx peripheral use.
This document, its associated firmware, and other such application notes are written to
accompany the STM32F10xxx firmware library. These are available for download from the
STMicroelectronics website: www.st.com.
Contents
2/24
AN2581 - Application note Contents
11 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3/24
STM32F10xxx TIMx output compare mode AN2581 - Application note
1.1 Overview
This section provides a description of how to configure the TIM peripheral in output compare
mode to generate four different signals with four different frequencies.
4/24
AN2581 - Application note STM32F10xxx TIMx output compare mode
5/24
Delay generation in TIMx output compare active mode AN2581 - Application note
2.1 Overview
This section provides a description of how to configure the TIM peripheral to generate four
different signals with four different delays.
6/24
AN2581 - Application note Delay generation in TIMx output compare active mode
7/24
STM32F10xxx TIMx output compare inactive mode AN2581 - Application note
3.1 Overview
This section provides a description of how to configure the TIM peripheral in the output
compare inactive mode with the corresponding Interrupt requests for each channel.
8/24
AN2581 - Application note STM32F10xxx TIMx output compare inactive mode
9/24
STM32F10xxx TIMx pulse width modulation mode AN2581 - Application note
4.1 Overview
This section provides a description of how to configure the TIM peripheral in PWM (pulse
width modulation) mode.
10/24
AN2581 - Application note STM32F10xxx TIMx pulse width modulation mode
11/24
TIMx output compare timing mode: time-base generation AN2581 - Application note
5.1 Overview
This section provides a description of how to configure the TIM peripheral in output compare
timing mode with the corresponding interrupt requests for each channel in order to generate
four different time bases.
12/24
AN2581 - Application note TIMx output compare timing mode: time-base generation
13/24
STM32F10xxx TIMx PWM input mode AN2581 - Application note
6.1 Overview
This section provides a description of how to use the TIM peripheral to measure the
frequency and duty cycle of an external signal.
14/24
AN2581 - Application note Generating an OPM waveform after an edge on TIMx TIx input
7.1 Overview
This section provides a description of how to use the TIM peripheral to generate an OPM
(one pulse mode) waveform after the rising edge of an external signal is received on the
timer input pin (TI).
15/24
Generating an OPM waveform after an edge on TIMx TIx input AN2581 - Application note
16/24
AN2581 - Application note Synchronizing TIMx peripherals in parallel mode
8.1 Overview
This section provides a description of how to synchronize TIMx peripherals in parallel mode.
17/24
Synchronizing TIMx peripherals in parallel mode AN2581 - Application note
Figure 7. TIM2_CH1 (PA0), TIM3_CH1 (PA6) and TIM4_CH1 (PB6) output signals
18/24
AN2581 - Application note Synchronizing TIMx peripherals in cascade mode
9.1 Overview
This section provides a description of how to synchronize TIM peripherals in cascade mode.
19/24
Synchronizing TIMx peripherals in cascade mode AN2581 - Application note
20/24
AN2581 - Application note Synchronizing several timers TIMx to an external trigger
10.1 Overview
This section provides a description of how to synchronize TIMx peripherals in cascade
mode to an external trigger.
21/24
Synchronizing several timers TIMx to an external trigger AN2581 - Application note
22/24
AN2581 - Application note Revision history
11 Revision history
23/24
AN2581 - Application note
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT
RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING
APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,
DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE
GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.
24/24