参数资料
型号: DV164101
厂商: Microchip Technology
文件页数: 61/76页
文件大小: 0K
描述: KIT DEV PICKIT1 FLASH 8/14PIN
产品培训模块: Asynchronous Stimulus
标准包装: 1
系列: PICkit™ 1
类型: MCU
适用于相关产品: Microchip 8-14 引脚闪存微控制器
所含物品: PIC 套件 1 电路板、光盘、USB 接口缆线和手册
产品目录页面: 659 (CN2011-ZH PDF)
配用: AC164122-ND - BOARD DAUGHT PICTAIL SD/MMC CARD
AC164120-ND - BOARD SIGNAL ANALYSIS PICKIT
其它名称: DV164101R
DV164101R-ND
C.6
LESSON 4 – ANALOG-TO-DIGITAL CONVERTERS AND COMPARATORS
This lesson is broken up into two programs which demonstrate how to use the
analog-to-digital converter, the comparator and the internal voltage reference. The first
program set is comp.asm (written in assembly) and comp.c (written in C). This program
shows the very basic implementation of using the comparator with the internal voltage
reference. The second program set is atod.asm (written in assembly) and atod.c
(written in C). This program uses the LED display library to show the value of the
analog-to-digital (A-D) converter.
C.6.1
Comparator Lesson
For this lesson, the comparator is configured as a dedicated comparator driving the
GP2 pin directly. With <CM2:CM0> = 101, the comparator has multiplexed inputs.
GP0/CIN+ is selected as the input to the V IN - by setting CIS = 1, thus making the analog
potentiometer the one input. The internal voltage reference is used as the other input
to the comparator on V IN +. The module compares the potentiometer voltage with the
reference, and the logic is setup (CINV = 1) such that the output is high when the input
voltage is higher than the reference. LED3 is driven directly by the comparator and is
lit when the output of the module is high. To light D3, you must configure RA4 (GPIO4)
and RA2 (GPIO2) as digital outputs via the TRIS register, RA4 is set low and RA2 is
driven directly by the comparator without additional software overhead. The remaining
I/O's are configured as high impedance inputs.
Note:
The schematics, as shown in Appendix A, display the 14-pin device pinout.
This is compatible with 8-pin devices.
The internal voltage reference is essentially a variable resistor based voltage divider
between V DD and V SS . Use the low range mode (VRR = 1) and set the internal
reference to be 0.5 V DD by selecting <VR3:VR0> = 1100, thus C VREF = V DD *(12/24).
By stepping through the different voltage reference settings, a basic-low resolution
analog-to-digital converter can be implemented.
The comparator module has seven different modes. Three of the modes can drive an
output pin directly. The software can monitor the output directly or create an interrupt
on change. Bits CMIE and PEIE must be set to enable the comparator interrupt which
can be used to wake the device from SLEEP.
Figure C-11 shows the project setup for the assembly and C projects.
FIGURE C-11:
? 2004 Microchip Technology Inc.
ASSEMBLY AND C PROJECT SETUP
DS40051D-page 57
相关PDF资料
PDF描述
DV164120 KIT STARTER PICKIT 2
DV164121 KIT PICKIT 2 DEBUG EXPRESS
DV164122 ANALYZER SRL PICKIT W/DEMO BOARD
DV164131 KIT STARTER PICKIT 3
DV164132 KIT EVAL F1 FOR PIC12F1/PIC16F1
相关代理商/技术参数
参数描述
DV164101 制造商:Microchip Technology Inc 功能描述:TOOLS: FLASH MICROCONTROLLER (
DV164102 功能描述:开发板和工具包 - 无线 rfPICkit RoHS:否 制造商:Arduino 产品:Evaluation Boards 工具用于评估:AT32UC3L 核心:AVR32 频率: 接口类型:USB 工作电源电压:5 V
DV164120 功能描述:电路内置调试器 PICkit 2 8/14/20P Flash RoHS:否 制造商:Microchip Technology 产品:In-Circuit Debugger Kits 工具用于评估:PIC MCUs, dsPIC DSCs 用于:07-00024, AC164113 核心:dsPIC, PIC 接口类型:USB 工作电源电压:3 V to 5 V
DV164121 功能描述:电路内置调试器 PICkit 2 Debug Express RoHS:否 制造商:Microchip Technology 产品:In-Circuit Debugger Kits 工具用于评估:PIC MCUs, dsPIC DSCs 用于:07-00024, AC164113 核心:dsPIC, PIC 接口类型:USB 工作电源电压:3 V to 5 V
DV164121 制造商:Microchip Technology Inc 功能描述:ICPICKIT2 PROGRAMMER/DEBUGGER ((NW))