欢迎访问ic37.com |
会员登录 免费注册
发布采购

PIC18F4580-I/P 参数 Datasheet PDF下载

PIC18F4580-I/P图片预览
型号: PIC18F4580-I/P
PDF下载: 下载PDF文件 查看货源
内容描述: 28 /40/ 44引脚增强型闪存微控制器与ECAN技术, 10位A / D和纳瓦技术 [28/40/44-Pin Enhanced Flash Microcontrollers with ECAN Technology, 10-Bit A/D and nanoWatt Technology]
分类和应用: 闪存微控制器和处理器外围集成电路光电二极管PC时钟
文件页数/大小: 490 页 / 8912 K
品牌: MICROCHIP [ MICROCHIP TECHNOLOGY ]
 浏览型号PIC18F4580-I/P的Datasheet PDF文件第262页浏览型号PIC18F4580-I/P的Datasheet PDF文件第263页浏览型号PIC18F4580-I/P的Datasheet PDF文件第264页浏览型号PIC18F4580-I/P的Datasheet PDF文件第265页浏览型号PIC18F4580-I/P的Datasheet PDF文件第267页浏览型号PIC18F4580-I/P的Datasheet PDF文件第268页浏览型号PIC18F4580-I/P的Datasheet PDF文件第269页浏览型号PIC18F4580-I/P的Datasheet PDF文件第270页  
PIC18F2480/2580/4480/4580
FIGURE 21-3:
COMPARATOR OUTPUT BLOCK DIAGRAM
MULTIPLEX
Port Pins
+
To RE1 or
RE2 Pin
D
Q
Bus
Data
-
CxINV
Read CMCON
EN
D
EN
Reset
Q
CL
From
other
Comparator
Set
CMIF
bit
21.6
Comparator Interrupts
21.7
The comparator interrupt flag is set whenever there is
a change in the output value of either comparator.
Software will need to maintain information about the
status of the output bits, as read from CMCON<7:6>, to
determine the actual change that occurred. The CMIF
bit (PIR2<6>) is the Comparator Interrupt Flag. The
CMIF bit must be reset by clearing it. Since it is also
possible to write a ‘1’ to this register, a simulated
interrupt may be initiated.
Both the CMIE bit (PIE2<6>) and the PEIE bit
(INTCON<6>) must be set to enable the interrupt. In
addition, the GIE bit (INTCON<7>) must also be set. If
any of these bits are clear, the interrupt is not enabled,
though the CMIF bit will still be set if an interrupt
condition occurs.
Note:
If a change in the CMCON register
(C1OUT or C2OUT) should occur when a
read operation is being executed (start of
the Q2 cycle), then the CMIF (PIR
registers) interrupt flag may not get set.
Comparator Operation
During Sleep
When a comparator is active and the device is placed
in Sleep mode, the comparator remains active and the
interrupt is functional if enabled. This interrupt will
wake-up the device from Sleep mode when enabled.
While the comparator is powered up, higher Sleep
currents than shown in the power-down current
specification will occur. Each operational comparator
will consume additional current, as shown in the com-
parator specifications. To minimize power consumption
while in Sleep mode, turn off the comparators
(CM<2:0> =
111)
before entering Sleep. If the device
wakes up from Sleep, the contents of the CMCON
register are not affected.
21.8
Effects of a Reset
The user, in the Interrupt Service Routine, can clear the
interrupt in the following manner:
a)
b)
Any read or write of CMCON will end the
mismatch condition.
Clear flag bit CMIF.
A device Reset forces the CMCON register to its Reset
state, causing the comparator module to be in the Com-
parator Reset mode (CM<2:0> =
000).
This ensures
that all potential inputs are analog inputs. Device
current is minimized when analog inputs are present at
Reset time. The comparators are powered down during
the Reset interval.
A mismatch condition will continue to set flag bit, CMIF.
Reading CMCON will end the mismatch condition and
allow flag bit, CMIF, to be cleared.
DS39637D-page 266
©
2009 Microchip Technology Inc.