ht82m99ee Holtek Semiconductor Inc., ht82m99ee Datasheet - Page 11

no-image

ht82m99ee

Manufacturer Part Number
ht82m99ee
Description
Ht82m99ee/ht82m99ae -- Usb Mouse Encoder 8-bit Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
When the interrupt is enabled, the stack is not full and
the external interrupt is active, a subroutine call to loca-
tion 04H will occur. The interrupt request flag (USBF)
and EMI bits will be cleared to disable other interrupts.
When the PC Host access the FIFO of the HT82M99EE/
HT82M99AE, the corresponding request bit of the USR
is set, and a USB interrupt is triggered. So user can eas-
ily decide which FIFO is accessed. When the interrupt
has been served, the corresponding bit should be
cleared by firmware. When the HT82M99EE/
HT82M99AE receives a USB Suspend signal from the
Host PC, the suspend line (bit0 of the USC) of the
HT82M99EE/HT82M99AE is set and a USB interrupt is
also triggered.
When the HT82M99EE/HT82M99AE receives a Re-
sume signal from the Host PC, the resume line (bit3 of
the USC) of the HT82M99EE/HT82M99AE are set and
a USB interrupt is triggered.
Whenever a USB reset signal is detected, the USB in-
terrupt is triggered and URST_Flag bit of the USC regis-
ter is set. When the interrupt has been served, the bit
should be cleared by firmware.
The internal timer/even counter interrupt is initialized by
setting the timer/event counter interrupt request flag (;bit
6 of the INTC), caused by a timer overflow. When the in-
terrupt is enabled, the stack is not full and the TF is set, a
subroutine call to location 0CH will occur. The related in-
terrupt request flag (TF) will be reset and the EMI bit
cleared to disable further interrupts.
During the execution of an interrupt subroutine, other in-
terrupt acknowledge signals are held until the RETI in-
struction is executed or the EMI bit and the related
interrupt control bit are set to 1 (if the stack is not full). To
return from the interrupt subroutine, RET or RETI
may be invoked. RETI will set the EMI bit to enable an
interrupt service, but RET will not.
Interrupts, occurring in the interval between the rising
edges of two consecutive T2 pulses, will be serviced on
the latter of the two T2 pulses, if the corresponding inter-
rupts are enabled. In the case of simultaneous requests
the following table shows the priority that is applied.
These can be masked by resetting the EMI bit.
Once the interrupt request flags (TF, USBF) are set, they
will remain in the INTC register until the interrupts are ser-
viced or cleared by a software instruction. It is recom-
mended that a program does not use the CALL
subroutine within the interrupt subroutine. Interrupts of-
ten occur in an unpredictable manner or need to be ser-
viced immediately in some applications. If only one stack
is left and enabling the interrupt is not well controlled, the
Rev. 1.30
USB interrupt
Timer/Event Counter overflow
Interrupt Source
Priority
1
2
Vector
0CH
04H
11
original control sequence will be damaged once the
Oscillator Configuration
There is an oscillator circuit in the microcontroller.
This oscillator is designed for system clocks. The HALT
mode stops the system oscillator and ignores an exter-
nal signal to conserve power.
A crystal across OSC1 and OSC2 is needed to provide
the feedback and phase shift required for the oscillator.
No other external components are required. In stead of
a crystal, a resonator can also be connected between
OSC1 and OSC2 to get a frequency reference, but two
external capacitors in OSC1 and OSC2 are required.
The HT82M99EE/HT82M99AE can operate in 6MHz or
12MHz system clocks. In order to make sure that the
USB SIE functions properly, user should correctly con-
figure the SCLKSEL bit of the SCC Register. The default
system clock is 12MHz.
The WDT oscillator is a free running on-chip RC oscilla-
tor, and no external components are required. Even if
the system enters the power down mode, the system
clock is stopped, but the WDT oscillator still works within
a period of approximately 31 s. The WDT oscillator can
be disabled by ROM code option to conserve power.
Watchdog Timer - WDT
The WDT clock source is implemented by a dedicated
RC oscillator (WDT oscillator), or instruction clock (sys-
tem clock divided by 4), determine by ROM code option.
This timer is designed to prevent a software malfunction
or sequence from jumping to an unknown location with
unpredictable results. The Watchdog Timer can be dis-
abled by ROM code option. If the Watchdog Timer is dis-
abled, all the executions related to the WDT result in no
operation.
Once the internal WDT oscillator (RC oscillator with a
period of 31 s/5V normally) is selected, it is first divided
by 256 (8-stage) to get the nominal time-out period of
8ms/5V. This time-out period may vary with tempera-
tures, VDD and process variations. By invoking the
WDT prescaler, longer time-out periods can be realized.
Writing data to WS2, WS1, WS0 (bits 2, 1, 0 of the
WDTS) can give different time-out periods. If WS2,
WS1, and WS0 are all equal to 1, the division ratio is up
to 1:128, and the maximum time-out period is 1s/5V. If
the WDT oscillator is disabled, the WDT clock may still
CALL operates in the interrupt subroutine.
HT82M99EE/HT82M99AE
System Oscillator
August 13, 2007

Related parts for ht82m99ee