Rev. 1.20
78
�an�a�� 2�� 201�
Rev. 1.20
79
�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
Compact Type TM Operating Modes
The Compact Type TM can operate in one of three operating modes, Compare Match Output Mode,
PWM Output Mode or Timer/Counter Mode. The operating mode is selected using the C
T
0M1 and
C
T
0M0 bits in the C
TM
0C1 register.
Compare Match Output Mode
To select this mode, bits C
T
0M1 and C
T
0M0 in the C
TM
0C1 register, should be set to 00
respectively. In this mode once the counter is enabled and running it can be cleared by three
methods. These are a counter overflow, a compare match from Comparator A and a compare match
from Comparator P. When the C
T
0CCLR bit is low, there are two ways in which the counter can be
cleared. One is when a compare match from Comparator P, the other is when the CCRP bits are all
zero which allows the counter to overflow. Here both CTMA0F and C
TMP
0F interrupt request flags
for Comparator A and Comparator P respectively, will both be generated.
If the C
T
0CCLR bit in the C
TM
0C1 register is high then the counter will be cleared when a compare
match occurs from Comparator A. However, here only the CTMA0F interrupt request flag will be
generated even if the value of the CCRP bits is less than that of the CCRA registers. Therefore when
C
T
0CCLR is high no C
TMP
0F interrupt request flag will be generated. If the CCRA bits are all
zero, the counter will overflow when its reaches its maximum 10-bit, 3FF Hex, value, however here
the CTMA0
F
interrupt request flag will not be generated.
As the name of the mode suggests, after a comparison is made, the C
TM
0 output pin will change
state. The C
TM
0 output pin condition however only changes state when a CTMA0F interrupt
request flag is generated after a compare match occurs from Comparator A. The C
TMP
0F interrupt
request flag, generated from a compare match occurs from Comparator P, will have no effect on
the C
TM
0 output pin. The way in which the C
TM
0 output pin changes state are determined by
the condition of the C
T
0IO1 and C
T
0IO0 bits in the C
TM
0C1 register. The C
TM
0 output pin can
be selected using the C
T
0IO1 and C
T
0IO0 bits to go high, to go low or to toggle from its present
condition when a compare match occurs from Comparator A. The initial condition of the C
TM
0
output pin, which is setup after the C
T
0ON bit changes from low to high, is setup using the C
T
0OC
bit. Note that if the C
T
0IO1 and C
T
0IO0 bits are zero then no pin change will take place.
Содержание 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 ...