![Sino Wealth SH61F83 Скачать руководство пользователя страница 34](http://html1.mh-extra.com/html/sino-wealth/sh61f83/sh61f83_manual_1283060034.webp)
SH61F83
34
8. Base Timer
The Timer-x is an 8-bit counter with a programmable clock source selection and the value of Base Timer-x counter can be
read out any time.(x = 0, 1)
The Base Timer-x can be enabled/disabled by the CPU. After reset, the Base Timer-x is disabled and cleared.
The Base Timer-x can be preset by writing a preset value to
BTx
register at any time. When the Base Timer-x is enabled,
the Base Timer-x starts counting from the preset value to FFH and when the values reaches 00H, it generates a Base
Timer-x interrupt if the Base Timer-x interrupt is enabled. When it reaches 00H, the Base Timer-x will auto-load the value in
BTx
register and begins counting.
The Base Timer-x can be enabled by writing a “1” to “
ENBTx
” in the
BTCON
(Base Timer Control) register. The
ENBTx
is
level trigger. If any value is written to
BTx
register when it is counting, Base Timer-x will reload that value immediately and
continue counting from that written value. Every time
ENBTx
goes rising, the counter begins to count from the preset value
in
BTx
register.
The input clock source of Base Timer-x is controlled by the
BTxM[2:0]
register. The following table shows 8 ranges of the
Base Timer-x. For counting accuracy, please set the Base Timer-x register first, then preset the
BTxM[2:0]
register, last,
enable the Base Timer-x.
00D2H
BT0
Initial Value
Base Timer-0 Control Register
Bit[7:0]
BT0[7:0]
00h
R/W
Base Timer-0 register
Reset Source: Hardware reset or USB reset
00D3H
BT1
Initial Value
Base Timer-1 Control Register
Bit[7:0]
BT1[7:0]
00h
R/W
Base Timer-1 register
Reset Source: Hardware reset or USB reset
00D4H
BTCON
Initial Value
Base Timer Control Register
Bit7
ENBT1
0b
R/W
0: Disable Base Timer-1
1: Enable Base Timer-1
Reset Source: Hardware reset or USB reset
Bit[6:4] BT1M[2:0]
000b
R/W
Base Timer-1 clock source
000: F
BT
/2
0
001: F
BT
/2
1
010: F
BT
/2
2
011: F
BT
/2
3
100: F
BT
/2
4
101: F
BT
/2
5
110: F
BT
/2
6
111: F
BT
/2
7
F
BT
= F
SYS
/6
Reset Source: Hardware reset or USB reset
Bit3
ENBT0
0b
R/W
0: Disable Base Timer-0
1: Enable Base Timer-0
Reset Source: Hardware reset or USB reset
Bit[2:0] BT0M[2:0]
000b
R/W
Base Timer-0 clock source
000: F
BT
/2
0
001: F
BT
/2
1
010: F
BT
/2
2
011: F
BT
/2
3
100: F
BT
/2
4
101: F
BT
/2
5
110: F
BT
/2
6
111: F
BT
/2
7
F
BT
= F
SYS
/6
Reset Source: Hardware reset or USB reset