DM163045 Microchip Technology, DM163045 Datasheet - Page 86

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 82
TM
EXAMPLE 5-4:
5. Copy/paste the code in Example 5-5 into the Decide() section labeled:
EXAMPLE 5-5:
6. Copy/paste the code in Example 5-6 into the Do_Outputs() section labeled:
EXAMPLE 5-6:
7. Copy/paste the code in Example 5-7 into the main() section labeled:
EXAMPLE 5-7:
8. Compile the project. There should be no errors.
Lab Development Board User’s Guide
//ADD DECIDE CODE HERE
//ADD DO OUTPUTS CODE HERE
//ADD MAIN CODE HERE
//Perform an ADC of potentiometer connected to pin 13
//Wait the required acquisition time
Delay_1mS();
//Start conversion by setting the GO/DONE bit.
GODONE = 1;
//Wait for ADC conversion to complete
//Polling the GO/DONE bit
// 0 = ADC completed
// 1 = ADC in progress
while(GODONE == 1);
//Assign the upper 4 bits of ADRESH to the lower 4 bits
//of LED_Output
LED_Output = ADRESH >> 4; //Shifts the bits in ADRESL 4 bits
//Assign contents of LED_Output to PORTC to light the connected
//LEDs
PORTC = LED_Output;
Initialize(); //Initialize the relevant registers
while(1)
{
}
Get_Inputs();
Decide();
Do_Outputs();
GET_INPUTS() CODE FOR ADC LAB 1
DECIDE() CODE FOR ADC LAB 1
D0_OUTPUTS() CODE FOR ADC LAB 1
MAIN() CODE FOR ADC LAB 1
//to the right
© 2009 Microchip Technology Inc.

Related parts for DM163045