资源简介
自己用tmsf2812做的超声波流量计,帮一个本科生做的,编译通过

代码片段和文件信息
//###########################################################################
//
// FILE: DSP281x_Adc.c
//
// title: DSP281x ADC Initialization & convert Functions.
//
//###########################################################################
//
// Ver | dd mmm yyyy | Who | Description of changes
// =====|=============|======|===============================================
// 1.00| 11 Sep 2003 | WILLBUR | Changes since previous version (v.58 Alpha)
// | | | ADC_usDELAY changed from 5000L to 8000L
//###########################################################################
#include “DSP281x_Device.h“ // DSP281x Headerfile Include File
#define ADC_usDELAY 8000L
#define ADC_usDELAY2 20L
void DELAY_US();
interrupt void adc_isr(void);
Uint16 LoopCount;
Uint16 ConversionCount;
Uint16 Voltage1[1024];
Uint16 Voltage2[1024];
//---------------------------------------------------------------------------
// InitAdc:
//---------------------------------------------------------------------------
// This function initializes ADC to a known state.
//
void InitAdc(void)
{
extern void DSP28x_usDelay(Uint32 Count);
// To powerup the ADC the ADCENCLK bit should be set first to enable
// clocks followed by powering up the bandgap and reference circuitry.
// After a 5ms delay the rest of the ADC can be powered up. After ADC
// powerup another 20us delay is required before performing the first
// ADC conversion. Please note that for the delay function below to
// operate correctly the CPU_CLOCK_SPEED define statement in the
// DSP28_Examples.h file must contain the correct CPU clock period in
// nanoseconds. For example:
AdcRegs.ADCTRL3.bit.ADCCLKPS=2;
AdcRegs.ADCTRL1.bit.CPS=1;
AdcRegs.ADCTRL1.bit.ACQ_PS=15;
//以上设置本程序的始终选择,参考Pag41(第四章 相关法超声波流量计的软件设计)
AdcRegs.ADCTRL3.all=0x100; //配置AMREFP/ADCREFM为输入引脚(0X80H)
asm(“ RPT #10 || NOP“); //等待外部参考使能
AdcRegs.ADCTRL3.bit.ADCBGRFDN = 0x3; // Power up bandgap/reference circuitry
//(带间隙参考电路上电)
DELAY_US(ADC_usDELAY); // Delay before powering up rest of ADC
AdcRegs.ADCTRL3.bit.ADCPWDN = 1; // Power up rest of ADC(其他电路上电)
DELAY_US(ADC_usDELAY2); // Delay after powering up ADC
}
//---------------------------------------------------------------------------
// DELAY_US;
//---------------------------------------------------------------------------
// This function realize delay time
void DELAY_US(Uint16 time)
{int ij;
for(i=time;i>0;i--)
for(j=0xff;j>0;j--);
}
//---------------------------------------------------------------------------
// Adc_Conv:
//---------------------------------------------------------------------------
// This function realize ADC convertion.
void Adc_Conv(void)
{
InitAdc();
InitPieVectTable();
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2657 2011-07-19 14:28 2812flowmeter-7\cc_build_Debug.log
文件 25665 2011-07-19 19:54 2812flowmeter-7\Debug\2812_Adc.obj
文件 4752 2011-07-19 14:27 2812flowmeter-7\Debug\2812_DataProcess.obj
文件 7091 2011-07-19 14:27 2812flowmeter-7\Debug\2812_fft-ifft-1024.obj
文件 5790 2011-07-19 14:01 2812flowmeter-7\Debug\2812_fft_1024_2.obj
文件 36197 2011-07-19 14:27 2812flowmeter-7\Debug\2812_Keyboard_Led.obj
文件 27110 2011-07-19 14:27 2812flowmeter-7\Debug\2812_Rs232.obj
文件 1381 2011-07-19 14:28 2812flowmeter-7\Debug\DSP281x_CodeStartBranch.obj
文件 37039 2011-07-19 14:28 2812flowmeter-7\Debug\DSP281x_DefaultIsr.obj
文件 117665 2011-07-19 14:28 2812flowmeter-7\Debug\DSP281x_GlobalVariableDefs.obj
文件 10303 2011-07-19 14:28 2812flowmeter-7\Debug\DSP281x_Gpio.obj
文件 2430 2011-07-19 14:28 2812flowmeter-7\Debug\DSP281x_MemCopy.obj
文件 5338 2011-07-19 14:28 2812flowmeter-7\Debug\DSP281x_PieCtrl.obj
文件 16480 2011-07-19 14:28 2812flowmeter-7\Debug\DSP281x_PieVect.obj
文件 11613 2011-07-19 14:28 2812flowmeter-7\Debug\DSP281x_SysCtrl.obj
文件 9620 2011-07-19 14:28 2812flowmeter-7\Debug\main.obj
文件 21731 2011-07-19 14:28 2812flowmeter-7\Debug\test.map
文件 176093 2011-07-19 14:28 2812flowmeter-7\Debug\test.out
文件 181 2011-07-19 19:54 2812flowmeter-7\Debug.lkf
文件 5730 2011-07-07 20:59 2812flowmeter-7\source\2812_Adc.c
文件 2078 2011-07-19 14:18 2812flowmeter-7\source\2812_DataProcess.c
文件 1579 2011-07-19 09:22 2812flowmeter-7\source\2812_fft-ifft-1024.c
文件 929 2011-07-19 11:33 2812flowmeter-7\source\2812_fft_1024_2.c
文件 6218 2011-07-07 19:54 2812flowmeter-7\source\2812_Keyboard_Led.c
文件 5693 2011-07-19 09:11 2812flowmeter-7\source\2812_Rs232.c
文件 8489 2009-08-04 09:30 2812flowmeter-7\source\DSP281x_Adc.h
文件 1710 2011-06-10 10:55 2812flowmeter-7\source\DSP281x_CodeStartBranch.asm
文件 5476 2009-08-04 09:30 2812flowmeter-7\source\DSP281x_CpuTimers.h
文件 25423 2011-06-10 10:59 2812flowmeter-7\source\DSP281x_DefaultIsr.c
文件 4680 2011-06-10 10:07 2812flowmeter-7\source\DSP281x_DefaultIsr.h
............此处省略42个文件信息
相关资源
- STM32f103超声波模块例程
- dsp2812上128点FFTc程序以及其CMD文件
- 基于DSP2812的以太网调试程序
- TMS320F2812_FLASH读写实例
- 合众达培训F2812教材.rar
- 用于无线传感器网络应用的超声波传
- 旋转活塞式流量计的测量原理
- 循迹小车51程序(超声波 颜色识别 舵
- 基于51单片机的超声波测距技术实现含
- 51单片机智能小车花式,寻迹,红外,
- 脉冲流量计
- 基于M-BUS的电磁式明渠流量计的设计
- 基于M-BUS的矿用超声波明渠流量计设计
- 超声波遥控开关电路图
- 基于51单片机超声波测距毕业设计
- 艾锐达电能流量计使用啊.zip
- STM32F103RCT6 TIME4 TIME5 同时捕获六路
- HC-SR04超声波模块(包含基于51stm32配套
- 原理图+PCB+源代码+说明文档 TMS320F28
- STM32f103C8t6型单片机用于超声波测距
- 超声波车速测量系统设计
- 基于单片机控制和超声波传感器的液
- 基于超声波定位的跟随小车
- TMS320F2812手册
- 基于STM32VET6的身高体重肺活量测量系
- 超声波传感器全套资料
- 超声波雾化器专用IC
- stm32-超声波避障程序案例
- MSP432蓝牙控制小车并进行超声波测距
- stm32f103超声波传感器hcsr04控制模板
评论
共有 条评论