Rev. 1.71
66
April 11, 2017
Rev. 1.71
67
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
TM Interrupts
The Standard and Periodic type TMs each has two internal interrupts, the internal comparator A or
comparator P, which generate a TM interrupt when a compare match condition occurs. When a TM
interrupt is generated, it can be used to clear the counter and also to change the state of the TM output pin.
TM External Pins
Each of the TMs, irrespective of what type, has two TM input pins, with the label xTCKn and
xTPnI. The TM input pin xTCKn, is essentially a clock source for the TM and is selected using the
xTnCK2~xTnCK0 bits in the xTMnC0 register. This external TM input pin allows an external clock
source to drive the internal TM. This external TM input pin is shared with other functions but will
be connected to the internal TM if selected using the xTnCK2~xTnCK0 bits. The TM input pin can
be chosen to have either a rising or falling active edge.
T
he other TM input pin, xTPnI, is the capture input whose active edge can be a rising edge, a falling
edge or both rising and falling edges and the active edge transition type is selected using the xTnIO1
and xTnIO0 bits in the xTMnC1 register.
The TMs each have two output pins with the label x
TPn
and xTPnB. When the TM is in the
Compare Match Output Mode, these pins can be controlled by the TM to switch to a high or low
level or to toggle when a compare match situation occurs. The external xTPn output pin is also the
pin where the TM generates the PWM output waveform. As the TM output pins are pin-shared with
other function, the TM output function must first be setup using registers. A single bit in one of the
registers determines if its associated pin is to be used as an external TM output pin or if it is to have
another function. The number of output pins for each TM type is different, the details are provided
in the accompanying table.
Device
TM0
TM1
HT66F002/HT66F0025
STCK0, STP0I
STP0, STP0B
—
HT66F003
STCK0, STP0I
STP0, STP0B
PTCK1, PTP1I
PTP1, PTP1B
HT66F004
PTCK0, PTP0I
PTP0, PTP0B
PTCK1, PTP1I
PTP1, PTP1B
TM Input/Output Pins
TM Input/Output Pin Control Register
Selecting to have a TM input/output or whether to retain its other shared function is implemented
using one register, with a single bit in each register corresponding to a TM input/output pin.
Configuring the selection bits correctly will setup the corresponding pin as a TM input/output. The
details of the pin-shared function selection are described in the pin-shared function section.
STM
STP0
STCK0
Capture Input
TCK Input
Output
STP0I
STP0B
Inverting Output
STM Function Pin Control Block Diagram