Rev. 1.71
116
April 11, 2017
Rev. 1.71
117
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
Time Base Interrupts
The function of the Time Base Interrupts is to provide regular time signal in the form of an internal
interrupt. They are controlled by the overflow signals from their respective timer functions. When
these happens their respective interrupt request flags, TB0F or TB1F will be set. To allow the
program to branch to their respective interrupt vector addresses, the global interrupt enable bit, EMI
and Time Base enable bits, TB0E or TB1E, must first be set. When the interrupt is enabled, the stack
is not full and the Time Base overflows, a subroutine call to their respective vector locations will
take place. When the interrupt is serviced, the respective interrupt request flag, TB0F or TB1F, will
be automatically reset and the EMI bit will be cleared to disable other interrupts.
The purpose of the Time Base Interrupt is to provide an interrupt signal at fixed time periods. Their
clock sources originate from the internal clock source f
TB
. This f
TB
input clock passes through a
divider, the division ratio of which is selected by programming the appropriate bits in the TBC
register to obtain longer interrupt periods whose value ranges. The clock source that generates f
TB
,
which in turn controls the Time Base interrupt period, can originate from several different sources,
as shown in the System Operating Mode section.
TBC Register
Bit
7
6
5
4
3
2
1
0
Name
TBON
TBCK
TB11
TB10
—
TB02
TB01
TB00
R/W
R/W
R/W
R/W
R/W
—
R/W
R/W
R/W
POR
0
0
1
1
—
1
1
1
B
it 7
TBON
: TB0 and TB1 Control bit
0: Disable
1: Enable
B
it 6
TBCK
: Select f
TB
Clock
0: f
TBC
1: f
SYS
/4
B
it 5 ~ 4
TB11 ~ TB10
: Select Time Base 1 Time-out Period
00: 4096/f
TB
01: 8192/f
TB
10: 16384/f
TB
11: 32768/f
TB
B
it 3
Unimplemented, read as "0"
B
it 2 ~ 0
TB02 ~ TB00
: Select Time Base 0 Time-out Period
000: 256/f
TB
001: 512/f
TB
010: 1024/f
TB
011: 2048/f
TB
100: 4096/f
TB
101: 8192/f
TB
110: 16384/f
TB
111: 32768/f
TB
Time Base Interrupt