DM163045 Microchip Technology, DM163045 Datasheet - Page 57

no-image

DM163045

Manufacturer Part Number
DM163045
Description
PICDEM Lab Development Kit (with PICkit 3) General Purpose
Manufacturer
Microchip Technology
Series
PICDEM™r
Type
MCUr
Datasheet

Specifications of DM163045

Contents
Board, PIC kit 3
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
For Use With/related Products
PIC Micro® MCU

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
DM163045
Manufacturer:
MICROCHIP
Quantity:
12 000
© 2009 Microchip Technology Inc.
3. Copy/paste the code in Example 3-25 into the main() over the code from the
EXAMPLE 3-25:
4. The remaining code remains unchanged from the previous lab. Compile the
3.4.5.4
Program the PIC16F690. The application should behave as it did in the previous lab.
Only this time, the change in LED flashing direction should now be more responsive to
push button presses due to the interrupt added.
The solution for this project is located in the
C:\PICDEM_Lab\GPIO_Labs\GPIO_Lab6\solution directory.
3.4.6
3.4.6.1
To configure the peripherals used in this lab, the following registers are used:
1. Interrupt-on-Change PORTA Register: IOCA (Register 4-6 in Section 4 of the
2. Interrupt Control Register: INTCON (Register 2-3 in Section 2 of the PIC16F690
3.4.6.2
This lab adds a different kind of interrupt associated with the General Purpose
Input/Output peripheral called interrupt-on-change. Rather than simply interrupting the
CPU on a single edge transition on the RA2 pin, an interrupt will now occur on any edge
transition. Therefore, when the push button is pressed and/or released, an interrupt will
occur. This lab will use these concepts to shift the flashing LEDs from left-to-right while
the push button is pressed and from right-to-left when the push button is released.
Each PORTA and PORTB pin is individually configurable as an interrupt-on-change
pin. Control bits in the Interrupt-on-Change PORTA register (IOCA) enable or disable
the interrupt function for each pin.
- Configures PORTA associated pins that will generate an interrupt when a
- Enable interrupt functionality on the PIC16F690.
- Enables PORTA/PORTB change interrupts.
- Contains a flag that indicates that a PORTA or PORTB change interrupt has
previous lab to remove the Get_Inputs().
project. There should be no errors.
PIC16F690 Data Sheet).
change in voltage level is detected.
Data Sheet)
occurred.
Initialize(); //Initialize the relevant registers
while(1)
{
}
TESTING THE APPLICATION
Lab 7: Push Button Interrupt-on-Change
NEW REGISTERS USED IN THIS LAB
OVERVIEW
Decide();//Make any decisions
Do_Outputs(); //Perform any outputs
Timing();//Sets execution rate of the
General Purpose Input/Output Labs
MAIN() CODE FOR GPIO LAB 6
//Software Control Loop
DS41369A-page 53

Related parts for DM163045