sh6620a SinoWealth Micro-Electronics Corp. Ltd, sh6620a Datasheet - Page 9

no-image

sh6620a

Manufacturer Part Number
sh6620a
Description
Mask 4-bit Microcontroller
Manufacturer
SinoWealth Micro-Electronics Corp. Ltd
Datasheet
4.2. Timer0 Interrupt
The timer overflow will generate an internal interrupt request, when the counter counts overflow from $FF to $00. If the interrupt
enable flag is enabled, then a timer interrupt service routine will proceed. This can also be used to wake the CPU from HALT
mode.
4.3. Timer0 mode register
The timer can be programmed in several different pre-scaler ratios by setting the Timer Mode Register (TM0). The 8-bit counter
counts pre-scaler overflow output pulses. The timer mode registers (TM0) are 3-bit registers used for timer control as shown in
Table1. These mode registers select the input pulse sources into the timer.
Table 1: Timer 0 Mode Register ($02)
4.4. External Clock/Event T0 as TMR0 Source
When an external clock/event input is used for TM0, it is synchronized with the CPU system clock. Therefore, the external
source must follow certain constrains. The output from T0M multiplex is T0C. It is sampled by the system clock in instruction
frame cycle. Thus, it is necessary for T0C to be HIGH for at least 2 t
selects /20, T0C is the same as the system clock input. The requirement is as follows:
T0H = T0CH = T0 high time ≥ 2 t
T0L = T0CL = T0 low time ≥ 2 t
When other pre-scaler ratio is selected, the TM0 is scaled by the asynchronous ripple counter and the pre-scaler output is
symmetrical.
Then:
T0C high time = T0C low time =
Where
T0 = Timer0 input period
N = pre-scaler value
The requirement is, therefore:
The limitation is applied for T
T0 = Timer0 period ≥
N
*
2
TM0.2
T0
0
0
0
0
1
1
1
1
≥ 2 t
OSC
TM0.1
+
0
0
1
1
0
0
1
1
∆ , or T0 ≥
T
4
*
tosc
N
TM0.0
0
+
period time only. The pulse width is not limited by this equation. It is summarized as follows:
0
1
0
1
0
1
0
1
2
Δ
OSC
N
4
OSC
T
*
2
*
T0
tosc
+
+
N
Δ
Δ
+
T
T
2
Δ
T
Pre-scaler Divide Ratio
/2
/2
/2
/2
/2
/2
/2
/2
11
9
7
5
3
4
1
0
9
OSC
and LOW for at least 2 t
2048 (initial)
Ratio N
512
128
32
8
4
2
1
OSC
. When the pre-scaler ratio
SH6620A

Related parts for sh6620a