DM163045 Microchip Technology, DM163045 Datasheet - Page 92

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 88
TM
EXAMPLE 5-9:
3. Copy/paste the code in Example 5-10 over the Get_Inputs() code from the
Lab Development Board User’s Guide
//Configure Port:
previous lab:
PORTB = 0;
//Disable pin output driver (See TRIS register)
TRISB4 = 1;
// Configure RB4 as analog pin as analog
ANS10 = 1;
//Configure RC0, RC1, RC2 and RC3 as digital output
PORTC = 0;
TRISC0 = 0;
ANS4 = 0;
//Configure Timer0 as follows:
//Select the FOSC/4 internal instruction clock
//as the clock source for TMR0
T0CS = 0;
//Increment TMR0 value on low-to-high transition
//of the FOSC/4
T0SE = 0;
//Assign the prescaler to TMR0
PSA = 1;
//Configure the prescaler to increment TMR0
//at a rate of 1:16
PS0 = 1;
PS1 = 1;
PS2 = 0;
//Configure the ADC module:
//Select ADC conversion clock Frc
ADCS0 = 1;
ADCS1 = 1;
ADCS2 = 1;
//Configure voltage reference using VDD
VCFG = 0;
//Select ADC input channel Pin 13 (RB4/AN10)
CHS0 = 0;
CHS1 = 1;
CHS2 = 0;
CHS3 = 1;
//Select result format left justified
ADFM = 0;
//Turn on ADC module
ADON = 1;
INITIALIZE CODE FOR ADC LAB 2
© 2009 Microchip Technology Inc.

Related parts for DM163045