
Rev. 1.21
88
�ove��e� ��� 2�1�
Rev. 1.21
8�
�ove��e� ��� 2�1�
HT66F488/HT66F489
A/D Flash MCU with EEPROM
HT66F488/HT66F489
A/D Flash MCU with EEPROM
However a compare match from Comparator A will also automatically clear the STON bit and thus
generate the Single Pulse output trailing edge. In this way the CCRA value can be used to control
the pulse width. A compare match from Comparator A will also generate a TM interrupt. The counter
can only be reset back to zero when the STON bit changes from low to high when the counter
restarts. In the Single Pulse Mode CCRP is not used. The STCCLR and STDPX bits are not used in
this Mode.
Capture Input Mode
To select this mode bits STM1 and STM0 in the STMC1 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 STP pin, 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 STIO1 and STIO0 bits in
the STMC1 register. The counter is started when the STON bit changes from low to high which is
initiated using the application program.
When the required edge transition appears on the STP 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 STP pin the counter will continue to free run until the STON 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 STIO1 and
STIO0 bits can select the active trigger edge on the STP pin to be a rising edge, falling edge or both
edge types. If the STIO1 and STIO0 bits are both set high, then no capture operation will take place
irrespective of what happens on the STP pin, however it must be noted that the counter will continue
to run.
As the STP 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 STCCLR and STDPX bits are not used in this
Mode.