DM163045 Microchip Technology, DM163045 Datasheet - Page 68

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 64
TM
2. Copy/paste the code in Example 4-2 into the main() section labeled:
EXAMPLE 4-2:
3. Compile the project. There should be no errors.
4.2.4.4
Program the PIC16F690. The LED connected to the C1OUT pin should light when the
voltage present on the C12IN0- pin is less than the 2.5V present on the C1IN+ pin and
turn off when the 2.5V is exceeded.
The solution for this project is located in the
C:\PICDEM_Lab\Comparator_Labs\Comparator_Lab1\solution directory.
4.2.5
4.2.5.1
To configure the peripherals used in this lab, the following registers are used:
1. Voltage Reference Control Register: VRCON (Register 8-5 in Section 8 of the
4.2.5.2
This lab expands on Lab 1 by utilizing the internal Comparator Voltage Reference
(CV
voltage reference that can be used by the Comparator 1 non-inverting reference input
so that external components are not needed such as the resistor voltage divider used
in the previous lab. The CV
• Independent comparator operation
• Two 16-level voltage ranges
• Ratiometric with V
Lab Development Board User’s Guide
- Enables either the Comparator Voltage Reference or the 0.6V constant
- Selects either a High or Low resolution 16-level voltage range.
- Enable a 0.6V reference.
- Uses three bits to configure the reference voltage level.
Note:
Note:
REF
//ADD MAIN CODE HERE
PIC16F690 Data Sheet).
reference as the non-inverting reference input to Comparator C1 or
Comparator C2.
Initialize(); //Initialize the relevant registers
while(1);
) feature on the PIC16F690. The CV
TESTING THE APPLICATION
Lab 2: Using the Comparator Voltage Reference
NEW REGISTERS USED IN THIS LAB
OVERVIEW
The inclusion of the while loop forces the microcontroller to sit and wait at
a “known” instruction. At start-up, the contents of the program memory are
unknown. Without the while loop, the microcontroller will continue to run
through each address in program memory executing whatever resides at a
particular address. This could have adverse effects on the application.
This application uses two pins that are used during the programming pro-
cess (ICSPDATA and ICSPCLK). The jumper wires connecting these pins
to the application circuit may need to be disconnected while programming
if there are problems with the MPLAB IDE connecting to the PIC16F690.
DD
MAIN() CODE FOR COMPARATOR LAB 1
REF
features:
REF
provides an internally generated
© 2009 Microchip Technology Inc.

Related parts for DM163045