传感器系列1--温度传感器之DS18B20(1)

本文详细介绍了DS18B20温度传感器的工作原理及操作流程,包括其引脚排列、温度值寄存器格式、工作时序、初始化过程及单总线信号规范等内容。

1.引脚排列


2.温度值寄存器格式Temperature Register Format


由该寄存器中保存的温度值的格式可知,高字节的低3位和低字节的高4位拼凑成温度值的整数部分,低字节的低4位为温度值的小数部分。

3.DS18B20工作时序

TRANSACTION SEQUENCE
The transaction sequence for accessing the DS18B20 is as follows:
Step 1. Initialization
Step 2. ROM Command (followed by any required data exchange)
Step 3. DS18B20 Function Command (followed by any required data exchange)

分为3个步骤:

1)初始化芯片

2)写ROM命令

3)写DS18B20功能命令

INITIALIZATION
All transactions on the 1-Wire bus begin with an initialization sequence. The initialization sequence consists of a reset pulse transmitted by the bus master followed by presence pulse(s) transmitted by the slave(s). The presence pulse lets the bus master know that slave devices (such as the DS18B20) are on the bus and are ready to operate. Timing for the reset and presence pulses is detailed in the 1-Wire Signaling section.

初始化

处理流程中的各个步骤都是以初始化这一时序开始的。芯片初始化时序包含了一个复位脉冲(主控制器发出的)和一个存在脉冲(由从机发出)。存在脉冲用于通知主控制器在总线上存在从机,并且该从机做好通信的准备。具体时序图加1-Wire Signaling 部分。

4.ROM命令及DS18B20操作的命令

5.1-WIRE SIGNALING 单总线信号

1-WIRE SIGNALING
The DS18B20 uses a strict 1-Wire communication protocol to ensure data integrity. Several signal types are defined by this protocol: reset pulse, presence pulse, write 0, write 1, read 0, and read 1. The bus master initiates all these signals, with the exception of the presence pulse.

DS18B20使用严格的单总线通信协议去确保数据的完整性。协议中规定了几种类型的信号:复位脉冲,存在脉冲,写0信号,写1信号,读0信号及读1信号。由总线初始化以上各种信号,除了存在脉冲。

During the initialization sequence the bus master transmits (TX) the reset pulse by pulling the 1-Wire bus low for a minimum of 480μs. The bus master then releases the bus and goes into receive mode (RX). When the bus is released, the 5kΩ pullup resistor pulls the 1-Wire bus high. When the DS18B20 detects this rising edge, it waits 15μs to 60μs and then transmits a presence pulse by pulling the 1-Wire bus low for 60μs to 240μs.

当进行初始化序列时,主控制器把总线拉低480us以上的时间作为复位脉冲。此时总线主控制器将释放总线,转为接收模式。随后,5kΩ的上拉电阻将把总线电平拉高。当DS18B20检测到上升沿后,他将等15us-60us的时间然后拉低总线60us-240us作为存在脉冲。

下一篇将继续翻译,DS18B20的读写操作。


By:霜月孤鸟

2016.2.19

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值