HT83F10 HOLTEK [Holtek Semiconductor Inc], HT83F10 Datasheet - Page 22

no-image

HT83F10

Manufacturer Part Number
HT83F10
Description
Flash Type Voice OTP MCU
Manufacturer
HOLTEK [Holtek Semiconductor Inc]
Datasheet
Timer Program Example
The following example program section is based on the HT83F60 device, which contain two 8-bit timers. Programming
the timer for other devices is conducted in a very similar way. The program shows how the timer registers are setup
along with how the interrupts are enabled and managed. Points to note in the example are how, for the 8-bit timer. Note
how the timer is turned on by setting bit 4 of the respective timer control register. The timer can be turned off in a similar
way by clearing the same bit. This example program sets the timer to be in the timer mode which uses the internal fsys
as their clock source, and produce a timer 0 interrupt per 1ms.
#include HT83F60.inc
org 04h
org 08h
org 0Ch
org 10h
org 14h
begin:
Rev. 1.00
jmp begin
:
reti
jmp tmr0int
reti
reti
reti
:
Tmr0int:
:
:
reti
:
mov a,06h
mov tmr0,a
mov a,094
mov tmr0c,a
mov a,05h
mov intc,a
; time base vector
; timer 0 interrupt vector
; jump here when timer 0 overflows every 1ms
; internal timer 0 interrupt routine
; timer 0 main program placed here
; setup timer 0 registers
; setup timer 0 low byte
; flow byte must be setup before high byte
; setup timer 0 control register
; setup timer mode and clock source is fsys/32 prescaler
; setup interrupt register
; enable global interrupt
; enable timer 0 interrupt
22
HT83FXX
May 12, 2009

Related parts for HT83F10