HT49R50 Holtek Semiconductor Inc, HT49R50 Datasheet - Page 24

no-image

HT49R50

Manufacturer Part Number
HT49R50
Description
8-Bit Microcontroller
Manufacturer
Holtek Semiconductor Inc
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
HT49R50
Manufacturer:
合泰
Quantity:
20 000
Part Number:
HT49R50A-1
Manufacturer:
HOLTEK
Quantity:
4 239
Part Number:
HT49R50A-1
Manufacturer:
SHARP
Quantity:
2 000
Part Number:
HT49R50A-1
Manufacturer:
HOLTEK/合泰
Quantity:
20 000
Company:
Part Number:
HT49R50A-1
Quantity:
12 600
timer/ event counter. But if the timer/event
counter is turn on, data written to the
timer/event counter is kept only in the
timer/event counter preload register. The
timer/event counter still continues its opera-
tion until an overflow occurs.
When the timer/event counter (reading
TMR0/TMR1) is read, the clock is blocked to
avoid errors. As this may results in a counting
error, blocking of the clock should be taken into
account by the programmer.
It is strongly recommended to load a desired
value into the TMR0/TMR1 register first, then
turn on the related timer/event counter for
proper operation. Because the initial value of
TMR0/TMR1 is unknown.
Due to the timer/event scheme, the program-
mer should pay special attention on the instruc-
tion to enable then disable the timer for the
first time, whenever there is a need to use the
timer/event function, to avoid unpredicatable
result. After this procedure, the timer/event
function can be operated normally. The exam-
ple given below, using two 8-bit width Timer¢s
(timer 0 ;timer 1) cascade into 16-bit width.
(TMR1C)
TE
TON
TN2
TN1
TN0
Label
¾
Bits
0~2
3
4
5
7
6
Unused bits, read as ²0²
To define the TMR1 active edge of timer/event counter
(0= active on low to high; 1= active on high to low)
To enable/disable timer counting
(0= disabled; 1= enabled)
2 to 1 multiplexer control inputs to select the timer/event counter clock source
(0= mask option clock source; 1= system clock/4)
To define the operating mode
01= Event count mode (External clock)
10= Timer mode (Internal clock)
11= Pulse Width measurement mode (External clock)
00= Unused
TMR1C register
24
END
START:
Function
mov
mov
mov a, 01h
mov intc1, a ; timer 1 interrupt
mov a, 80h
mov tmr1c, a ; timer mode and select mask
mov a, 0a0h
mov tmr0c, a ; mode and select system
set tmr1c.4
clr
mov a, 00h
mov tmr0, a
mov a, 00h
mov tmr1, a
set tmr0c.4
set tmr1c.4
tmr1c.4 ; for the first time
a, 09h
intc0, a ; enable timer 0 and
; Set operating mode as timer
; Enable then disable timer 1
; Normal operating
;
; Set ET0I&EMI bits to
; global interrupt
; Set ET1I bit to enable
; Set operating mode as
; option clock source
; clock/4
; Load a desired value into
; the TMR0/TMR1 register
;
;
August 18, 1999
HT49C50

Related parts for HT49R50