Capture Input Mode
To select this mode bits T1M1 and T1M0 in the TM1C1 register should be set to 01 respectively.
This mode enables external signals to capture and store the present value of the internal counter
and can therefore be used for applications such as pulse width measurements. The external signal is
supplied on the TP1_0 or TP1_1 pin, whose active edge can be a rising edge, a falling edge or both
rising and falling edges; the active edge transition type is selected using the T1IO1 and T1IO0 bits
in the TM1C1 register. The counter is started when the T1ON bit changes from low to high which is
initiated using the application program.
When the required edge transition appears on the TP1_0 or TP1_1 pin the present value in the
counter will be latched into the CCRA registers and a TM interrupt generated. Irrespective of what
events occur on the TP1_0 or TP1_1 pin the counter will continue to free run until the T1ON bit
changes from high to low. When a CCRP compare match occurs the counter will reset back to zero;
in this way the CCRP value can be used to control the maximum counter value. When a CCRP
compare match occurs from Comparator P, a TM interrupt will also be generated. Counting the
number of overflow interrupt signals from the CCRP can be a useful method in measuring long
pulse widths. The T1IO1 and T1IO0 bits can select the active trigger edge on the TP1_0 or TP1_1
pin to be a rising edge, falling edge or both edge types. If the T1IO1 and T1IO0 bits are both set
high, then no capture operation will take place irrespective of what happens on the TP1_0 or TP1_1
pin, however it must be noted that the counter will continue to run.
As the TP1_0 or TP1_1 pin is pin shared with other functions, care must be taken if the TM is in the
Input Capture Mode. This is because if the pin is setup as an output, then any transitions on this pin
may cause an input capture operation to be executed. The T1CCLR and T1DPX bits are not used in
this Mode.
Counte�
Value
CCRP
YY
XX
TnO�
TnPAU
Active
edge
TM Captu�e
Pin TPn_x
CCRA Int.
Flag TnAF
CCRP Int.
Flag TnPF
CCRA
XX
Value
TnIO [1:0]
00 - Rising edge
Value
Note: 1. TnM [1:0]=01 and active edge set by the TnIO [1:0] bits
2. A TM Capture input pin active edge transfers the counter value to CCRA
3. TnCCLR bit not used
4. No output function - TnOC and TnPOL bits are not used
5. CCRP determines the counter value and the counter has a maximum count value when CCRP is equal to
zero.
6. n=1; x=0 or 1.
Rev. 1.40
HT66F20-1/HT66F30-1/HT68F20-1/HT68F30-1
TnM [1:0] = 01
Counte�
ove�flow
edge
Active
Active
edge
YY
XX
01 - Falling edge
10 - Both edges
Capture Input Mode
10�
Flash MCU with EEPROM
Counte�
Stop
Reset
Pause
Resu�e
YY
11 - Disa�le Captu�e
�ove��e� ��� �01�
Ti�e
Need help?
Do you have a question about the HT66F20-1 and is the answer not in the manual?
Questions and answers