DM163045 Microchip Technology, DM163045 Datasheet - Page 61

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.
EXAMPLE 3-27:
//Clear PORTC to a known state
//Set the least significant bit to 1 so that it can be
//shifted through
//Clear the PORTA register to a known state
//Configure PORTC's ANALOG/DIGITAL pins as all Digital
//Configure PORTC pins as all output
//i.e. 1 = Input, 0 = Output
//Configure PORTA bit RA0 as Digital input
//Configure Timer0 to overflow every 5mS
//Select a 1:32 prescaler
//Initialize the direction flag to shift bits from right-to-left
//(i.e. 0 = Shift PORTC bits from right-to-left
//
//Initialize LED_Output to all zeros
//Configure for RA2 Interrupt-On-Change
PORTC = 0b00000001;
PORTA = 0b00000000;
ANS4 = 0;//Associated with RC0
ANS5 = 0;//Associated with RC1
ANS6 = 0;//Associated with RC2
ANS7 = 0;//Associated with RC3
ANS8 = 0;//Associated with RC6
ANS9 = 0;//Associated with RC7
TRISC0 = 0;//Associated with RC0
TRISC1 = 0;//Associated with RC1
TRISC2 = 0;//Associated with RC2
TRISC3 = 0;//Associated with RC3
TRISC4 = 0;//Associated with RC4
TRISC5 = 0;//Associated with RC5
TRISC6 = 0;//Associated with RC6
TRISC7 = 0;//Associated with RC7
ANS2 = 0;
TRISA2 = 1;
T0CS = 0; //Select FOSC/4 as Timer0 clock source
T0SE = 0; //Increment TMR0 on rising clock edge
PSA = 0; //Assign prescaler to Timer0
PS0 = 0;
PS1 = 0;
PS2 = 1;
direction = 0;
LED_Output = 0b00000000;
IOCA2 = 1; //Enable RA2 interrupt-on-change
RABIE = 1; //Enable change interrupts
RABIF = 0; //Clear the change interrupt flag
GIE = 1;//Enable interrupt capability on the
//Read PORTA to latch the current RA2 voltage level
PORTA = PORTA;
1 = Shift PORTC bits from left-to-right
General Purpose Input/Output Labs
//PIC16F690 ***ALWAYS DONE LAST*****
INITIALIZE() CODE FOR GPIO LAB 7
DS41369A-page 57

Related parts for DM163045