DM163045 Microchip Technology, DM163045 Datasheet - Page 71

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 4-3:
2. The main() stays the same as the previous lab.
3. Compile the project. There should be no errors.
4.2.5.4
Program the PIC16F690. The application should behave exactly as it did in the
previous lab with the exception of less components used.
The solution for this project is located in the
C:\PICDEM_Lab\Comparator_Labs\Comparator_Lab2\solution directory.
//Intialize Comparator 1 as follows:
//Turn comparator 1 on
C1ON = 1;
//Make the comparator output available on the
//C1OUT pin
C1OE = 1;
//Select the internal voltage reference
//as the non-inverting reference voltage
C1R = 1;
//Select the C12IN0- pin as the inverting reference
C1CH0 = 0;
C1CH1 = 0;
//Initialize the internal voltage reference as follows:
//Turn on the CVref output and route to the C1Vref input
//of comparator 1
C1VREN =
//Use the comparator voltage low range feature
VRR = 1;
//Set the comparator voltage reference value selection
//to 2.5V by making the VR<3:0> bits equal to 12 or
//binary 1100 (see lab manual for equations)
VR0 = 0;
VR1 = 0;
VR2 = 1;
VR3 = 1;
//Since the comparator 1 output shares the same pin
//as PORTA bit 2, configure the corresponding TRISA2 bit
//as an output
TRISA2 = 0;
TESTING THE APPLICATION
1;
INITIALIZE CODE FOR COMPARATOR LAB 2
Comparator Peripheral Labs
DS41369A-page 67

Related parts for DM163045