sh6616 SinoWealth Micro-Electronics Corp. Ltd, sh6616 Datasheet - Page 7

no-image

sh6616

Manufacturer Part Number
sh6616
Description
16k 4-bit Microcontroller
Manufacturer
SinoWealth Micro-Electronics Corp. Ltd
Datasheet
4. Timer
SH6616 has one 8-bit timer for counting up, consisting of an
8-bit counter and an 8-bit pre-loaded register. Additionally,
the other base timer provides real time clock function for
time-keeper.
Timer0 provides the following functions:
- Programmable interval timer
- Read counter value
4.1. Timer0 Configuration and Operation:
Timer-0 is an 8-bit write-only timer load register (TL0L,
TL0H), and an 8-bit read-only timer counter (TC0L, TC0H).
Each consists of low order digits and high order digits. Timer
counter is initialized by writing data into the timer load
register (TL0L, TL0H).
First write the low-order digit, then the high-order digit. The
timer counter is automatically loaded with the contents of the
loaded register when the high order digit is written or count
overflows occurs. Timer overflow will result in an interrupt if
the interrupt enable flag is set.
The timer can be programmed in several different clock
sources by setting Timer Mode Register (TM0).
4.2. Timer0 Mode Register:
Timer Mode Registers (TM0) are 4-bit registers used for
timer control as shown in Table 1. Mode Register selects
input pulse sources for the timer.
Table 1. Timer0 Mode Registers ($02)
4.3. Base timer Configuration and Operation:
The base timer generates the different frequency interrupt
for real time clock based on the value of BTM, as shown in
TM0.2
0
0
0
0
1
1
1
1
TM0.1
0
0
1
1
0
0
1
1
TM0.0
0
1
0
1
0
1
0
1
Prescaler
Divide
Ratio
/2
/2
/2
/2
/2
/2
/2
/2
11
9
7
5
3
2
1
0
System clock
System clock
System clock
System clock
System clock
System clock
System clock
System clock
Source
Clock
7
Table 2. The heavy load register, HVL, is used to switch
32.768KHz X’tal oscillator into heavy load mode that makes
the oscillation easier in the startup period but requires more
current.
Table 2. Base Timer Mode Registers ($03)
Base Timer Use (for reference purposes)
To achieve the above interrupt periods, the system register
$06 and $07, BTL and BTH, must be set to 00H for both.
BTM.2
0
0
0
0
1
1
1
1
Warm Up
No
BTM.1
0
0
1
1
0
0
1
1
HVL = 0 (reduce current)
BTM.0
BTM = 001 (0.5 Hz)
BTM = 1, 2 .... Hz
HVL = 0 (disable)
HVL = 1 (enable)
BTM Interrupt?
0
1
0
1
0
1
0
1
Yes
BTM = 0 (stop)
BTH, BTL = 0
Initial
Stop (default)
Interrupt
Period
0.5Hz
16 Hz
32 Hz
1 Hz
2 Hz
4 Hz
8 Hz
Warm Up Done
SH6616
Source
32K Hz
32K Hz
32K Hz
32K Hz
32K Hz
32K Hz
32K Hz
32K Hz
Clock

Related parts for sh6616