Rev. 1.20
96
�an�a�� 2�� 201�
Rev. 1.20
97
�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
Capture Input Mode
To select this mode bits PT0M1 and PT0M0 in the PTM0C1 register should be set to 01
respectively. This mode enables external signals to capture and store the present value of the internal
counter and can therefore be used for applications such as pulse width measurements. The external
signal is supplied on the TP1_0, TP1_1 or TCK1 pin which is selected using the PT0CKS bit in the
PTM0C1 register. The input pin active edge can be either a rising edge, a falling edge or both rising
and falling edges; the active edge transition type is selected using the PT0IO1 and PT0IO0 bits in
the PTM0C1 register. The counter is started when the PT0ON bit changes from low to high which is
initiated using the application program.
When the required edge transition appears on the TP1_0, TP1_1 or TCK1 pin the present value in
the counter will be latched into the CCRA registers and a PTM0 interrupt generated. Irrespective
of what events occur on the TP1_0, TP1_1 or TCK1 pin, the counter will continue to free run until
the PT0ON bit changes from high to low. When a CCRP compare match occurs the counter will
reset back to zero; in this way the CCRP value can be used to control the maximum counter value.
When a CCRP compare match occurs from Comparator P, a PTM0 interrupt will also be generated.
Counting the number of overflow interrupt signals from the CCRP can be a useful method in
measuring long pulse widths. The PT0IO1 and PT0IO0 bits can select the active trigger edge on the
TP
1_0, TP1_1 or TCK1 pin to be a rising edge, falling edge or both edge types. If the PT0IO1 and
PT
0IO0 bits are both set high, then no capture operation will take place irrespective of what happens
on the TP1_0, TP1_1 or TCK1 pin, however it must be noted that the counter will continue to run.
As the TP1_0, TP1_1 or TCK1 pin is pin shared with other functions, care must be taken if the
PTM
0 is in the Capture Input Mode. This is because if the pin is setup as an output, then any
transitions on this pin may cause an input capture operation to be executed. The
PT
0CCLR,
PT
0OC
and
PT
0POL bits are not used in this Mode.
Содержание 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 ...