
Mini57
Apr. 06, 2017
Page 453 of 475
Rev.1.00
MINI5
7
S
E
RI
E
S
TECH
NIC
A
L R
E
F
E
RE
N
CE
MA
N
UA
L
6.17.3 Block Diagram
ACMPn_P0
ACMPn_P1
ACMPn_P2
+
_
Band-gap
CRV
(ACMP_VREF[3:0])
ACMP_INT
ACMPn_O (pin)
(ACMP_STATUS[3]/[2])
CMP
ACMPIE
(ACMP_STATUS[5]/[4])
ACMPn_ECAP
(to ECAP)
PWM0
PWM2
PWM4
DLYTRGSEL
(ACMP_CTL[9:8])
High/Low
level
selection
ACMPn_N
PRESET
(ACMPn_CTL[31])
DLYTRGEN
(ACMP_CTL[12])
ACMP_PBRK
(to PWMBRK)
ACMP
Result
Register
ACMPFx
ACMPO
Edge
Detection
(risingm falling,
rising/falling)
Noise
Filter
PCLK
ACMPEN
(ACMPn_CTL[0])
9bit Delay
Counter
ACMP Delay
Trigger Result
Register
DLYTRGOx
(ACMP_STATUS[7]/[6])
DLYTRGIE
(ACMPn_CTL[13])
DLYTRGFn
Edge
Detection
(risingm falling,
rising/falling)
CPPSEL
(ACMPn_CTL[30:28])
CPNSEL
(ACMPn_CTL[25:24])
ACMPn_P3
NFCLKS
(ACMPn_CTL[21:20])
NFDIS
(ACMPn_CTL[23])
POLARITY
(ACMPn_CTL[19])
DLYTRGSOR
(ACMP_CTL[11:10])
DELAY
(ACMP_TRGDLY[8:0])
EDGESEL
(ACMPn_CTL[5:4])
ACMPHYSEN
(ACMPn_CTL[3:2])
ACMP_PHASE
(to PWM Phase Change)
PBRKSEL
(ACMPn_CTL[6])
ACMPEN
(ACMPn_CTL[0])
EDGESEL
(ACMPn_CTL[5:4])
(ACMP_STATUS[5]/[4])
(ACMP_STATUS[1]/[0])
00
01
10
0
1
0
1
PGA_CMP
Figure 6.17-1 Analog Comparator Block Diagram
6.17.4 Basic Configuration
The ACMP pin functions are configured in SYS_GPB_MFP, SYS_GPC_MFP and
SYS_GPD_MFP registers. It is recommended to disable the digital input path of the analog input
pins to avoid the leakage current. The digital input path can be disabled by configuring
PB_DINOFF, PC_DINOFF and PD_DINOFF registers. If a GPIO pin is configured as an ACMP
input pin, this pin should not be set as Push-pull Output mode in the Px_MODE register. Input
mode is the safest configuration. If Open-drain, Output mode or Quasi-bidirectional mode is
selected, do not output 0 on this GPIO pin. The default GPIO output value is 1. The default
PB_MODE, PC_MODE and PD_MODE setting is determined by user configuration. It could be
configured as Input mode or Quasi-bidirectional mode in user configuration.
The ACMP peripheral clocks can be enabled by setting ACMPCKEN (CLK_APBCLK [30]) to 1.