SN8P2318 Series
C-type LCD, RFC 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 94
Version 1.5
8.4.6 CAPTURE TIMER CONTROL REGISTERS
A5H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
T1CKSM
CPTVC
CPTCKS
CPTStart
CPTG1
CPTG0
Read/Write
R/W
R/W
R/W
R/W
R/W
After Reset
0
0
0
0
0
Bit 7
CPTVC:
Event counter function control bit.
0 = Disable event counter function.
1 = Enable event counter function.
Bit 3
CPTCKS:
Capture timer clock source control bit.
0 = External input pin, P0.2/T1IN.
1 = RFC output terminal.
Bit 2
CPTStart:
Capture timer counter control bit.
0 = Process end.
1 = Start to count and processing.
Bit [1:0]
CPTG[1:0]:
Capture timer function control bit.
00 = Disable capture timer function.
01 = High pulse width measurement.
10 = Low pulse width measurement.
11 = Cycle measurement.
8.4.7 10-bit Event Counter Function
The 10-bit event timer purpose is to measure the period of a continuous input signal. The measure is through T1 timer
by trigger selection. The event counter is controlled by CPTVC bit. When CPTVC = 0, the event counter is disabled.
When CPTVC = 1, the event counter is enabled, but the T1ENB must be enabled. The event counter trigger edge is
rising edge and must be set as CPTG[1:0] = 01 by program. The trigger edge finds, and the 10-bit event counter and
T1 16-bit timer start to count. When T1 event counter overflows, T1 event counter and 16-bit timer stops counting and
the T1IRQ actives. Before execute T1 event counter, the T1 16-bit counter must be cleared for initialization.
Note: The event counter trigger edge is rising edge and must be set as CPTG[1:0] = 01 by program.
Event Counter Operation
Input Signal
10-bit Event Counter
Set “m” by
program
m+1
m+2
0xFE
0xFF
0x00
CPTStart = 1
Event counter is overflow.
T1 stops counting. CPTStart = 0
T1 16-bit Counter
Un-know
Data 0x????
0x0000
Initialization
2
3
n
T1 is counting.
n-1
“n” is the period of (256-n) cycle of input signals.
Read it by program through T1CH, T1CL
registers.
1