Rev. 1.10
62
November 26, 2019
Rev. 1.10
63
November 26, 2019
HT68FB240
USB Low Speed Flash MCU
TM Interrupts
The Compact Type TMs have two internal interrupts, one for each of 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 one TM input pin, with the label TCKn. The TM
input pin is essentially a clock source for the TM and is selected using the TnCK2~TnCK0 bits in
the TMnC0 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 TnCK2~TnCK0 bits. The TM input pin can be chosen to have either a
rising or falling active edge.
The TMs each have more output pins with the label TPn, TPnB. 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 TPn or TPnB 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 and device is different, the details are
provided in the accompanying table.
This allows the TM to generate a complimentary output pair, selected using the I/O register data bits.
Device
CTM
Register
HT68FB240
TP0, TP0B
TP1, TP1B
TMPC
TM Output Pins
TM Input/Output Pin Control Registers
Selecting to have a TM input/output or whether to retain its other shared functions is implemented
using one register with a single bit in each register corresponding to a TM input/output pin. Setting
the bit high will setup the corresponding pin as a TM input/output if reset to zero the pin will retain
its original other functions.
TMPC Register
Bit
7
6
5
4
3
2
1
0
Name
—
—
T1CP1
T1CP0
—
—
T0CP1
T0CP0
R/W
—
—
R/W
R/W
—
—
R/W
R/W
POR
—
—
0
1
—
—
0
1
Bit 7~
6
Unimplemented, read as "0"
Bit 5
T1CP1:
TP
1B
pin control
0: Disable
1: Enable
Bit 4
T1CP0:
TP1 pin control
0: Disable
1: Enable
Bit 3~2
Unimplemented, read as "0"
Bit 1
T0CP1:
TP
0B
pin control
0: Disable
1: Enable
Bit 0
T0CP:
TP0 pin control
0: Disable
1: Enable