ht82a523r Holtek Semiconductor Inc., ht82a523r Datasheet - Page 16

no-image

ht82a523r

Manufacturer Part Number
ht82a523r
Description
Ht82a523r -- Usb 2.0 Full Speed 8-bit Otp Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
the timer/event counter begins counting not according
to the logic level but to the transient edges. In the case of
counter overflows, the counter is reloaded from the
timer/event counter register and issues an interrupt re-
quest, as in the other two modes, i.e., event and timer
modes.
To enable the counting operation, the Timer ON bit
(T0ON: bit 4 of the TMR0C; T10N: bit 4 of the TMR1C)
should be set to 1. In the pulse width measurement
mode, the T0ON/T1ON is automatically cleared after
the measurement cycle is completed. But in the other
two modes, the T0ON/T1ON can only be reset by in-
structions. The overflow of the Timer/Event Counter 0/1
is one of the wake-up sources. No matter what the oper-
ation mode is, writing a 0 to ET0I or ET1I disables the re-
lated interrupt service.
Rev. 1.30
Bit No.
Bit No.
0~2, 5
0~2
3
4
5
6
7
3
4
6
7
Label
T0ON
T0M0
T0M1
Label
T1ON
T1M0
T1M1
T0E
T1E
Unused bit, read as 0
Defines the TMR active edge of the timer/ event counter
(0=active on low to high; 1=active on high to low)
Enable/disable timer counting (0=disable; 1=enable)
Unused bit, read as 0
Defines the operating mode, T0M1, T0M0:
01=Event count mode (external clock)
10=Timer mode (internal clock)
11=Pulse width measurement mode
00=Unused
Unused bit, read as 0
Defines the TMR active edge of the timer/ event counter
(0=active on low to high; 1=active on high to low)
Enable/disable timer counting (0=disable; 1=enable)
Defines the operating mode, T1M1, T1M0:
01=Event count mode (external clock)
10=Timer mode (internal clock)
11=Pulse width measurement mode
00=Unused
TMR0C (0EH) Register
TMR1C (11H) Register
16
In the case of timer/event counter OFF condition, writing
data to the timer/event counter preload register also re-
loads that data to the timer/event counter. But if the
timer/event counter is turned on, data written to the
timer/event counter is kept only in the timer/event coun-
ter preload register. The timer/event counter still contin-
ues its operation until an overflow occurs.
When the timer/event counter (reading TMR0/TMR1) is
read, the clock is blocked to avoid errors, as this may re-
sults in a counting error. Blocking of the clock should be
taken into account by the programmer. It is strongly rec-
ommended to load a desired value into the TMR0/TMR1
register first, before turning on the related timer/event
counter, for proper operation since the initial value of
TMR0/TMR1 is unknown. Due to the timer/event
scheme, the programmer should pay special attention
on the instruction to enable then disable the timer for the
first time, whenever there is a need to use the
timer/event function, to avoid unpredictable result. After
this procedure, the timer/event function can be operated
normally.
Function
Function
HT82A523R
May 13, 2008

Related parts for ht82a523r