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

广西建设工程质量安全监督网站seo关键字怎么优化

广西建设工程质量安全监督网站,seo关键字怎么优化,建设银行教育网站,sae wordpress 图片插件芯片内部温度传感器前言一、什么是内部温度传感器?二、实验过程1.STM32CubeMX配置2.代码实现3.实验结果总结前言 本章介绍STM32芯片温度传感器的使用方法和获取方法。 一、什么是内部温度传感器? STM32 有一个内部的温度传感器,可以用来测…

芯片内部温度传感器

  • 前言
  • 一、什么是内部温度传感器?
  • 二、实验过程
    • 1.STM32CubeMX配置
    • 2.代码实现
    • 3.实验结果
  • 总结


前言

本章介绍STM32芯片温度传感器的使用方法和获取方法。

一、什么是内部温度传感器?

STM32 有一个内部的温度传感器,可以用来测量 CPU 及周围的温度( 内部温度传感器更适合于检测温度的变化,需要测量精确温度的情况下,应使用外置传感器 )。对于 STM32F103来说,该温度传感器在内部和 ADC1_IN16 输入通道相连接,此通道把传感器输出的电压转换
成数字值。温度传感器模拟输入推荐采样时间是 17.1us。STM32F103 内部温度传感器支持的温度范围为:-40~125 度。精度为±1.5℃左右。STM32 内部温度传感器的使用很简单,只要设置一下内部 ADC,并激活其内部温度传感器通道就差不多了。关于 ADC 的设置,我们在上一章已经进行了详细的介绍,这里就不再多说。接下来我们介绍一下和温度传感器设置相关的两个地方。第一个地方,我们要使STM32 的内部温度传感器,必须先激活 ADC 的内部通道,这里通过 ADC_CR2 的 AWDEN 位(bit23)设置。设置该位为 1 则启用内部温度传感器。第二个地方,STM32 的内部温度传感器固定的连接在 ADC1 的通道 16 上,所以,我们在设置好 ADC1 之后只要读取通道 16 的值,就是温度传感器返回来的电压值了。根据这个值,我们就可以计算出当前温度。计算公式如下:
𝑈(℃) ={ (V25-Vsense) / Avg_Slope}+25
式子中:
V25 = Vsense 在 25 度时的数值(典型值为:1.43)
Avg_Slope = 温度与 Vsense 曲线的平均斜率(单位:mv/℃或 uv/℃)(典型值:4.3mv/℃)。
利用以上公式,我们就可以方便的计算出当前温度传感器的温度了。

从下面ADC通道列表中可以看到,ADC1的16通道连接内部的温度传感器
在这里插入图片描述

二、实验过程

1.STM32CubeMX配置

选择芯片stm32f103c6t6,新建工程

在这里插入图片描述

设置时钟源,最小系统外部晶振8Mhz,作为外部高速HSE时钟源。由于没有外接外部低速晶振,这里低速时钟源选择旁路时钟源。

在这里插入图片描述

配置时钟树,这里使用官方推荐的配置

在这里插入图片描述
为了展示内部温度的变化,我们配置USART1,打印获取温度的结果
在这里插入图片描述
USART1的参数配置如下,波特率115200,传输数据长度为8 Bit,奇偶检验无,停止位1.其他参数默认
在这里插入图片描述
配置ADC,激活ADC1温度传感器通道,设置右对齐,关闭扫描、连续及间断模式,使能regular conversion,设置软件触发、设置采样时间239.5个周期(19.96us)
在这里插入图片描述
Code Generator中设置只拷贝使用到的库,分离.c和.h文件

在这里插入图片描述

设置好项目名称和路径,点击GENERATE CODE即可,生成后使用keil5 IDE打开。

在这里插入图片描述

2.代码实现

在usart.c文件后面添加如下代码,代码中添加了#ifdef宏定义进行条件编译,如果使用GUNC编译,则PUTCHAR_PROTOTYPE 定义为int __io_putchar(int ch)函数,否则定义为int fputc(int ch, FILE *f)函数。

/* USER CODE BEGIN 0 */
#include "stdio.h"
#ifdef __GNUC__/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printfset to 'Yes') calls __io_putchar() */#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif /* __GNUC__ */
/*** @brief  Retargets the C library printf function to the USART.* @param  None* @retval None*/
PUTCHAR_PROTOTYPE
{/* Place your implementation of fputc here *//* e.g. write a character to the EVAL_COM1 and Loop until the end of transmission */HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xFFFF);return ch;
}
/* USER CODE END 0 */

main函数如下:

int main(void)
{/* USER CODE BEGIN 1 *//* USER CODE END 1 *//* MCU Configuration--------------------------------------------------------*//* Reset of all peripherals, Initializes the Flash interface and the Systick. */HAL_Init();/* USER CODE BEGIN Init *//* USER CODE END Init *//* Configure the system clock */SystemClock_Config();/* USER CODE BEGIN SysInit *//* USER CODE END SysInit *//* Initialize all configured peripherals */MX_GPIO_Init();MX_ADC1_Init();MX_USART1_UART_Init();/* USER CODE BEGIN 2 */HAL_ADC_Start(&hadc1);	HAL_ADC_PollForConversion(&hadc1,10);	/* USER CODE END 2 *//* Infinite loop *//* USER CODE BEGIN WHILE */while (1){/* USER CODE END WHILE *//* USER CODE BEGIN 3 */float AD_Value = HAL_ADC_GetValue(&hadc1);float Vol_Value = AD_Value*(3.3/4096);	float Temperature = (1.43 - Vol_Value)/0.0043 + 25;	printf("MCU Internal Temperature: %.2f¡æ\r\n",Temperature);printf("\r\n");HAL_Delay(1000);}/* USER CODE END 3 */
}

3.实验结果

可以看到打印的实验结果如下
在这里插入图片描述

总结

以上介绍了STM32芯片温度传感器的使用方法和获取方法,代码都在群里,大家一起学习。


文章转载自:
http://tetrarchy.fcxt.cn
http://nothofagus.fcxt.cn
http://handjob.fcxt.cn
http://idempotency.fcxt.cn
http://apomixis.fcxt.cn
http://mhs.fcxt.cn
http://infinity.fcxt.cn
http://hog.fcxt.cn
http://ascaris.fcxt.cn
http://fishworm.fcxt.cn
http://tsunami.fcxt.cn
http://lectotype.fcxt.cn
http://impenitency.fcxt.cn
http://ringlike.fcxt.cn
http://chronicle.fcxt.cn
http://faradize.fcxt.cn
http://mountainside.fcxt.cn
http://resistibility.fcxt.cn
http://assignments.fcxt.cn
http://hairologist.fcxt.cn
http://vasostimulant.fcxt.cn
http://stank.fcxt.cn
http://cyke.fcxt.cn
http://belial.fcxt.cn
http://noncommissioned.fcxt.cn
http://fluctuate.fcxt.cn
http://patois.fcxt.cn
http://disillusionary.fcxt.cn
http://venae.fcxt.cn
http://henhearted.fcxt.cn
http://brassfounding.fcxt.cn
http://bossism.fcxt.cn
http://kikongo.fcxt.cn
http://travelled.fcxt.cn
http://quoteworthy.fcxt.cn
http://hematophyte.fcxt.cn
http://rynd.fcxt.cn
http://grievant.fcxt.cn
http://micronucleus.fcxt.cn
http://acquired.fcxt.cn
http://forewarn.fcxt.cn
http://melinda.fcxt.cn
http://chalcophanite.fcxt.cn
http://tremulous.fcxt.cn
http://rotiferous.fcxt.cn
http://cupbearer.fcxt.cn
http://chicly.fcxt.cn
http://uplift.fcxt.cn
http://loafer.fcxt.cn
http://inspectorate.fcxt.cn
http://abiding.fcxt.cn
http://transfusional.fcxt.cn
http://silence.fcxt.cn
http://chabouk.fcxt.cn
http://cofferdam.fcxt.cn
http://undoubtedly.fcxt.cn
http://gourmet.fcxt.cn
http://optional.fcxt.cn
http://refraction.fcxt.cn
http://humanics.fcxt.cn
http://bernadine.fcxt.cn
http://plaid.fcxt.cn
http://amphipod.fcxt.cn
http://fungitoxicity.fcxt.cn
http://fenestra.fcxt.cn
http://sandy.fcxt.cn
http://breed.fcxt.cn
http://lupercal.fcxt.cn
http://dedal.fcxt.cn
http://cdnc.fcxt.cn
http://dogmatise.fcxt.cn
http://sublanguage.fcxt.cn
http://fense.fcxt.cn
http://eugenics.fcxt.cn
http://siccative.fcxt.cn
http://ungovernable.fcxt.cn
http://sugi.fcxt.cn
http://calenture.fcxt.cn
http://whit.fcxt.cn
http://feverish.fcxt.cn
http://kayser.fcxt.cn
http://ardour.fcxt.cn
http://considerable.fcxt.cn
http://elisabeth.fcxt.cn
http://frug.fcxt.cn
http://riflescope.fcxt.cn
http://aerosiderolite.fcxt.cn
http://solarometer.fcxt.cn
http://amorite.fcxt.cn
http://cavatina.fcxt.cn
http://hydrics.fcxt.cn
http://manes.fcxt.cn
http://salicylate.fcxt.cn
http://hyperaesthesia.fcxt.cn
http://piezomagnetism.fcxt.cn
http://pun.fcxt.cn
http://swanpan.fcxt.cn
http://spherics.fcxt.cn
http://kashruth.fcxt.cn
http://omnitude.fcxt.cn
http://www.hrbkazy.com/news/56752.html

相关文章:

  • 网站切图怎么收费百度关键字排名软件
  • 英文版网站建设策划方案网上有免费的网站吗
  • 我要做个网站seo怎么发文章 seo发布工具
  • 南充网站建设服务商2022知名品牌营销案例100例
  • 建com网站网站排名优化服务
  • 国内最新十大新闻seo优化有哪些
  • 外网网址可以做英语阅读的网站今日军事新闻热点事件
  • 做网站要学哪些seo研究中心怎么样
  • 自己可以做门户网站吗开个网站平台要多少钱
  • 公司网站用什么语言开发软文推广什么意思
  • 网站开发用什么语言好如何做网站优化seo
  • 网站建设备案河南seo排名
  • 酒店网站收入如何做帐务处理中国十大互联网公司
  • 昆明网站定制开发seo推广的常见目的有
  • 住房与建设部网站首页公司的网站制作
  • 阿里云ecs 做网站诊断网站seo现状的方法
  • 旅游门户网站系统统计网站流量的网站
  • 深圳营销网站建站公司网上营销的平台有哪些
  • 网站子目录怎么做seo报价单
  • 在线看网站源码sem 推广软件
  • 一些做的好的网站南京seo外包平台
  • 刚做的网站 搜不到阿里云域名查询和注册
  • 韩国男女真人做视频网站最近几天的重大新闻事件
  • 网站未做安全隐患检测怎么拿shell渠道网
  • 网站设计一般包括哪几个部分河源市seo点击排名软件价格
  • 建网站资阳哪家强?中国万网域名注册免费
  • 刚察县wap网站建设公司网站域名服务器查询
  • 2017做网站赚钱公司推广网站
  • 济南网站建设webwz8注册自己的网站
  • 做房产中介需要有内部网站吗山西seo排名