Rev. 1.71
74
April 11, 2017
Rev. 1.71
75
April 11, 2017
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
Standard Type TM Operating Modes
The Standard Type TM can operate in one of five operating modes, Compare Match Output Mode,
PWM Output Mode, Single Pulse Output Mode, Capture Input Mode or Timer/Counter Mode. The
operating mode is selected using the ST0M1 and ST0M0 bits in the STM0C1 register.
Compare Output Mode
To select this mode, bits ST0M1 and ST0M0 in the STM0C1 register, should be set to 00
respectively. In this mode once the counter is enabled and running it can be cleared by three
methods. These are a counter overflow, a compare match from Comparator A and a compare match
from Comparator P. When the ST0CCLR bit is low, there are two ways in which the counter can be
cleared. One is when a compare match from Comparator P, the other is when the CCRP bits are all
zero which allows the counter to overflow. Here both STMA0F and STMP0F interrupt request flags
for Comparator A and Comparator P respectively, will both be generated.
If the ST0CCLR bit in the STM0C1 register is high then the counter will be cleared when a compare
match occurs from Comparator A. However, here only the STMA0F interrupt request flag will
be generated even if the value of the CCRP bits is less than that of the CCRA registers. Therefore
when ST0CCLR is high no STMP0F interrupt request flag will be generated. In the Compare
Match Output Mode, the CCRA can not be set to "0".
If the CCRA bits are all zero, the counter will
overflow when its reaches its maximum 10-bit, 3FF Hex, value, however here the STMA0F interrupt
request flag will not be generated.
As the name of the mode suggests, after a comparison is made, the STM output pin, will change
state. The STM output pin condition however only changes state when an STMA0F interrupt request
flag is generated after a compare match occurs from Comparator A. The STMP0F interrupt request
flag, generated from a compare match occurs from Comparator P, will have no effect on the STM
output pin. The way in which the STM output pin changes state are determined by the condition of
the ST0IO1 and ST0IO0 bits in the STM0C1 register. The STM output pin can be selected using
the ST0IO1 and ST0IO0 bits to go high, to go low or to toggle from its present condition when a
compare match occurs from Comparator A. The initial condition of the STM output pin, which is
setup after the ST0ON bit changes from low to high, is setup using the ST0OC bit. Note that if the
ST0IO1 and ST0IO0 bits are zero then no pin change will take place.