DM163035 Microchip Technology, DM163035 Datasheet - Page 54

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 50
TM
Referring to the flowchart in Figure 3-24, the PB_PressISR() replaces the
Get_Inputs() used in Lab 4 with a few additions. At the beginning of the ISR, the
INTE and INTF bits are first checked to ensure that the RA2/INT external interrupt is
indeed enabled and that the flag is set indicating that an RA2/INT external interrupt has
occurred. Determining the source of an interrupt becomes especially important if
multiple peripherals are configured to cause an interrupt. The ISR then clears the
RA2/INT external interrupt flag so that subsequent interrupts will be registered. The
ISR then performs the RA2 check along with the debounce routine that was discussed
in the previous lab.
3.4.5.3
Using the firmware developed in the previous lab, make the following changes:
1. Copy/paste the Interrupt Service Routine in Figure 3-23 at the top of the firmware
EXAMPLE 3-23:
Lab Development Board User’s Guide
/*---------------------------------------------------------
-
---------------------------------------------------------*/
void interrupt PB_PressISR(void)
{
}
source file under the section labeled:
/**INTERRUPT CODE***************************************/
Subroutine: Interrupt Service Routine
Parameters: none
Returns:nothing
Synopsis:Execute this code on any interrupt
//Check to see if the interrupt was caused by
//the external interrupt on RA2
//If so, clear the external interrupt flag
//to allow subsequent interrupts to be detected
if(INTE && INTF) INTF = 0;
//Check to see if the RA2 pin is 0
//(i.e. push button pressed)
if(RA2 == 0)
{
}
//If RA2 is not 0, keep direction value
//the same as it was
else direction = direction;
PROCEDURE
//If RA2 is 0 delay for 5mS to filter
//any switch bounce
Delay_5mS();
//Check to see if RA2 is still 0
//If so, toggle the direction bit
if(RA2 == 0) direction ^= 1;
PB_PRESSISR() CODE FOR GPIO LAB 6
© 2009 Microchip Technology Inc.

Related parts for DM163035