General-Purpose Timer (Gptm) - WCH CH32V003 Series Reference Manual

Table of Contents

Advertisement

CH32V003 Reference Manual
Chapter 11 General-purpose Timer (GPTM)
The general-purpose timer module contains a 16-bit auto-reloadable timer, TIM2, for measuring pulse width
or generating pulses of a specific frequency, PWM waves, etc. It can be used in automation control, power
supply, etc.
11.1 Main features
The main features of the universal timer include.
l
16-bit auto-reload counter, supports incremental counting mode, decremental counting mode and
incremental and decremental counting mode
l
16-bit prescaler with dynamically adjustable crossover factor from 1 to 65536
l
Support four independent comparison capture channels
l
Each comparison capture channel supports multiple operating modes, such as: input capture, output
comparison, PWM generation, and single pulse output
l
Support external signal control timer
l
Support DMA in multiple modes
l
Support incremental coding, cascading and synchronization between timers
11.2 Principle and structure
Figure 11-1 Block diagram of the structure of the general-purpose timer
CK_TIM from RCC
11.2.1 Overview
As shown in Figure 11-1, the structure of the general-purpose timer can be roughly divided into three parts,
namely the input clock part, the core counter part and the compare capture channel part.
The clock for the general purpose timer can come from the AHB bus clock (CK_INT), from the external clock
input pin (TIMx_ETR), from other timers with clock output (ITRx), and from the input of the compare capture
channel (TIMx_CHx). These input clock signals become CK_PSC clocks after various set filtering and
dividing operations, etc., and are output to the core counter section. In addition, these complex clock sources
V1.3
Internal clock(CK_INT)
CK_PSC
PSC
(prescaler)
112
Trigger
controller
AutoReload
U
Register
Stop, clear or up
CK_CNT
CNT
(counter)
http://wch.cn
TRGO
To DAC
Reset,
Enable,
Up, Count
U
U

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents