English
Language : 

HT45F65 Datasheet, PDF (138/231 Pages) Holtek Semiconductor Inc – Glucose Meter 8-Bit Flash MCU
HT45F65/HT45F66/HT45F67
Glucose Meter 8-Bit Flash MCU
Capture Input Mode
To select this mode, bits T1AM1, T1AM0 and T1BM1, T1BM0 in the TM1C1 and TM1C2 registers
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 TP1A and TP1B_0, TP1B_1, TP1B_2 pins,
whose active edge can be either a rising edge, a falling edge or both rising and falling edges; the
active edge transition type is selected using the T1AIO1, T1AIO0 and T1BIO1, T1BIO0 bits in the
TM1C1 and TM1C2 registers. 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 TP1A and TP1B_0, TP1B_1, TP1B_2 pins the
present value in the counter will be latched into the CCRA and CCRB registers and a TM interrupt
generated. Irrespective of what events occur on the TP1A and TP1B_0, TP1B_1, TP1B_2 pins
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 T1AIO1, T1AIO0 and T1BIO1,
T1BIO0 bits can select the active trigger edge on the TP1A and TP1B_0, TP1B_1, TP1B_2 pins
to be a rising edge, falling edge or both edge types. If the T1AIO1, T1AIO0 and T1BIO1, T1BIO0
bits are both set high, then no capture operation will take place irrespective of what happens on the
TP1A and TP1B_0, TP1B_1, TP1B_2 pins, however it must be noted that the counter will continue
to run.
As the TP1A and TP1B_0, TP1B_1, TP1B_2 pins are pin shared with other functions, care must
be taken if the TM is in the Capture Input 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,
T1AOC, T1BOC, T1APOL and T1BPOL bits are not used in this mode.
Rev. 1.60
138
November 24, 2015