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

PIC16F685-I/SS 参数 Datasheet PDF下载

PIC16F685-I/SS图片预览
型号: PIC16F685-I/SS
PDF下载: 下载PDF文件 查看货源
内容描述: 20引脚基于闪存的8位CMOS微控制器采用纳瓦技术 [20-Pin Flash-Based, 8-Bit CMOS Microcontrollers with nanoWatt Technology]
分类和应用: 闪存微控制器
文件页数/大小: 294 页 / 5272 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC16F685-I/SS的Datasheet PDF文件第94页浏览型号PIC16F685-I/SS的Datasheet PDF文件第95页浏览型号PIC16F685-I/SS的Datasheet PDF文件第96页浏览型号PIC16F685-I/SS的Datasheet PDF文件第97页浏览型号PIC16F685-I/SS的Datasheet PDF文件第99页浏览型号PIC16F685-I/SS的Datasheet PDF文件第100页浏览型号PIC16F685-I/SS的Datasheet PDF文件第101页浏览型号PIC16F685-I/SS的Datasheet PDF文件第102页  
PIC16F631/677/685/687/689/690  
FIGURE 8-4:  
COMPARATOR  
8.4  
Comparator Interrupt Operation  
INTERRUPT TIMING W/O  
CMxCON0 READ  
The comparator interrupt flag can be set whenever  
there is a change in the output value of the comparator.  
Changes are recognized by means of a mismatch  
circuit which consists of two latches and an exclusive-  
or gate (see Figure 8-2 and Figure 8-3). One latch is  
updated with the comparator output level when the  
CMxCON0 register is read. This latch retains the value  
until the next read of the CMxCON0 register or the  
occurrence of a Reset. The other latch of the mismatch  
circuit is updated on every Q1 system clock. A  
mismatch condition will occur when a comparator  
output change is clocked through the second latch on  
the Q1 clock cycle. At this point the two mismatch  
latches have opposite output levels which is detected  
by the exclusive-or gate and fed to the interrupt  
circuitry. The mismatch condition persists until either  
the CMxCON0 register is read or the comparator  
output returns to the previous state.  
Q1  
Q3  
CxIN+  
TRT  
Cxout  
Set CxIF (edge)  
CxIF  
reset by software  
FIGURE 8-5:  
COMPARATOR  
INTERRUPT TIMING WITH  
CMxCON0 READ  
Q1  
Q3  
CxIN+  
TRT  
Note 1: A write operation to the CMxCON0  
register will also clear the mismatch  
condition because all writes include a read  
operation at the beginning of the write  
cycle.  
Cxout  
Set CxIF (edge)  
CxIF  
cleared by CMxCON0 read  
reset by software  
2: Comparator interrupts will operate correctly  
regardless of the state of CxOE.  
The comparator interrupt is set by the mismatch edge  
and not the mismatch level. This means that the inter-  
rupt flag can be reset without the additional step of  
reading or writing the CMxCON0 register to clear the  
mismatch registers. When the mismatch registers are  
cleared, an interrupt will occur upon the comparator’s  
return to the previous state, otherwise no interrupt will  
be generated.  
Note 1: If a change in the CMxCON0 register  
(CxOUT) should occur when a read  
operation is being executed (start of the  
Q2 cycle), then the CxIF of the PIR1  
register interrupt flag may not get set.  
2: When either comparator is first enabled,  
bias circuitry in the Comparator module  
may cause an invalid output from the  
comparator until the bias circuitry is  
stable. Allow about 1 μs for bias settling  
then clear the mismatch condition and  
Software will need to maintain information about the  
status of the comparator output, as read from the  
CMxCON0 register, or CM2CON1 register, to determine  
the actual change that has occurred.  
interrupt  
flags  
before  
enabling  
comparator interrupts.  
The CxIF bit of the PIR1 register is the comparator  
interrupt flag. This bit must be reset in software by  
clearing it to ‘0’. Since it is also possible to write a '1' to  
this register, an interrupt can be generated.  
The CxIE bit of the PIE1 register and the PEIE and GIE  
bits of the INTCON register must all be set to enable  
comparator interrupts. If any of these bits are cleared,  
the interrupt is not enabled, although the CxIF bit of the  
PIR1 register will still be set if an interrupt condition  
occurs.  
DS41262D-page 96  
© 2007 Microchip Technology Inc.  
 复制成功!