资源简介
DS18B20是单总线数字传感器,共有6种信号类型:复位脉冲、应答脉冲、写0、写1、读0和读1。所有这些信号,除了应答脉冲以外,都由主机发出同步信号。并且发送所有的命令和数据都是字节的低位在前。
这几个信号的时序如下:
1)复位脉冲和应答脉冲
单总线上的所有通信都是以初始化序列开始。主机输出低电平,保持低电平时间至少480us,以产生复位脉冲。接着主机释放总线,4.7K的上拉电阻将单总线拉高,延时15~60us,并进入接收模式(Rx)。接着DS18B20拉低总线60~240us,以产生低电平应答脉冲,若为低电平,再延时480us。
2)写时序
写时序包括写0时序和写1时序。所有写时序至少需要60us,且在2次独立的写时序之间至少需要1us的恢复时间,两种写时序均起始于主机拉低总线。写1时序:主机输出低电平,延时2us,然后释放总线,延时60us。写0时序:主机输出低电平,延时60us,然后释放总线,延时2us。
3)读时序
单总线器件仅在主机发出读时序时,才向主机传输数据,所以,在主机发出读数据命令后,必须马上产生读时序,以便从机能够传输数据。所有读时序至少需要60us,且在2次独立的读时序之间至少需要1us的恢复时间。每个读时序都由主机发起,至少拉低总线1us。主机在读时序期间必须释放总线,并且在时序起始后的15us之内采样总线状态。典型的读时序过程为:主机输出低电平延时2us,然后主机转入输入模式延时12us,然后读取单总线当前的电平,然后延时50us。
DS18B20的温度读取过程一般为:复位->发SKIPROM命令(0XCC)->发开始转换命令(0X44)->延时->复位->发送SKIPROM命令(0XCC)->发读存储器命令(0XBE)->连续读出两个字节数据(即温度)->结束。
代码片段和文件信息
/**
******************************************************************************
* @file system_stm32l0xx.c
* @author MCD Application Team
* @version V1.4.0
* @date 16-October-2015
* @brief CMSIS Cortex-M0+ Device Peripheral Access layer System Source File.
*
* This file provides two functions and one global variable to be called from
* user application:
* - SystemInit(): This function is called at startup just after reset and
* before branch to main program. This call is made inside
* the “startup_stm32l0xx.s“ file.
*
* - SystemCoreClock variable: Contains the core clock (HCLK) it can be used
* by the user application to setup the SysTick
* timer or configure other parameters.
*
* - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
* be called whenever the core clock is changed
* during program execution.
*
*
******************************************************************************
* @attention
*
* © COPYRIGHT(c) 2015 STMicroelectronics
*
* Redistribution and use in source and binary forms with or without modification
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS“
* AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL
* DAMAGES (INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/** @addtog
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5189 2016-01-20 22:13 DS18B20_USART\STM32L053\.mxproject
文件 252926 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l011xx.h
文件 259183 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l021xx.h
文件 256932 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l031xx.h
文件 263189 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l041xx.h
文件 265915 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l051xx.h
文件 319600 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l052xx.h
文件 326104 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l053xx.h
文件 272172 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l061xx.h
文件 325857 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l062xx.h
文件 332361 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l063xx.h
文件 277472 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l071xx.h
文件 335861 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l072xx.h
文件 342501 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l073xx.h
文件 283729 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l081xx.h
文件 342118 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l082xx.h
文件 348758 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l083xx.h
文件 8511 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l0xx.h
文件 3842 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Include\system_stm32l0xx.h
文件 10945 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\arm\startup_stm32l011xx.s
文件 11221 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\arm\startup_stm32l021xx.s
文件 10485 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\arm\startup_stm32l031xx.s
文件 10736 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\arm\startup_stm32l041xx.s
文件 11072 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\arm\startup_stm32l051xx.s
文件 11259 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\arm\startup_stm32l052xx.s
文件 11333 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\arm\startup_stm32l053xx.s
文件 11084 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\arm\startup_stm32l061xx.s
文件 11270 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\arm\startup_stm32l062xx.s
文件 11328 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\arm\startup_stm32l063xx.s
文件 11380 2015-12-15 15:15 DS18B20_USART\STM32L053\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\arm\startup_stm32l071xx.s
............此处省略556个文件信息
- 上一篇:艾科603源代码
- 下一篇:sublime text3 win64 +破解码
相关资源
- 水温控制系统论文附电路图及程序
- 黑金科技的FPGA 控制DS18B20并用数码管
- STM32F103C8T6每隔20s驱动DS18B20测温_OLED
- 基于stm32f103c8t6温湿度显示屏.rar
- 基于DS18B20和nRF9E5的多点无线测温系统
- 基于 STM32 的 DS18B20 程序,包含 ID 访问
- 基于STM32和NRF24L01的无线温度监控系统
- STM32DS18B20程序
- DS18B20温度传感器模块使用资料包stm
- STM8S207R8(DS18B20)源代码
- STM32F072多路DS18B20温度传感器
- 超声波雾化器的设计与实现
- stm32单片机+串口通信+温度采集
- 基于DS18B20的单片机温度控制系统
- LCD_Display_DS18B20.zip
- 用STM32测3个DS18B20用12864显示
- 基于STM32室内温度报警控制系统设计
- 基于DS18B20传感器的数字温度监控系统
- 基于FPGA的温控风扇
- 基于DS18B20的温度检测原理图和PCB图
- 基于51单片机的DS18B20温度控制1602显示
- DS18B20测温
- 1_蔬菜大棚恒温控制系统设计.rar
- FPGA和DS18B20通信verilog实现
- Verilog驱动DS18B20
- Proteus模拟可显示温度与气压的时钟
- 毕业设计,温度控制,基于DS18B20
- STM32_ds18b20_oled显示
- 基于STM32的电压和温度采集DS18B20
- DS18b20温度传感器协调器终端zigbee程序
评论
共有 条评论