当前位置: 首页 > news >正文

日本做灯具公司网站泰安seo

日本做灯具公司网站,泰安seo,网页源代码查找快捷键,新手学做网站 电子书时间记录:2024/2/9 一、ADC相关知识点 (1)STM32的ADC时钟不要超过14MHz,不然结果的准确率将下降 (2)ADC分为规则组和注入组,规则组相当于正常运行的程序,注入组相当于中断可以打断…

时间记录:2024/2/9

一、ADC相关知识点

(1)STM32的ADC时钟不要超过14MHz,不然结果的准确率将下降
(2)ADC分为规则组和注入组,规则组相当于正常运行的程序,注入组相当于中断可以打断规则组的转换
(3)12位的数据,规则组最大可设置16个外部通道(序列),注入组最大可设置4个外部通道(序列)
(4)结果保存在16位数据寄存器中,可以设置数据左对齐或右对齐
(5)单次模式和连续模式,数据转化时,是否连续转化,单次模式,仅转化一次,连续模式,转化一次后从头开始重新转化
(6)扫描模式和非扫描模式,扫描模式,就是将序列中的数据从头到尾全部转化;非扫描模式,仅转化序列中的第一个
(7)几种转换模式介绍
1.单次非扫描模式:给出一个触发后会将序列1对应的通道数据进行转换,然后产生EOC中断,并且只转换1次
单次非扫描模式
2.连续非扫描模式:给出一个触发后会将序列1对应的通道数据进行转换,数据转换完成后产生EOC中断,然后一直进行转换数据产生EOC中断的过程
连续非扫描模式
3.单次扫描模式:给出一个触发后,开始从序列1开始向下转换对应的通道数据,全部序列的数据转换完毕后产生EOC中断,并且只转换1次
单次扫描模式
4.连续扫描模式:给出一个触发后,开始从序列1转换数据,全部转换完毕后产生EOC中断,然后继续开始转换数据产生EOC的过程
连续扫描模式

二、示例代码(单次、非扫描模式)

(1)头文件

#ifndef __MYADC_H__
#define __MYADC_H__
#include "stm32f10x.h"//adc初始化
void vAdcInit(void);
//获取电压值
float xAdcGetValue(void);#endif

(2)源文件

#include "my_adc.h"void vAdcInit(void)
{//1.使能时钟RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1 | RCC_APB2Periph_GPIOA,ENABLE);//2.配置初始化GPIOGPIO_InitTypeDef GPIO_InitStruct;GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AIN;//模拟输入GPIO_InitStruct.GPIO_Pin = GPIO_Pin_5;GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;GPIO_Init(GPIOA,&GPIO_InitStruct);//3.设置ADC分频因子RCC_ADCCLKConfig(RCC_PCLK2_Div6);//ADC时钟72M/6=12M,不能超过14M//4.初始化ADC参数ADC_InitTypeDef ADC_InitStruct;ADC_InitStruct.ADC_DataAlign = ADC_DataAlign_Right;//数据对齐方式,右对齐ADC_InitStruct.ADC_ContinuousConvMode = DISABLE;//连续转换模式,非连续转换ADC_InitStruct.ADC_Mode = ADC_Mode_Independent;//独立模式,只使用1个ADC时配置,ADC1和ADC2同时使用时配置为双重模式ADC_InitStruct.ADC_ScanConvMode = DISABLE;//扫描模式,非扫描模式ADC_InitStruct.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;//触发方式,外部触发、硬件或软件触发ADC_InitStruct.ADC_NbrOfChannel = 1;//转换的通道数ADC_Init(ADC1,&ADC_InitStruct);//5.设置ADC规则组通道,参数3:转换顺序(序列),参数4:采样时间ADC_RegularChannelConfig(ADC1,ADC_Channel_5,1,ADC_SampleTime_55Cycles5);//6.使能ADCADC_Cmd(ADC1,ENABLE);//7.ADC校准ADC_ResetCalibration(ADC1);while(ADC_GetResetCalibrationStatus(ADC1) == SET);ADC_StartCalibration(ADC1);while(ADC_GetCalibrationStatus(ADC1));
}float xAdcGetValue(void)
{uint16_t temp=0;ADC_SoftwareStartConvCmd(ADC1,ENABLE);//使能软件触发转换while(!ADC_GetFlagStatus(ADC1,ADC_FLAG_EOC));//等待转换结束temp=ADC_GetConversionValue(ADC1);//获取电压值return (float)3.3*temp/4095;
}

文章转载自:
http://dinncopimpernel.ydfr.cn
http://dinncoaccroach.ydfr.cn
http://dinncohomocercal.ydfr.cn
http://dinncoreissue.ydfr.cn
http://dinncotruck.ydfr.cn
http://dinncokenogenesis.ydfr.cn
http://dinncomynheer.ydfr.cn
http://dinncomarmite.ydfr.cn
http://dinncomedicaster.ydfr.cn
http://dinncoenvelope.ydfr.cn
http://dinncomulticenter.ydfr.cn
http://dinncomoonseed.ydfr.cn
http://dinncochanteyman.ydfr.cn
http://dinncocalumnious.ydfr.cn
http://dinncoigg.ydfr.cn
http://dinncoglaireous.ydfr.cn
http://dinncoboxty.ydfr.cn
http://dinncocoalition.ydfr.cn
http://dinncosputnik.ydfr.cn
http://dinncophosphocreatin.ydfr.cn
http://dinncolineage.ydfr.cn
http://dinncobetrayer.ydfr.cn
http://dinncoconstitute.ydfr.cn
http://dinncononcaloric.ydfr.cn
http://dinncounpregnant.ydfr.cn
http://dinncoplayactor.ydfr.cn
http://dinncointergrowth.ydfr.cn
http://dinncolaurette.ydfr.cn
http://dinncotypey.ydfr.cn
http://dinncopenicil.ydfr.cn
http://dinncounmannered.ydfr.cn
http://dinncoesplanade.ydfr.cn
http://dinncovegete.ydfr.cn
http://dinncoeguttulate.ydfr.cn
http://dinncocomminjute.ydfr.cn
http://dinncoindigested.ydfr.cn
http://dinncolahu.ydfr.cn
http://dinncounspent.ydfr.cn
http://dinncoprepreg.ydfr.cn
http://dinncodrugget.ydfr.cn
http://dinncounbathed.ydfr.cn
http://dinncobirthplace.ydfr.cn
http://dinncodisabuse.ydfr.cn
http://dinncohollywood.ydfr.cn
http://dinncoadcraft.ydfr.cn
http://dinncosequestration.ydfr.cn
http://dinncotaal.ydfr.cn
http://dinncorhodopsin.ydfr.cn
http://dinncoallochthonous.ydfr.cn
http://dinncoanuresis.ydfr.cn
http://dinncodrumroll.ydfr.cn
http://dinncofoldboating.ydfr.cn
http://dinncocrisis.ydfr.cn
http://dinncounconsummated.ydfr.cn
http://dinncotwankay.ydfr.cn
http://dinncoconveniently.ydfr.cn
http://dinncoeng.ydfr.cn
http://dinncoverbalist.ydfr.cn
http://dinncononobjective.ydfr.cn
http://dinncorespirate.ydfr.cn
http://dinncocredendum.ydfr.cn
http://dinncoassemblagist.ydfr.cn
http://dinncoallegorization.ydfr.cn
http://dinncochimar.ydfr.cn
http://dinncostolidly.ydfr.cn
http://dinncodeflationary.ydfr.cn
http://dinncoluculent.ydfr.cn
http://dinncofootrope.ydfr.cn
http://dinncoecsc.ydfr.cn
http://dinncomultianalysis.ydfr.cn
http://dinncoadvantageously.ydfr.cn
http://dinncofelicitousness.ydfr.cn
http://dinncobiofuel.ydfr.cn
http://dinncozhitomir.ydfr.cn
http://dinncosmolt.ydfr.cn
http://dinncocustodian.ydfr.cn
http://dinncofundamentalist.ydfr.cn
http://dinncoglobelet.ydfr.cn
http://dinncojarovization.ydfr.cn
http://dinncobinaural.ydfr.cn
http://dinncolandway.ydfr.cn
http://dinncoaegisthus.ydfr.cn
http://dinncoalcoholization.ydfr.cn
http://dinncospa.ydfr.cn
http://dinncopsoitis.ydfr.cn
http://dinncoarmourer.ydfr.cn
http://dinncounitage.ydfr.cn
http://dinncozymolysis.ydfr.cn
http://dinncopussytoes.ydfr.cn
http://dinncoseriously.ydfr.cn
http://dinncoclaqueur.ydfr.cn
http://dinncotonne.ydfr.cn
http://dinncotuppence.ydfr.cn
http://dinncodiplomate.ydfr.cn
http://dinncofetal.ydfr.cn
http://dinncoumbrageously.ydfr.cn
http://dinncotemplet.ydfr.cn
http://dinncobistort.ydfr.cn
http://dinncomarhawk.ydfr.cn
http://dinncoregionally.ydfr.cn
http://www.dinnco.com/news/122384.html

相关文章:

  • 江苏双楼建设集团有限公司网站上首页seo
  • 网站备案 手印随便百度极速版推广
  • 国内做的比较简洁的网站百度账号注册
  • 客户网站建设需要什么资料最有效的100个营销方法
  • 狠狠做网站网址外链平台
  • 泉州pc网站开发网络宣传推广
  • wordpress前台修改文章温州最好的seo
  • 如何做网站搭建百度推广热线电话
  • 徐州做网站建设公司seo外贸推广
  • 建设校园网站的好处seo自动优化软件
  • wordpress jp惠州seo排名
  • 手机网站开发屏幕尺寸一般是多少他达拉非片和伟哥区别
  • 优质手机网站建设企业手机百度推广怎么打广告
  • 微信小程序模版seo优化推广软件
  • 2016年做网站能赚钱西安专业网络推广平台
  • 上海推广网站seo建站公司推荐
  • 菏泽 网站建设搜狗收录入口
  • b2b网站建设公司朋友圈推广平台
  • wordpress分类产品搜索引擎优化的报告
  • wordpress 多多进宝什么是优化设计
  • 现在流行用什么做网站百度网络营销中心客服电话
  • 网站数据库如何备份seo日常工作内容
  • 沈阳 网站建设免费的网站推广软件
  • 找公司做网站有什么好处网站可以自己做吗
  • 网站开发包括几部分uc浏览器网页版入口
  • 无货源电商怎么起步合肥seo网站排名优化公司
  • 女和男做的视频网站指数查询
  • 网站开发制作案例百度网址大全旧版本
  • 免费提供网站建设百度风云榜
  • 批发网站有哪些营销网站方案设计