• 堂堂疼
    了解作者
  • C/C++
    开发工具
  • 50KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 6
    下载次数
  • 2016-01-19 08:32
    上传日期
12864电压表(ADC例程)+软件滤波
12864ADC.rar
  • 12864电压表(ADC例程)+软件滤波
  • RCS
  • 12864.mp
    3.6KB
  • 12864.dbg
    4.1KB
  • 12864.hex
    8.1KB
  • 12864._c
    12.9KB
  • 12864.cof
    7.8KB
  • 12864.s
    37KB
  • 12864.lk
    10B
  • 12864.prj
    1.1KB
  • 12864.lis
    79.4KB
  • 12864.SRC
    42B
  • 12864.dp2
    68B
  • 12864.lst
    46.1KB
  • 12864.o
    17.8KB
  • 12864.c
    12.8KB
  • 12864.mak
    681B
内容介绍
/******************************************************************************/ * 【版 本】: V1.0 * 【编译环境】: ICCAVR * 【函数功能】: 12864电压值显示 内部2.54基准电压 短路帽选择2.5v * 【晶 振】: 8M * 【芯 片】: ATMEGA16A * 【硬件连接】: J2短路帽拿掉 */ /******************************************************************************/ #include <iom16v.h> #include <macros.h> #define Set_Bit(val, bitn) (val |=(1<<(bitn))) #define Clr_Bit(val, bitn) (val&=~(1<<(bitn))) #define N 15 //12864 void Write_char(unsigned char start, unsigned char ddata); void Send_byte(unsigned char bbyte); void Delaynms(unsigned int di); void Lcd_init(void); void Disp_img(unsigned char const *img); //unsigned char flag; unsigned int value; unsigned char k=0; unsigned int sum_adc[N]={0}; unsigned char num[]= {"0123456789_:.V"}; unsigned char welcome[]={"通道2:"}; unsigned char input[] ={"通道1:"}; /**************************************************************/ const unsigned char logo[]={ /*-- 调入了一幅图像:C:\Documents and Settings\lwd\桌面\AVR程序\AVR_12864_串行\b01.bmp --*/ /*-- 宽度x高度=127x63 --*/ /*-- 宽度不是8的倍数,现调整为:宽度x高度=128x63 --*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0xF3,0xE0,0x0F,0x8F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0xF3,0xF0,0x0F,0x8F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x07,0xF9,0xF0,0x0F,0x9F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x07,0xF9,0xF8,0x1F,0x9F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x07,0xF9,0xF8,0x1F,0x1F,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x0F,0xFC,0xF8,0x1F,0x3F,0x1F,0x80,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFC,0x00, 0x00,0x0F,0xFC,0xFC,0x3F,0x3F,0x1F,0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xE7,0xE1,0xF8,0xFF,0x3C,0x3F,0x00,0x00,0x00,0x00,0x00,0x00, 0x01,0xF8,0x03,0xE3,0xE7,0xE1,0xF9,0xFF,0xFF,0xF7,0x80,0x00,0x00,0x00,0x00,0x00, 0x00,0xF0,0x01,0xE3,0xC7,0xC0,0xF9,0xE0,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x03,0xC0,0x00,0x00,0x80,0x7C,0xFC,0xC0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x01,0xC0,0x00,0x00,0x00,0x7F,0xFC,0xF0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x7F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x27,0xFF,0xB0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x37,0xFF,0x10,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x1C,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x0C,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xDF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x1F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xBF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x01,0xF8,0x3C,0x00,0xCC,0x00,0x00,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x1F,0x6C,0x37,0xF1,0x8C,0x00,0x00,0xE7,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0x60,0x6F,0x37,0xFF,0x80,0x00,0xCF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x1F,0xFE,0x6C,0x36,0x79,0x80,0x00,0xEE,0xF0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0x60,0xEC,0x36,0x71,0x80,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0xEC,0x6C,0x36,0x79,0x80,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x07,0xF8,0x6C,0x37,0xED,0x80,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x1F,0x30,0x6C,0x36,0x6D,0x80,0x00,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0x76,0x6C,0x36,0x61,0x80,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0xDE,0x6C,0x37,0xE1,0x80,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x0F,0x0E,0x6C,0xF6,0x6F,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; /******************************************************************************/ void Lcd_init(void) //初始化LCD { Delaynms(20); //启动等待,等LCM讲入工作状态 Set_Bit(PORTA,0); Write_char(0,0x30); //8 位介面,基本指令集 Delaynms(20); Write_char(0,0x0c); //显示打开,光标关,反白关 Delaynms(20); Write_char(0,0x01); //清屏,将DDRAM的地址计数器归零 Delaynms(20); } /******************************************************************************/ void Write_char(unsigned char start, unsigned char ddata) //写指令或数据 { unsigned char start_data,Hdata,Ldata; if(start==0) start_data=0xf8; //写指令 else start_data=0xfa; //写数据 Hdata=ddata&0xf0; //取高四位 Ldata=(ddata<<4)&0xf0; //取低四位 Send_byte(start_data); //发送起始信号 Delaynms(20); //延时是必须的 Send_byte(Hdata); //发送高四位 Delaynms(20); //延时是必须的 Send_byte(Ldata); //发送低四位 Delaynms(20); //延时是必须的 } /******************************************************************************/ void Send_byte(unsigned char bbyte) //发送一个字节 { unsigned char i,j; for(i=0;i<8;i++) { j=bbyte&0x80; //取出最高位 if(j) Set_Bit(PORTA,1); else Clr_Bit(PORTA,1); Set_Bit(PORTA,2); //Delaynms(1); Clr_Bit(PORTA,2); bbyte<<=1; //左移 } } /***
评论
    相关推荐
    • test3adc.rar
      msp430 adc采样模拟数据后通过蓝牙发送到PC或移动设备
    • isl2613 ADC.rar
      document describing the layout isl2613 ADC
    • ADC_DSP_FILTER_LIB.rar
      ADC Dsp Filter Library
    • adc滤波.zip
      adc采样以后对采样数据进行滤波处理,针对不同的采样情况有不同的滤波类型。
    • ADC.rar
      LPC1768 ADC接口配置,有详细代码和注释,可以直接编译,推荐适应keil
    • ADC122s706.zip
      基于msp430的驱动ADC122s706的代码
    • ADC-PWM.rar
      3 ADC Vin convert in 3 PWM output 15khz set (ptper for varying frequence)
    • adc_filter.zip
      adc采样计算MATLAB Simulink仿真工程,通过S-function模块功能调用C函数实现对ADC进行卡尔曼滤波计算的仿真
    • ADC7124-8.rar
      STM32F103芯片上ADC7124-8芯片的应用驱动代码
    • Proteus7.12.rar
      Proteus7.12完美破解版.rar电路仿真软件很好用可以仿真单片数字模拟电路