PIC16F1939-I/P Microchip Technology Inc., PIC16F1939-I/P Datasheet - Page 149

no-image

PIC16F1939-I/P

Manufacturer Part Number
PIC16F1939-I/P
Description
28KB Flash, 1KB RAM, 256B EEPROM, LCD, 1.8-5.5V
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC16F1939-I/P

A/d Inputs
14-Channel, 10-Bit
Comparators
2
Cpu Speed
8 MIPS
Eeprom Memory
256 Bytes
Input Output
36
Interface
I2C/SPI/UART/USART
Memory Type
Flash
Number Of Bits
8
Package Type
40-pin PDIP
Programmable Memory
28K Bytes
Ram Size
1K Bytes
Speed
32 MHz
Temperature Range
–40 to 125 °C
Timers
4-8-bit, 1-16-bit
Voltage, Range
1.8-5.5 V

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F1939-I/P
Manufacturer:
IR
Quantity:
5 144
Part Number:
PIC16F1939-I/P
Manufacturer:
Microchip Technology
Quantity:
1 852
Part Number:
PIC16F1939-I/PT
Manufacturer:
ON
Quantity:
4 300
Part Number:
PIC16F1939-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC16F1939-I/PT
0
Company:
Part Number:
PIC16F1939-I/PT
Quantity:
2 800
Company:
Part Number:
PIC16F1939-I/PT
Quantity:
1 600
13.0
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
• Rising and falling edge detection
• Individual pin interrupt flags
Figure 13-1 is a block diagram of the IOC module.
13.1
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.
13.2
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.
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.
FIGURE 13-1:
 2009 Microchip Technology Inc.
RBx
INTERRUPT-ON-CHANGE
Enabling the Module
Individual Pin Configuration
IOCBNx
IOCBPx
INTERRUPT-ON-CHANGE BLOCK DIAGRAM
D
CK
D
CK
R
R
Q
Q
Preliminary
Q2 Clock Cycle
individual pin detectors
From all other IOCBFx
13.3
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.
13.4
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.
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.
EXAMPLE 13-1:
13.5
The interrupt-on-change interrupt sequence will wake
the device from Sleep mode, if the IOCIE bit is set.
If an edge is detected while in Sleep mode, the IOCBF
register will be updated prior to the first instruction
executed out of Sleep.
PIC16F193X/LF193X
IOCBFx
ANDWF
MOVLW
XORWF
Interrupt Flags
Clearing Interrupt Flags
Operation in Sleep
0xff
IOCBF, W
IOCBF, F
IOCIE
DS41364D-page 149
IOC Interrupt to
CPU Core

Related parts for PIC16F1939-I/P