DM163035 Microchip Technology, DM163035 Datasheet - Page 58

KIT DEVELOPMENT PICDEM LAB

DM163035

Manufacturer Part Number
DM163035
Description
KIT DEVELOPMENT PICDEM LAB
Manufacturer
Microchip Technology
Type
MCUr
Datasheet

Specifications of DM163035

Contents
Board, Cable, Components, CD, PICkit Programmer
Processor To Be Evaluated
PIC10F, PIC12F615, PIC16F616
Data Bus Width
8 bit
Operating Supply Voltage
1.3 V to 5 V
Silicon Manufacturer
Microchip
Core Architecture
PIC
Core Sub-architecture
PIC10, PIC12, PIC16
Silicon Core Number
PIC10F, PIC12F, PIC16F
Silicon Family Name
PIC10F2xx, PIC12F6xx, PIC16F6xx
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
PIC10F206, PIC16F690, PIC16F819
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
PICDEM
DS41369A-page 54
TM
The INTCON register is needed as well to implement the interrupt-on-change feature.
Again the GIE bit needs to be set to enable any interrupts used on the microcontroller.
To configure for an interrupt-on-change, the PORTA/PORTB Change Interrupt Enable
bit (RABIE) must be set along with the individual enable bits in the IOCA register. On
an interrupt-on-change for configured pins, the PORTA/PORTB Change Interrupt Flag
bit (RABIF) will be set. To detect a logic change on a port pin, the firmware needs to
know what has changed. Therefore, PORTA must be read before an
interrupt-on-change can occur. Reading PORTA retains, or latches, the current value
on the RA2 pin for later reference. In the event that the signal on the RA2 pin changes
and a mismatch with the reference value occurs, an interrupt will result.
The main() software flowchart for this lab remains the same as that in Figure 3-24 of
the previous lab. The Interrupt Service Routine changes since it now must determine
whether the interrupt occurred due to a high-to-low or low-to-high transition on pin RA2.
The ISR flowchart is shown in Figure 3-25.
FIGURE 3-25:
Lab Development Board User’s Guide
RABIE and RABIF
Read PORTA
pb_pressISR()
RETURN
bits set
?
PB_PRESSISR FLOWCHART FOR LAB 7
YES
NO
NO
direction = 1
Clear RABIF flag
Delay for 5mS
RA2 pin = 1
RA2 pin = 1
?
?
NO
direction = 1
Delay for 5mS
RA2 pin = 0
RA2 pin = 0
© 2009 Microchip Technology Inc.
?
?
YES
YES
NO

Related parts for DM163035