stm8s AD多通道采集

上传者: hcr0207 | 上传时间: 2019-12-21 19:51:16 | 文件大小: 312KB | 文件类型: rar
/*************** 深圳市赛亿科技开发有限公司 ******************** * 文件名 : adc * 描述 :多通道AD采集(源文件) * 实验平台 :STM8S105开发板 * 库版本 :V1.0 * 作者 :hcr * QQ :630054913 * 修改时间 :2014-9-20 *******************************************************************************/ #include "adc.h" u16 AdcData_Buff[10]; //AD采集缓存 u16 AdcValue_Channel1; //通道1值 u16 AdcValue_Channel2; //通道2值 u16 AdcValue_Channel3; //通道3值 float Adc_V1; //通道1值电压值 float Adc_V2; //通道2值电压值 float Adc_V3; //通道3值电压值 /************************************************************************** * 函数名:Adc_Task(void) * 描述 :AD不通通道选择 * 输入 :无 * 输出 :无 * 返回 :无 * 调用 :10ms调用 *************************************************************************/ void Adc_Task(void) { static u8 Adc_Channel = 1; static u8 Adc_Timer = 0; static u16 Adc_GetValue; switch(Adc_Channel)//通道选择 { case 1: //通道1 Adc_GetValue = ADC1_GetConversionValue(); //获取ADC转换数 AdcData_Buff[Adc_Timer]=Adc_GetValue; //保存采样值 if(Adc_Timer8) { Adc_Timer = 0; //复位 Temp_Choose(); //冒泡法求中间值 AdcValue_Channel1=AdcData_Buff[5]; //取中间值 Adc_V1 = (3.28*AdcValue_Channel1)/1023; //算出实际电压 AdcData_Clean(); //清除缓存数据 Adc_Channel = 2; //另一通道 AdcChannel_Start(ADC1_CHANNEL_2); //ADC,通道2启动 } break; case 2: //通道2

文件下载

资源详情

[{"title":"( 92 个子文件 312KB ) stm8s AD多通道采集","children":[{"title":"AD多通道","children":[{"title":"Project","children":[{"title":"settings","children":[{"title":"Project.cspy.bat <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false},{"title":"Project.dni <span style='color:#111;'> 1.48KB </span>","children":null,"spread":false},{"title":"Project.wsdt <span style='color:#111;'> 6.29KB </span>","children":null,"spread":false},{"title":"Project.dbgdt <span style='color:#111;'> 8.84KB </span>","children":null,"spread":false}],"spread":true},{"title":"Project.eww <span style='color:#111;'> 161B </span>","children":null,"spread":false},{"title":"FWlib","children":[{"title":"src","children":[{"title":"stm8s_adc1.c <span style='color:#111;'> 22.97KB </span>","children":null,"spread":false},{"title":"stm8s_flash.c <span style='color:#111;'> 25.34KB </span>","children":null,"spread":false},{"title":"stm8s_clk.c <span style='color:#111;'> 21.68KB </span>","children":null,"spread":false},{"title":"stm8s_exti.c <span style='color:#111;'> 5.78KB </span>","children":null,"spread":false},{"title":"stm8s_wwdg.c <span style='color:#111;'> 3.90KB </span>","children":null,"spread":false},{"title":"stm8s_uart2.c <span style='color:#111;'> 28.68KB </span>","children":null,"spread":false},{"title":"stm8s_uart3.c <span style='color:#111;'> 23.72KB </span>","children":null,"spread":false},{"title":"stm8s_adc2.c <span style='color:#111;'> 13.38KB </span>","children":null,"spread":false},{"title":"stm8s_can.c <span style='color:#111;'> 48.36KB </span>","children":null,"spread":false},{"title":"stm8s_spi.c <span style='color:#111;'> 13.80KB </span>","children":null,"spread":false},{"title":"stm8s_itc.c <span style='color:#111;'> 9.80KB </span>","children":null,"spread":false},{"title":"stm8s_uart1.c <span style='color:#111;'> 26.14KB </span>","children":null,"spread":false},{"title":"stm8s_tim5.c <span style='color:#111;'> 49.53KB </span>","children":null,"spread":false},{"title":"stm8s_tim3.c <span style='color:#111;'> 36.61KB </span>","children":null,"spread":false},{"title":"stm8s_iwdg.c <span style='color:#111;'> 3.35KB </span>","children":null,"spread":false},{"title":"stm8s_beep.c <span style='color:#111;'> 4.71KB </span>","children":null,"spread":false},{"title":"stm8s_rst.c <span style='color:#111;'> 2.75KB </span>","children":null,"spread":false},{"title":"stm8s_tim4.c <span style='color:#111;'> 12.02KB </span>","children":null,"spread":false},{"title":"stm8s_i2c.c <span style='color:#111;'> 31.75KB </span>","children":null,"spread":false},{"title":"stm8s_tim2.c <span style='color:#111;'> 45.93KB </span>","children":null,"spread":false},{"title":"stm8s_gpio.c <span style='color:#111;'> 8.22KB </span>","children":null,"spread":false},{"title":"stm8s_awu.c <span style='color:#111;'> 6.21KB </span>","children":null,"spread":false},{"title":"stm8s_tim6.c <span style='color:#111;'> 14.80KB </span>","children":null,"spread":false},{"title":"stm8s_tim1.c <span style='color:#111;'> 84.45KB </span>","children":null,"spread":false}],"spread":false},{"title":"inc","children":[{"title":"stm8s_exti.h <span style='color:#111;'> 4.52KB </span>","children":null,"spread":false},{"title":"stm8s_tim4.h <span style='color:#111;'> 5.17KB </span>","children":null,"spread":false},{"title":"stm8s_clk.h <span style='color:#111;'> 16.57KB </span>","children":null,"spread":false},{"title":"stm8s_i2c.h <span style='color:#111;'> 27.08KB </span>","children":null,"spread":false},{"title":"stm8s_rst.h <span style='color:#111;'> 2.77KB </span>","children":null,"spread":false},{"title":"stm8s_awu.h <span style='color:#111;'> 4.81KB </span>","children":null,"spread":false},{"title":"stm8s_tim5.h <span style='color:#111;'> 19.42KB </span>","children":null,"spread":false},{"title":"stm8s_iwdg.h <span style='color:#111;'> 4.21KB </span>","children":null,"spread":false},{"title":"stm8s_uart2.h <span style='color:#111;'> 18.61KB </span>","children":null,"spread":false},{"title":"stm8s_tim3.h <span style='color:#111;'> 12.61KB </span>","children":null,"spread":false},{"title":"stm8s_tim1.h <span style='color:#111;'> 26.11KB </span>","children":null,"spread":false},{"title":"stm8s_tim2.h <span style='color:#111;'> 13.76KB </span>","children":null,"spread":false},{"title":"stm8s_flash.h <span style='color:#111;'> 13.49KB </span>","children":null,"spread":false},{"title":"stm8s_uart1.h <span style='color:#111;'> 16.14KB </span>","children":null,"spread":false},{"title":"stm8s_adc1.h <span style='color:#111;'> 14.67KB </span>","children":null,"spread":false},{"title":"stm8s.h <span style='color:#111;'> 113.08KB </span>","children":null,"spread":false},{"title":"stm8s_gpio.h <span style='color:#111;'> 6.12KB </span>","children":null,"spread":false},{"title":"stm8s_tim6.h <span style='color:#111;'> 9.30KB </span>","children":null,"spread":false},{"title":"stm8s_beep.h <span style='color:#111;'> 3.41KB </span>","children":null,"spread":false},{"title":"stm8s_wwdg.h <span style='color:#111;'> 2.42KB </span>","children":null,"spread":false},{"title":"stm8s_adc2.h <span style='color:#111;'> 11.20KB </span>","children":null,"spread":false},{"title":"stm8s_itc.h <span style='color:#111;'> 6.61KB </span>","children":null,"spread":false},{"title":"stm8s_spi.h <span style='color:#111;'> 12.76KB </span>","children":null,"spread":false},{"title":"stm8s_can.h <span style='color:#111;'> 24.99KB </span>","children":null,"spread":false},{"title":"stm8s_type.h <span style='color:#111;'> 3.37KB </span>","children":null,"spread":false},{"title":"stm8s_uart3.h <span style='color:#111;'> 14.95KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"Project.ewp <span style='color:#111;'> 42.10KB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"List","children":null,"spread":false},{"title":"Obj","children":[{"title":"led.o <span style='color:#111;'> 14.07KB </span>","children":null,"spread":false},{"title":"adc.o <span style='color:#111;'> 17.51KB </span>","children":null,"spread":false},{"title":"stm8s_gpio.o <span style='color:#111;'> 19.73KB </span>","children":null,"spread":false},{"title":"stm8s_tim1.o <span style='color:#111;'> 134.44KB </span>","children":null,"spread":false},{"title":"time2.o <span style='color:#111;'> 4.22KB </span>","children":null,"spread":false},{"title":"stm8s_clk.o <span style='color:#111;'> 45.78KB </span>","children":null,"spread":false},{"title":"stm8s_it.o <span style='color:#111;'> 6.76KB </span>","children":null,"spread":false},{"title":"Project.pbd <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false},{"title":"sysclock.o <span style='color:#111;'> 7.97KB </span>","children":null,"spread":false},{"title":"stm8s_flash.o <span style='color:#111;'> 38.59KB </span>","children":null,"spread":false},{"title":"stm8s_adc1.o <span style='color:#111;'> 43.37KB </span>","children":null,"spread":false},{"title":"Readme.o <span style='color:#111;'> 1.79KB </span>","children":null,"spread":false},{"title":"stm8s_tim2.o <span style='color:#111;'> 79.45KB </span>","children":null,"spread":false},{"title":"key.o <span style='color:#111;'> 7.45KB </span>","children":null,"spread":false},{"title":"main.o <span style='color:#111;'> 9.92KB </span>","children":null,"spread":false},{"title":"time1.o <span style='color:#111;'> 6.05KB </span>","children":null,"spread":false}],"spread":false},{"title":"Exe","children":[{"title":"project.hex <span style='color:#111;'> 10.08KB </span>","children":null,"spread":false},{"title":"Project.out <span style='color:#111;'> 89.74KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Project.dep <span style='color:#111;'> 13.25KB </span>","children":null,"spread":false},{"title":"USER","children":[{"title":"main.h <span style='color:#111;'> 369B </span>","children":null,"spread":false},{"title":"Readme.c <span style='color:#111;'> 2.60KB </span>","children":null,"spread":false},{"title":"time1.h <span style='color:#111;'> 644B </span>","children":null,"spread":false},{"title":"sysclock.c <span style='color:#111;'> 3.44KB </span>","children":null,"spread":false},{"title":"key.h <span style='color:#111;'> 590B </span>","children":null,"spread":false},{"title":"stm8s_it.c <span style='color:#111;'> 1.96KB </span>","children":null,"spread":false},{"title":"key.c <span style='color:#111;'> 2.24KB </span>","children":null,"spread":false},{"title":"led.h <span style='color:#111;'> 1.16KB </span>","children":null,"spread":false},{"title":"led.c <span style='color:#111;'> 6.75KB </span>","children":null,"spread":false},{"title":"stm8s_conf.h <span style='color:#111;'> 4.48KB </span>","children":null,"spread":false},{"title":"time1.c <span style='color:#111;'> 2.56KB </span>","children":null,"spread":false},{"title":"adc.c <span style='color:#111;'> 7.51KB </span>","children":null,"spread":false},{"title":"stm8s_it.h <span style='color:#111;'> 5.24KB </span>","children":null,"spread":false},{"title":"adc.h <span style='color:#111;'> 775B </span>","children":null,"spread":false},{"title":"main.c <span style='color:#111;'> 2.51KB </span>","children":null,"spread":false},{"title":"sysclock.h <span style='color:#111;'> 1.33KB </span>","children":null,"spread":false}],"spread":false},{"title":"Project.ewd <span style='color:#111;'> 10.72KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}]

评论信息

  • weixin_40601024 :
    不错,可以使用
    2018-03-21
  • weixin_40601024 :
    不错,可以使用
    2018-03-21
  • 冰小柠柠柠 :
    不错,可以使用
    2018-03-21
  • u011071728 :
    有参考价值,感谢
    2018-03-02
  • u011071728 :
    有参考价值,感谢
    2018-03-02
  • Ray______zzZ :
    有参考价值,感谢
    2018-03-02
  • u013069985 :
    xxfxxxfx谢谢分享,还不错
    2018-01-16
  • u013069985 :
    xxfxxxfx谢谢分享,还不错
    2018-01-16
  • wyh5360 :
    xxfxxxfx谢谢分享,还不错
    2018-01-16
  • goodguozhu :
    不错,可以使用
    2017-12-11
  • goodguozhu :
    不错,可以使用
    2017-12-11
  • goodguozhu :
    不错,可以使用
    2017-12-11
  • rootxie124 :
    不错 具有一定的参考价值,谢谢!
    2017-09-09
  • rootxie124 :
    不错 具有一定的参考价值,谢谢!
    2017-09-09
  • rootxie124 :
    不错 具有一定的参考价值,谢谢!
    2017-09-09

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明