HT45R35V Holtek Semiconductor Inc., HT45R35V Datasheet - Page 20

no-image

HT45R35V

Manufacturer Part Number
HT45R35V
Description
C/r To F Type 8-bit Otp Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
the Timer A/Timer B (16-bit) simultaneously. Timer
A/Timer B is changed by writing to TMRAH/TMRBH but
writing to TMRAL/TMRBL will keep the Timer A/Timer B
unchanged.
R e a d i n g T M R A H / T M R B H w i l l a l s o l a t c h t h e
TMRAL/TMRBL into the low byte buffer to avoid false
timing problem. Reading TMRAL/TMRBL returns the
contents of the low byte buffer. Therefore, the low byte
of Timer A/Timer B can not be read directly. It must read
TMRAH/TMRBH first to ensure that the low byte con-
tents of Timer A/Timer B are latched into the buffer.
The resistor and capacitor form an oscillation circuit and
input to TMRBH and TMRBL. The RCOM0, RCOM1
External RC oscillation converter mode example program - Timer A overflow:
clr RCOCCR
mov a, 00000010b
mov RCOCR,a
clr intc1.4
mov a, low (65536-1000)
mov tmral, a
mov a, high (65536-1000)
mov tmrah, a
mov a, 00h
mov tmrbl, a
mov a, 00h
mov tmrbh, a
mov a, 00110000b
mov RCOCCR, a
p10:
clr wdt
snz intc1.4
jmp p10
clr intc1.4
Rev. 1.00
; Enable External RC oscillation mode and set Timer A overflow
; Clear External RC Oscillation Converter interrupt request flag
; Give timer A initial value
; Timer A count 1000 time and then overflow
; Give timer B initial value
; Timer A clock source=f
; Polling External RC Oscillation Converter interrupt request flag
; Clear External RC Oscillation Converter interrupt request flag
; Program continue
External RC Oscillation Converter
20
SYS
and RCOM2 bits of RCOCCR define the clock source of
Timer A. It is recommended that the clock source of
Timer A uses the system clock or the instruction clock.
If the RCOCON bit, bit 4 of RCOCCR, is set to 1 Timer
A and Timer B will start counting until Timer A or Timer B
overflows, the timer/event counter will then generate an
interrupt request flag which is RCOCF; bit 4 of INTC1.
The Timer A and Timer B will stop counting and will reset
the RCOCON bit to 0 at the same time. If the
RCOCON bit is 1 , TMRAH, TMRAL, TMRBH and
TMRBL cannot be read or written.
/4 and timer on
January 15, 2009
HT45R35V

Related parts for HT45R35V