Ameba-D User Manual
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
198
Timer clock = CK_CNT
CK_PSC
CEN
E0
E1
E2
E3
Counter register
CCR0
00
TRGI
E4
E5
E6
01
F8
00
Capture/compare
interrupt flag (CC0IF)
02
03
04
05
06
07
Update event (UEV)
clear CC0IF by Software
...
...
...
...
...
...
...
...
...
...
Note
: The register TIMx_CCR0 captures the pulse number F8 when the counter is overflowed (UEV).
Fig 10-4 Statistic pulse number mode diagram (positive edge of TRGI is active for capture, ARR=E6)
10.3
PWM Mode Timer
10.3.1
Introduction
The PWM timer (TIM5) consists of a 16-bit auto-reload counter driven by a 8-bit programmable prescaler. It can be used for a variety of
purposes, including measuring the pulse lengths of input signals (input capture) or generating output waveforms (PWM).
Pulse lengths and waveform periods can be modulated from a few microseconds to several milliseconds using the timer prescaler.
10.3.2
Features
The features of the PWM timer (TIM5) are listed in Table 10-3.
Table 10-3 PWM timer features
Name
KM4: TIM5
KM0: TIM05
Channels
18
6
Clock source
XTAL
XTAL
Resolution
16-bit
16-bit
Prescaler
8-bit
8-bit
Counter mode
Up
Up
One-pulse mode
●
●
PWM mode with polarity selection
●
●
Statistic pulse width
-
-
Statistic pulse number
-
-
Interrupt generation
●
●
Input pin
2 input capture
2 input capture
Output pin
18 PWM out
6 PWM out
Sleep mode
-
●
0%/100%
●
●
Realtek confidential files
The document authorized to
SZ99iot
2019-05-15 10:08:03