English
Language : 

HT45R35 Datasheet, PDF (18/54 Pages) Holtek Semiconductor Inc – C/R to F Type 8-Bit OTP MCU
HT45R35
S y s te m C lo c k
S y s te m C lo c k /4
S1
S2
O VB=0
T im e r A
E x te r n a l R C O s c illa tio n C o n v e r te r In te r r u p t
RCOCON
T im e r B
O VB=1
R esetR C O C O N
R C O S C O u tp u t
External RC Oscillation Converter
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.
Reading TMRAH/TMRBH will also latch the
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
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.
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
; 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=fSYS/4 and timer on
; Polling External RC Oscillation Converter interrupt request flag
; Clear External RC Oscillation Converter interrupt request flag
; Program continue
Rev. 1.20
18
January 29, 2010