HT45R35V Holtek Semiconductor Inc., HT45R35V Datasheet - Page 19

no-image

HT45R35V

Manufacturer Part Number
HT45R35V
Description
C/r To F Type 8-bit Otp Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
to be made. Note that, in this operating mode, the
Timer/Event Counter starts counting not according to
the logic level but according to the transient edges. In
the case of a counter overflow, the counter is reloaded
from the Timer/Event Counter preload register and is-
sues an interrupt request just like the other two modes.
To enable a counting operation, the Timer ON bit, TON; bit
4 of TMRC, should be set to 1 . In the pulse width mea-
surement mode, the TON will be cleared automatically af-
ter the measurement cycle is completed. But in the other
two modes, the TON can only be reset by instructions. The
Timer/Event Counter overflow is one of the wake-up
sources. No matter what the operation mode is, writing a 0
to ETI can disable the interrupt service.
If the Timer/Event Counter is switched off, then writing
data to the Timer/Event Counter preload register will
also directly reload that data to the Timer/Event Coun-
ter. But if the Timer/Event Counter is already running,
data written to it will only be loaded into the Timer/Event
Counter preload register. The Timer/Event Counter will
continue to operate until an overflow occurs. When the
Timer/Event Counter is read, the clock will be blocked to
avoid errors. As clock blocking may results in a counting
error, this must be taken into consideration by the pro-
grammer. Bit0~Bit2 of the TMRC register can be used to
define the pre-scaling stages of the internal clock source
of the Timer/Event Counter.
Rev. 1.00
Bit No.
Bit No.
0~2
2~3
4~7
3
4
5
6
7
0
1
RCOCON Enable or disable external RC oscillation converter counting (0=disabled; 1=enabled)
RCOM0
RCOM1
RCOM2
Label
Label
RCO
OVB
RW
Unused bit, read as 0
Undefined bit, this bit can read/write
Define the Timer A clock source, RCOM2, RCOM1, RCOM0=
000=System clock
001=System clock/4
010=Unused
011=Unused
100=Unused
101=Unused
110=Unused
111=Unused
In the RC oscillation converter mode, this bit is used to define the timer/event counter interrupt,
which comes from Timer A overflow or Timer B overflow.
(0=Timer A overflow; 1=Timer B overflow)
Define RC oscillation converter mode.
(0=Disable RC oscillation converter mode; 1=Enable RC oscillation converter mode)
Unused bit, read as 0
4-bit read/write registers for user defined.
RCOCCR (22H) Register
RCOCR (25H) Register
19
External RC Oscillation Converter
An external RC oscillation mode is implemented in the
device. The RC oscillation converter contains two 16-bit
programmable count-up counters.
The RC oscillation converter is comprised of the
TMRAL, TMRAH, TMRBL, TMRBH registers when the
RCO bit, bit 1 of RCOCR register, is 1 . The RC oscilla-
tion converter Timer B clock source may come from an
external RC oscillator. The Timer A clock source comes
from the system clock or from the system clock/4, deter-
mined by the RCOCCR register.
There are six registers related to the RC oscillation con-
verter, i.e., TMRAH, TMRAL, RCOCCR, TMRBH,
TMRBL and RCOCR. The internal timer clock is the in-
put to TMRAH and TMRAL, the external RC oscillation
is the input to TMRBH and TMRBL. The OVB bit, bit 0 of
the RCOCR register, decides whether Timer A over-
flows or Timer B overflows, then the RCOCF bit is set
and an external RC oscillation converter interrupt oc-
curs. When the RC oscillation converter mode Timer A
or Timer B overflows, the RCOCON bit is reset to 0
and stops counting. Writing to TMRAH/TMRBH places
the start value in Timer A/Timer B while reading
TMRAH/TMRBH obtains the contents of Timer A/Timer
B. Writing to TMRAL/TMRBL only writes the data into a
low byte buffer. However writing to TMRAH/TMRBH will
write the data and the contents of the low byte buffer into
Function
Function
January 15, 2009
HT45R35V

Related parts for HT45R35V