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 pin.
Device
BS�7F340
BS�7F3�0
BS�7F3�0
BS�7F370
10-�it Co�pa�ato� P
f
/4
000
SYS
f
001
SYS
f
/16
010
H
f
/64
011
10-�it Count-up Counte�
H
f
100
SUB
f
101
PTON
SUB
PTPAU
110
PTCK
111
10-�it Co�pa�ato� A
PTCK�~PTCK0
Periodic 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
respectively 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 the output pins. All operating setup conditions
are selected using relevant internal registers.
Rev. 1.40
BS67F340/BS67F350/BS67F360/BS67F370
Enhanced Touch A/D Flash MCU with LCD Driver
PTM Core
10-�it PTM
CCRP
Co�pa�ato� P Mat�h
�0~�9
Counte� Clea�
0
1
PTCCLR
�0~�9
Co�pa�ato� A Mat�h
PTIO1� PTIO0
Edge
CCRA
Dete�to�
Periodic Type TM Block Diagram
1��
PTM Input Pin
PTM Output Pin
PTCK� PTPI
PTP� PTPB
PTMPF Inte��upt
PTOC
Output
Pola�ity
Pin
Cont�ol
Cont�ol
Cont�ol
PTM1� PTM0
PTPOL
PxSn
PTIO1� PTIO0
PTMAF Inte��upt
IFS
PTCAPTS
Pin
PTPI
0
Cont�ol
1
De�e��e� 1�� �01�
PTP
PTPB
Need help?
Do you have a question about the BS67F340 and is the answer not in the manual?