Rev. 1.20
76
�an�a�� 2�� 201�
Rev. 1.20
77
�an�a�� 2�� 201�
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
Bit 3
CT0ON
: CTM0 Counter On/Off Control
0:
Off
1:
On
This bit controls the overall on/off function of the CTM0. Setting the bit high enables
the counter to run, clearing the bit disables the CTM0. Clearing this bit to zero will
stop the counter from counting and turn off the CTM0 which will reduce its power
consumption. When the bit changes state from low to high the internal counter value
will be reset to zero, however when the bit changes from high to low, the internal
counter will retain its residual value.
If the CTM0 is in the Compare Match Output Mode then the CTM0 output pin will
be reset to its initial condition, as specified by the CT0OC bit, when the CT0ON bit
changes from low to high.
Bit 2~0
CT0RP2~CT0RP0
: C
TM
0 CCRP 3-bit register, compared with the C
TM
0 Counter
bit 9~bit 7 Comparator P Match Period
000: 1024 CTM0 clocks
001: 128 CTM0 clocks
010: 256 CTM0 clocks
011: 384 CTM0 clocks
100: 512 CTM0 clocks
101: 640 CTM0 clocks
110: 768 CTM0 clocks
111: 896 CTM0 clocks
These three bits are used to setup the value on the internal CCRP 3-bit register, which
are then compared with the internal counter’s highest three bits. The result of this
comparison can be selected to clear the internal counter if the CT0CCLR bit is set to
zero. Setting the CT0CCLR bit to zero ensures that a compare match with the CCRP
values will reset the internal counter. As the CCRP bits are only compared with the
highest three counter bits, the compare values exist in 128 clock cycle multiples.
Clearing all three bits to zero is in effect allowing the counter to overflow at its
maximum value.
CTM0C1 Register
Bit
7
6
5
4
3
2
1
0
Name
CT0M1
CT0M0
CT0IO1
CT0IO0
CT0OC
CT0POL CT0DPX CT0CCLR
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
POR
0
0
0
0
0
0
0
0
Bit 7~6
CT0M1~CT0M0
: Select CTM0 Operating Mode
00: Compare Match Output Mode
01:
U
ndefined
10: PWM Mode
11: Timer/Counter Mode
These bits setup the required operating mode for the C
TM
0. To ensure reliable
operation the C
TM
0 should be switched off before any changes are made to the
C
T
0M1 and C
T
0M0 bits. In the Timer/Counter Mode, the C
TM
0 output pin control
must be disabled.
Bit 5
~4
CT0IO1~CT0IO0
: Select TP0 output function
Compare Match Output Mode
00: No change
01:
O
utput low
10:
O
utput high
11:
T
oggle output
PWM Mode
00: PWM Output inactive state
01: PWM Output active state
10: PWM output
11:
U
ndefined
Содержание BS82B12A-3
Страница 33: ...Rev 1 20 33 January 23 2015 BS82B12A 3 BS82C16A 3 BS82D20A 3 Touch Key 8 Bit Flash MCU with LED LCD Driver ...
Страница 34: ...Rev 1 20 34 January 23 2015 BS82B12A 3 BS82C16A 3 BS82D20A 3 Touch Key 8 Bit Flash MCU with LED LCD Driver ...
Страница 35: ...Rev 1 20 35 January 23 2015 BS82B12A 3 BS82C16A 3 BS82D20A 3 Touch Key 8 Bit Flash MCU with LED LCD Driver ...