![SONIX SN32F107 Скачать руководство пользователя страница 157](http://html1.mh-extra.com/html/sonix/sn32f107/sn32f107_user-manual_1321507157.webp)
SN32F100 Series
32-Bit Cortex-M0 Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 157
Version 1.9
The comparator positive input terminal includes internal reference voltage source. The internal reference voltage
source supports three levels which are 1/4*Vdd (CMPS[1:0] = 00), 1/2*Vdd (CMPS[1:0] = 01) and 3/4*Vdd (CMPS[1:0]
= 10,11).
The comparator negative input terminal supports maximum 24-channel controlled by CMCH [4:0]. 00000 = P2.0.
00001 = P2.1. 00010 = P2.2. 00011 = P2.3. 00100 = P2.4. 00101 = P2.5. 00110 = P2.6. 00111 = P2.7.
01000 = P2.8. 01001 = P2.9. 01010 = P2.10. 01011 = P2.11. 01100 = P2.12. 01101 = P2.13. 01110 = P2.14.
01111 = P2.15. 10000 = P3.0. 10001 = P3.1. 10010 = P3.2. 10011 = P3.3. 10100 = P3.4. 10101 = P3.5.
10110 = P3.6. 10111 = P3.7. These channels selected is only when the comparator enables (CMPEN=1), the
24-channel analog switch works, or not workable. If one pin is selected to be comparator negative input pin, the pin is
switched to input mode and connected to comparator negative input terminal. When the system selects to other pin or
comparator disables, the original channel will returns to last GPIO mode automatically.
The comparator output status can output to CMO pin controlled by CMPOEN bit. When CMPOEN=0, the comparator
output pin is GPIO mode. If CMPOEN=1, CMO pin outputs comparator output status and isolates GPIO mode. The
comparator output terminal connects to internal path. The CMPOUT flag is the CMPOUT shows the comparator result
immediately, but the CMPIRQ only indicates the event of the comparator result. The comparator output terminal
through de-bounce circuit generates the comparator trigger edge controlled by CMPG. The even condition is controlled
by register and includes rising edge (CMPOUT changes from low to high), falling edge (CMPOUT changes from high to
low) controlled by CMPG bit. The CMPIRQ = 1 condition makes the comparator interrupt service executed when
CMPGIE (comparator interrupt control bit) set.
+
-
Comparator
Comparator
Internal Logic
Internal Reference
Voltage
CMPN = P2.0~P2.15
P3.0~P3.7
selected by CMCH[4:0]
CMPEN = 1
CMPS[1:0] = 00, 1/4*Vdd
CMPS[1:0] = 01, 1/2*Vdd
CMPS[1:0] = 10/11, 3/4*Vdd
14.3 COMPARATOR APPLICATION NOTICE
The comparator is to compares the positive voltage and negative voltage to output result. The positive used internal
reference and negative sources are analog signal. In hardware application circuit, the comparator input pins must be
connected a 0.1uF capacitance to reduce power noise and make the input signal more stable. The application circuit is
as following.
MCU
0.1uF
Vdd
Vss
CM0
0.1uF
Channel 0 of Comparator
Negative Input
CM23
0.1uF
Channel 23 of Comparator
Negative Input
R
Reset
14.4 COMPARATOR CONTROL REGISTERS
Base Address: 0x4006 6000
14.4.1 Comparator Control register (CMPM)
Address Offset: 0x00
Bit
Name
Description
Attribute
Reset
31
CMPEN
Comparator control bit.
R/W
0
Содержание SN32F107
Страница 34: ...SN32F100 Series 32 Bit Cortex M0 Micro Controller SONiX TECHNOLOGY CO LTD Page 34 Version 1 9 0 Reserved R 0...
Страница 180: ...SN32F100 Series 32 Bit Cortex M0 Micro Controller SONiX TECHNOLOGY CO LTD Page 180 Version 1 9 20 2 LQFP 64 PIN...
Страница 181: ...SN32F100 Series 32 Bit Cortex M0 Micro Controller SONiX TECHNOLOGY CO LTD Page 181 Version 1 9 20 3 LQFP 80 PIN...