当前位置:网站首页>远距离串口服务器( 适配器)UART 转 1-Wire 应用
远距离串口服务器( 适配器)UART 转 1-Wire 应用
2022-07-28 14:50:00 【河北稳控科技】

PS304 有 4 个通道的 1Wire 接口,每个接口上可同时连接多个 1Wire 芯片(或设备)。具有 64 位 ID 搜索功能;具有远距离线路的自适应功能。
ID 搜索与线缆适应检测
向模块发送[WIRE1][FIND],模块返回搜索线路上挂载的所有 1Wire 芯片 ID 并输出,每个 ID占用 8 字节。举例:搜索通道 1 上所有 1Wire 芯片,模块返回信息如下:S2SREC 28 AA 32 B9 21 20 03 94 2D 85 00 10 20 00 00 7A共返回 16 个字节数据,每个 ID8 字节,故通道 1 上有两个 1Wire 芯片
芯片 1ID: 28 AA 32 B9 21 20 03 94
芯片 2ID: 2D 85 00 10 20 00 00 7A
在搜索过程中,模块会检测线缆参数,自动完成线缆适应校正。当对 1Wire 芯片操作发生错误时,或者改变线路长度,或者更换线缆时,应重新进行上述搜索操作,以获得实时的芯片数量和芯片 ID 以及模块对线缆性能的自适应。注:一般而言,线缆越长时搜索过程消耗的时间越长。
DS18B20 温度传感器
DS18B20 是 1Wire 接口的温度传感器,可实现 12 位精度的温度转换和输出功能。 使用方法简要说明如下。
(1)开始一次温度转换
向芯片发送 0xCC 0x44, S2S 协议为: [WIRE1][START][WT2H]CC 44
(2)读取温度
向芯片发送 0xCC 0xBE,然后读取 2 个字节。S2S 协议为: [WIRE][START][WT2H]CC BE[RD2N]
模块返回: S2SREC C8 010x01C8 转换为 10 进制为 456,根据 DS18B20 数据手册说明,这个数*0.0625=28.5℃。
(3)读取温度(使用芯片唯一 ID)
[WIRE][START][WT10H]55 28 AA 32 B9 21 20 03 94 BE[RD2N](下划线部分为已知的芯片 ID)
模块返回: S2SREC C8 01
0x01C8 转换为 10 进制为 456,根据 DS18B20 数据手册说明,这个数*0.0625=28.5℃。
DS2431 存储芯片
DS2431 是一款 1024 位 1-Wire EEPROM 芯片,由 四个存储器页组成,每页 256 位。 数据先被写入一个 8 字节暂存器中,经校验无误后复制到 EEPROM 存储器。其特点在于,四个存储器页相互独立,可以单独设置写保护或 EPROM 仿真模式。对 2431 芯片的读写访问必须以 8 字节为单位并且起始地址必须为 8 的倍数。
(1)读取 EEPROM
向芯片发送 0xCC 0xF0+两字节起始地址,然后读取 8 字节数据。
例:读取 EEPROM 的地址 0~8, [WIRE][START][WT4H]CC F0 00 00[RD8N]
模块返回: S2SREC 31 32 33 34 35 36 37 38
(2)写 EEPROM
2431 的写操作分为写暂存器和暂存器同步到 EEPROM 两个大的步骤。写暂存器:向芯片发送 0xCC 0x0F+两字节起始地址+8 字节数据。[WIRE][START][WT4H]CC 0F 00 00[WT8H]31 32 33 34 35 36 37 38[RD2N]
模块返回: S2SREC 52 D7(0x52D7 是对本次数据发送的 CRC 校验数据)
读取暂存器:向芯片发送 0xCC 0xAA,读 13 字节(3 个寄存器+8 字节暂存器数据+2 字节 CRC)
[WIRE][START][WT2H]CC AA[RD3N][DELAY1][RD10N]
模块返回: S2SREC 00 00 07 31 32 33 34 35 36 37 38 66 B2
暂存器同步到 EEPROM:向芯片发送 0xCC 0x55+两字节起始地址+0x07
模块返回: S2SREC AA(0xAA 表示同步成功)
边栏推荐
- How to compress and decompress ramdisk.img
- Flutter中是使用RxDart代替Stateful
- 5-channel di/do relay output remote IO acquisition module Modbus tcp/ibf95
- 数据实时反馈技术
- Software architecture and design (I) -- key principles
- Rust 入门指南(rustup, cargo)
- DNS domain name resolution protocol
- 语音社交系统——完善有声系统产业链
- Encoder high speed pulse counter Modbus RTU module ibf150
- Return the two subscripts of the array according to the input target.
猜你喜欢

Matlab exports high-definition pictures without distortion in word compression and PDF conversion

软件架构与设计(八)-----分布式架构

Duty cycle switch output high speed pulse counter rtumodbus module ibf63

电压转电流/电流转电压模块

PXE network installation

Shell programming specifications and variables

Learn about the native application management platform of rainbow cloud

光学雨量计应用降雨量检测

Docker container implements MySQL master-slave replication

1路编码器2路DI转速测量RS485串口连接1路DO报警模块IBF151
随机推荐
有道云笔记去除底部广告
Samba Server Setup Guide
Encoder high speed pulse counter Modbus RTU module ibf150
记录一下 clearfix 清除浮动
About the pictures inserted in the word document, only the following part is displayed
知识点qwer
AS如何不区分大小写去进行智能提示
Shell programming specifications and variables
Docker container implements MySQL master-slave replication
2.855 billion yuan! Qingdao Xinen completed the capital increase: Xingcheng Jidian became the largest shareholder, holding 57.10%
在OBS上进行H265推流
A failed cracking experience
monkey压力测试
Perception of life
Huawei has a record number of employees worldwide: 194000, with research and development personnel accounting for nearly 50%
H265 streaming on OBS
Has won Huawei's 8.5 billion yuan screen order? Vicino responded: the customer asked for confidentiality and could not reply!
Flutter中是使用RxDart代替Stateful
以太网转RS485串口计数器WiFI模块 LED灯光控制器IBF165
兆骑科创创业大赛平台,活动路演,投融资对接