Rev. 1.00
104
September 11, 2018
Rev. 1.00
105
September 11, 2018
HT45F4050
A/D NFC Flash MCU
HT45F4050
A/D NFC Flash MCU
Periodic Type TM – PTM
The Periodic Type TM contains five operating modes, which are Compare Match Output, Timer/
Event Counter, Capture Input, Single Pulse Output and PWM Output modes. The Periodic TM can
also be controlled with two external input pins and can drive two external output pins
.
PTM Core
PTM Input Pin
PTM Output Pin
10-bit PTM
PTCK, PTPI
PTP, PTPB
f
SYS
f
SYS
/4
f
H
/64
f
H
/16
f
SUB
PTCK
000
001
010
011
100
101
110
111
PTCK2~PTCK0
10-bit Count-up Counter
10-bit Comparator P
CCRP
b0~b9
b0~b9
10-bit Comparator A
PTON
PTPAU
Comparator A Match
Comparator P Match
Counter Clear
0
1
Output
Control
Polarity
Control
Pin
Control
PTP
PTOC
PTM1, PTM0
PTIO1, PTIO0
PTMAF Interrupt
PTMPF Interrupt
PTPOL
PxSn
CCRA
PTCCLR
Edge
Detector
PTPI
PTIO1, PTIO0
f
SUB
1
0
Pin
Control
IFS0
PTCAPTS
PTPB
PxSn
Pin
Control
PxSn IFS0
Periodic Type TM Block Diagram
Periodic Type TM Operation
The size of Periodic TM is 10-bit wide and its core is a 10-bit count-up counter which is driven by
a user selectable internal or external clock source. There are also two internal comparators with the
names, Comparator A and Comparator P. These comparators will compare the value in the counter
with CCRP and CCRA registers. The CCRP and CCRA comparators are 10-bit wide whose value is
compared with all counter bits.
The only way of changing the value of the 10-bit counter using the application program is to
clear the counter by changing the PTON bit from low to high. The counter will also be cleared
automatically by a counter overflow or a compare match with one of its associated comparators.
When these conditions occur, a PTM interrupt signal will also usually be generated. The Periodic
Type TM can operate in a number of different operational modes, can be driven by different clock
sources including an input pin and can also control two output pins. All operating setup conditions
are selected using relevant internal registers.
Periodic Type TM Register Description
Overall operation of the Periodic TM is controlled using a series of registers. A read only register
pair exists to store the internal counter 10-bit value, while two read/write register pairs exist to store
the internal 10-bit CCRA and CCRP value. The remaining two registers are control registers which
setup the different operating and control modes.
Register
Name
Bit
7
6
5
4
3
2
1
0
PTMC0
PTPAU
PTCK2
PTCK1
PTCK0
PTON
—
—
—
PTMC1
PTM1
PTM0
PTIO1
PTIO0
PTOC
PTPOL PTCAPTS PTCCLR
PTMDL
D7
D6
D5
D4
D3
D2
D1
D0
PTMDH
—
—
—
—
—
—
D9
D8
PTMAL
D7
D6
D5
D4
D3
D2
D1
D0
PTMAH
—
—
—
—
—
—
D9
D8
PTMRPL
PTRP7
PTRP6
PTRP5
PTRP4
PTRP3
PTRP2
PTRP1
PTRP0
PTMRPH
—
—
—
—
—
—
PTRP9
PTRP8
10-bit Periodic TM Registers List