ht82a836r Holtek Semiconductor Inc., ht82a836r Datasheet - Page 23

no-image

ht82a836r

Manufacturer Part Number
ht82a836r
Description
Usb Audio Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
HT82A836R
Manufacturer:
HOLTEK/合泰
Quantity:
20 000
bits have been properly setup. Setting the timer enable
bit high together with a mode bit modification, may lead
to improper timer operation if executed as a single timer
control register byte write instruction. When the
Timer/Event counter overflows, its corresponding inter-
rupt request flag in the interrupt control register will be
set. If the timer interrupt is enabled this will in turn gener-
ate an interrupt signal. However irrespective of whether
the timer interrupt is enabled or not, a Timer/Event
counter overflow will also generate a wake-up signal if
the device is in a Power-down condition. This situation
may occur if the Timer/Event Counter is in the Event
Counting Mode and if the external signal continues to
change state. In such a case, the Timer/Event Counter
will continue to count these external events and if an
overflow occurs the device will be woken up from its
org 04h
jmp usbint
reti
org 08h
jmp tmr0int
:
org 20h
;internal Timer/Event Counter interrupt routine
tmr0int:
:
; Timer/Event Counter 0 main program placed here
:
reti
:
:
begin:
;setup Timer 0 registers
mov a,09bh
mov tmr0l,a;
mov a,00h
mov tmr0h,a;
mov a,080h
mov tmr0c,a
; setup interrupt register
mov a,005h
mov intc0,a
set tmr0c.4
Rev. 1.00
; usb interrupt vector
; Timer/Event Counter 0 interrupt vector
; jump here when Timer 0 overflows
; main program
; setup preload value
; setup Timer 0 control register
; timer mode
; enable master interrupt and timer interrupt
; start Timer 0
note mode bits must be previously setup
timer0 counts from this value to FFFFH
23
Power-down condition. To prevent such a wake-up from
occurring, the timer interrupt request flag should first be
set high before issuing the HALT instruction to enter the
Power Down Mode.
Timer Program Example
This program example shows how the Timer/Event
Counter registers are setup, along with how the inter-
rupts are enabled and managed. Note how the
Timer/Event Counter is turned on, by setting bit 4 of the
Timer Control Register. The Timer/Event Counter can
be turned off in a similar way by clearing the same bit.
This example program sets the Timer/Event Counter to
be in the timer mode, which uses the internal system
clock as the clock source.
HT82A836R
March 20, 2008

Related parts for ht82a836r