资源简介
microchip PIC24F Code Examples
代码片段和文件信息
/*****************************************************************************
* ADC
* Modified for PIC24FJ64GA004 family with PPS.
*****************************************************************************
* FileName: adc.c
* Dependencies: system.h spimpol.c eeprom.c
* Processor: PIC24
* Compiler: MPLAB C30
* linker: MPLAB link30
* Company: Microchip Technology Incorporated
*
* Software License Agreement
*
* The software supplied herewith by Microchip Technology Incorporated
* (the “Company“) is intended and supplied to you the Company‘s
* customer for use solely and exclusively with products manufactured
* by the Company.
*
* The software is owned by the Company and/or its supplier and is
* protected under applicable copyright laws. All rights are reserved.
* Any use in violation of the foregoing restrictions may subject the
* user to criminal sanctions under applicable laws as well as to
* civil liability for the breach of the terms and conditions of this
* license.
*
* THIS SOFTWARE IS PROVIDED IN AN “AS IS“ CONDITION. NO WARRANTIES
* WHETHER EXPRESS IMPLIED OR STATUTORY INCLUDING BUT NOT LIMITED
* TO IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT
* IN ANY CIRCUMSTANCES BE LIABLE FOR SPECIAL INCIDENTAL OR
* CONSEQUENTIAL DAMAGES FOR ANY REASON WHATSOEVER.
*
*
* State machine to sample analog inputs for temperature sensor and potentiometer.
*
* Author Date Comment
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Anton Alkhimenok 10/18/05 ...
* Brant Ivey 3/14/06 Modified for PIC24FJ64GA004 family with PPS.
*****************************************************************************/
#include “system.h“
/*****************************************************************************
* Module Constants Definitions
*****************************************************************************/
//ADC channels numbers
#define ADC_TEMPERATURE ADC_TEMP_CHAN
#define ADC_VOLTAGE ADC_VOLT_CHAN
// Delay after input switching
#define ADC_SWITCH_DELAY 600
// Temperature scale switching period
#define ADC_CELSIUS_DELAY 100
// Number position
#define ADC_POS_NUMBER 6
// Temperature scale sign position
#define ADC_POS_SCALE 11
// Memory sign position
#define ADC_POS_MEM 13
// Reference voltage mV
#define AVCC 3300
/*****************************************************************************
* Arrays: _voltage_str and _temperature_str
*
* Overview: These arrays contains voltage and temperature strings.
*
*****************************************************************************/
char _voltage_str[16] = “Vol = V “;
char _temperature_str[16] = “Tmp = C “;
unsigned
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-01-12 23:35 PIC24F Code Examples
文件 11268 2007-05-09 01:36 PIC24F Code Examples\adc.c
文件 5670 2007-05-09 01:36 PIC24F Code Examples\adc.h
文件 7067 2007-05-09 01:36 PIC24F Code Examples\banner.c
文件 5149 2007-05-09 01:36 PIC24F Code Examples\buttons.c
文件 5185 2007-05-09 01:36 PIC24F Code Examples\buttons.h
文件 1444 2007-05-09 01:36 PIC24F Code Examples\CleanUp.bat
文件 8836 2007-05-09 01:36 PIC24F Code Examples\eeprom.c
文件 13955 2007-05-09 01:36 PIC24F Code Examples\eeprom.h
文件 3277 2007-05-09 01:36 PIC24F Code Examples\iomapping.c
文件 4325 2007-05-09 01:36 PIC24F Code Examples\iomapping.h
文件 4892 2007-05-09 01:36 PIC24F Code Examples\lcd.c
文件 6844 2007-05-09 01:36 PIC24F Code Examples\lcd.h
文件 6619 2007-05-09 01:36 PIC24F Code Examples\PIC24ExplDemo.c
文件 1545 2007-05-09 01:36 PIC24F Code Examples\PIC24ExplDemo.mcp
文件 23552 2007-05-09 01:36 PIC24F Code Examples\PIC24ExplDemo.mcw
文件 47789 2007-05-09 01:36 PIC24F Code Examples\PIC24F Demo for Explorer 16 Board.zip
文件 14909 2007-05-09 01:36 PIC24F Code Examples\rtcc.c
文件 5133 2007-05-09 01:36 PIC24F Code Examples\rtcc.h
文件 6679 2007-05-09 01:36 PIC24F Code Examples\spimpol.c
文件 9637 2007-05-09 01:36 PIC24F Code Examples\spimpol.h
文件 3775 2007-05-09 01:36 PIC24F Code Examples\store.c
文件 2375 2007-05-09 01:36 PIC24F Code Examples\store.h
文件 2759 2007-05-09 01:36 PIC24F Code Examples\system.h
文件 9261 2007-05-09 01:36 PIC24F Code Examples\tbanner.c
文件 2991 2007-05-09 01:36 PIC24F Code Examples\timer.c
文件 2775 2007-05-09 01:36 PIC24F Code Examples\timer.h
文件 5317 2007-05-09 01:36 PIC24F Code Examples\uart2.c
文件 4442 2007-05-09 01:36 PIC24F Code Examples\uart2.h
文件 4066 2007-05-09 01:36 PIC24F Code Examples\vbanner.c
............此处省略3个文件信息
评论
共有 条评论