DM163045 Microchip Technology, DM163045 Datasheet - Page 41

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.
Changes from the previous lab include PORTC initialization so that all bits are ‘0’
except for the Least Significant bit (LSb) and the initialization of the LED_Output
variable.
3. Copy/paste the code in Example 3-13 into the Decide() section labeled:
EXAMPLE 3-13:
4. Copy/paste the code in Example 3-14 over the Do_Outputs() code from the
EXAMPLE 3-14:
This code simply assigns the contents of the LED_Output variable to the PORTC
register.
5. Copy/paste the code in Example 3-15 over the main() code from the previous
EXAMPLE 3-15:
Compile the project. There should be no errors.
//Assign the manipulated contents of the
//LED_Output variable to the PORTC register
//First check if LED_Output variable has most significant bit
//set to 1 or if LED_Output variable is all 0's.
//If so, re initialize the LED_Output variable so that the
//least significant bit is set to 1 and all other bits are
//cleared to 0
LED_Output = 0b00000001;
//If neither of these conditions are true, simply shift
//the LED_Output variable's contents to the Left by 1 bit
//position
//ADD DECISION CODE HERE
previous lab.
lab to incorporate the Decide().
PORTC = LED_Output;
if((LED_Output == 0b10000000) || (LED_Output == 0b00000000))
else LED_Output <<=1;
Initialize(); //Initialize the relevant registers
while(1)
{
}
Decide(); //Make any decisions
Do_Outputs(); //Perform any outputs
Timing();//Sets execution rate of the
General Purpose Input/Output Labs
//Software Control Loop
DO_OUTPUTS() CODE FOR LAB 4
MAIN() CODE FOR LAB 4
DECIDE()CODE FOR LAB 4
DS41369A-page 37

Related parts for DM163045