DM163045 Microchip Technology, DM163045 Datasheet - Page 40

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
PICDEM
DS41369A-page 36
TM
3.3.7.2
1. The LED_Output variable will need to be declared before it can be used.
EXAMPLE 3-11:
2. Copy/paste the code in Example 3-12 over the Initialize() code from the
EXAMPLE 3-12:
Lab Development Board User’s Guide
Using the code developed in the previous lab, make the following changes:
unsigned char LED_Output;//Variable used to set/clear PORTC bits
Copy/paste the code in Example 3-11 to the beginning of the source file under
the section marked:
//-----------------DATA MEMORY------------------------
previous lab.
//Clear PORTC to a known state
PORTC = 0b00000001;
//Configure PORTC's ANALOG/DIGITAL pins as all Digital
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
//Configure PORTC pins as all output
//i.e. 1 = Input, 0 = Output
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
//Configure Timer0 as follows:
T0CS = 0; //Use the internal instruction clock
T0SE = 0;//Increment TMR0 on low-to-high
PSA = 0;//Assign the prescaler to
//Configure Timer0 prescaler to increment
//TMR0 every 256 FOSC/4 clock transitions
PS0 = 1;
PS1 = 1;
PS2 = 1;
//Initialize LED_Output to all zeros
LED_Output = 0b00000000;
PROCEDURE
//FOSC/4 as the clock source
//FOSC/4 transition
//Timer0
LED_OUTPUT VARIABLE DECLARATION FOR LAB 4
INITIALIZE() CODE FOR LAB 4
© 2009 Microchip Technology Inc.

Related parts for DM163045