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

PIC16LF1947-E/MR 参数 Datasheet PDF下载

PIC16LF1947-E/MR图片预览
型号: PIC16LF1947-E/MR
PDF下载: 下载PDF文件 查看货源
内容描述: [64-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt XLP Technology]
分类和应用: 微控制器
文件页数/大小: 440 页 / 4740 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第145页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第146页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第147页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第148页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第150页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第151页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第152页浏览型号PIC16LF1947-E/MR的Datasheet PDF文件第153页  
PIC16F/LF1946/47  
13.3 Interrupt Flags  
13.0 INTERRUPT-ON-CHANGE  
The IOCBFx bits located in the IOCBF register are  
status flags that correspond to the Interrupt-on-change  
pins of PORTB. If an expected edge is detected on an  
appropriately enabled pin, then the status flag for that pin  
will be set, and an interrupt will be generated if the IOCIE  
bit is set. The IOCIF bit of the INTCON register reflects  
the status of all IOCBFx bits.  
The PORTB pins can be configured to operate as  
Interrupt-On-Change (IOC) pins. An interrupt can be  
generated by detecting a signal that has either a rising  
edge or a falling edge. Any individual PORTB pin, or  
combination of PORTB pins, can be configured to  
generate an interrupt. The interrupt-on-change module  
has the following features:  
• Interrupt-on-Change enable (Master Switch)  
• Individual pin configuration  
13.4 Clearing Interrupt Flags  
• Rising and falling edge detection  
• Individual pin interrupt flags  
The individual status flags, (IOCBFx bits), can be  
cleared by resetting them to zero. If another edge is  
detected during this clearing operation, the associated  
status flag will be set at the end of the sequence,  
regardless of the value actually being written.  
Figure 13-1 is a block diagram of the IOC module.  
13.1 Enabling the Module  
In order to ensure that no detected edge is lost while  
clearing flags, only AND operations masking out known  
changed bits should be performed. The following  
sequence is an example of what should be performed.  
To allow individual PORTB pins to generate an interrupt,  
the IOCIE bit of the INTCON register must be set. If the  
IOCIE bit is disabled, the edge detection on the pin will  
still occur, but an interrupt will not be generated.  
EXAMPLE 13-1:  
13.2 Individual Pin Configuration  
MOVLW 0xff  
XORWF IOCBF, W  
ANDWF IOCBF, F  
For each PORTB pin, a rising edge detector and a falling  
edge detector are present. To enable a pin to detect a  
rising edge, the associated IOCBPx bit of the IOCBP  
register is set. To enable a pin to detect a falling edge,  
the associated IOCBNx bit of the IOCBN register is set.  
13.5 Operation in Sleep  
The interrupt-on-change interrupt sequence will wake  
the device from Sleep mode, if the IOCIE bit is set.  
A pin can be configured to detect rising and falling  
edges simultaneously by setting both the IOCBPx bit  
and the IOCBNx bit of the IOCBP and IOCBN registers,  
respectively.  
If an edge is detected while in Sleep mode, the IOCBF  
register will be updated prior to the first instruction  
executed out of Sleep.  
FIGURE 13-1:  
INTERRUPT-ON-CHANGE BLOCK DIAGRAM  
IOCIE  
IOCBFx  
IOCBNx  
D
Q
From all other IOCBFx  
individual pin detectors  
CK  
R
IOC Interrupt to  
CPU Core  
RBx  
IOCBPx  
D
Q
CK  
R
Q2 Clock Cycle  
2010 Microchip Technology Inc.  
Preliminary  
DS41414A-page 147  
 复制成功!