
Rev. 1.00
160
October 26, 2018
Rev. 1.00
161
October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
the corresponding interrupt register has been set. The pin must also be set as an input by setting
the corresponding bit in the port control register. When the interrupt is enabled, the stack is not full
and the correct transition type appears on the external interrupt pin, a subroutine call to the external
interrupt vector, will take place. When the interrupt is serviced, the external interrupt request flags,
INTF, will be automatically reset and the EMI bit will be automatically cleared to disable other
interrupts. Note that any pull-high resistor selections on the external interrupt pins will remain valid
even if the pin is used as an external interrupt input.
The INTEG register is used to select the type of active edge that will trigger the external interrupt.
A choice of either rising or falling or both edge types can be chosen to trigger an external interrupt.
Note that the INTEG register can also be used to disable the external interrupt function.
Touch Key Module Interrupt
For a Touch Key interrupt to occur, the global interrupt enable bit, EMI, and the Touch Key interrupt
enable bit, TKME, must be first set. An actual Touch Key interrupt will take place when the Touch
Key interrupt request flag, TMKF, is set, a situation that will occur when the time slot counter
overflows. When the interrupt is enabled, the stack is not full and the Touch Key time slot counter
overflow occurs, a subroutine call to the relevant interrupt vector, will take place. When the interrupt
is serviced, the Touch Key interrupt request flag will be automatically reset and the EMI bit will also
be automatically cleared to disable other interrupts.
Time Base Interrupt
The function of the Time Base Interrupt is to provide regular time signal in the form of an internal
interrupt. It is controlled by the overflow signal from its internal timer. When this happens its
interrupt request flag, TBF, will be set. To allow the program to branch to its respective interrupt
vector addresses, the global interrupt enable bit, EMI and Time Base enable bit, TBE, must first be
set. When the interrupt is enabled, the stack is not full and the Time Base overflows, a subroutine
call to its respective vector location will take place. When the interrupt is serviced, the interrupt
request flag, TBF, 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. Its
clock source, f
PSC
, originates from the internal clock source f
SYS
, f
SYS
/4 or f
SUB
and then 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 which in turn
controls the Time Base interrupt period is selected using the CLKSEL[1:0] bits in the PSCR register.
M
U
X
f
SYS
/4
f
SYS
f
SUB
Prescaler
CLKSEL[1:0]
f
PSC
f
PSC
/2
8
~ f
PSC
/2
15
M
U
X
TB[2:0]
Time Base Interrupt
TBON
Time Base Interrupt