DM164120-2 Microchip Technology, DM164120-2 Datasheet - Page 23

BOARD DEMO PICKIT 2 44PIN

DM164120-2

Manufacturer Part Number
DM164120-2
Description
BOARD DEMO PICKIT 2 44PIN
Manufacturer
Microchip Technology
Type
MCUr
Datasheets

Specifications of DM164120-2

Contents
3 Boards (1 Populated, 2 Bare)
Processor To Be Evaluated
PIC16F
Silicon Manufacturer
Microchip
Kit Contents
PIC16F Device, 2 PCB Boards
Features
Small Surface Mount Prototype Area, Two Bare PCB Boards
Development Tool Type
Hardware - Daughter Card
Rohs Compliant
Yes
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
PIC16F887
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
DM164120-2
Manufacturer:
Microchip Technology
Quantity:
135
© 2007 Microchip Technology Inc.
3.2.4
This lesson shows how to configure the ADC, run a conversion, read the analog voltage
controlled by the potentiometer (RP1) on the board, and display the high order 8 bits
on the display.
The PIC16F887 has an on-board Analog-to-Digital Converter (ADC) with 10 bits of res-
olution on any of 14 channels. The converter can be referenced to the device’s V
an external voltage reference. The 44-pin Demo Board references it to V
by the PICkit 2 Microcontroller Programmer. The answer from the ADC is represented
by a ratio of the voltage to the reference.
Converting the answer from the ADC back to voltage requires solving for V.
Two of the three factors on the right side of the equation are constants and may be cal-
culated in advance. This eliminates the need to actually divide, but still requires fixed
or floating point multiply to solve the equation on the fly.
However, sometimes, such as when reading a sensor, calculating the voltage is only
the first step. There may be additional math to calculate the meaningful data from the
sensor. For example, when reading a thermistor, calculating the voltage is only the first
step on the way to getting the temperature.
There are other means to convert ADC values, including a straight table look-up or a
piece-wise linear interpolation. Each of these represents different speed/memory
trade-offs.
The schematic (Appendix A. “Hardware Schematics”) shows the wiper on the poten-
tiometer is connected to pin RA0 on the PIC16F887.
Here’s the checklist for this lesson:
• Configure PORTA as an analog input, TRISA<0> = 1, ANSEL<0> = 1
• Select justification and V
• Select clock scaling and channel in ADCON0.
ADC = V/V
V = ADC/1023 * V
Lesson 4: Analog-to-Digital
REF
* 1023
REF
REF
44-Pin Demo Board Lessons
source in ADCON1.
DS41296B-page 19
DD
as provided
DD
or

Related parts for DM164120-2