目 录 第1 章 RS-485 选型及应用指南.........................................................................1 1.1 RS-232/422/485 标准...............................................................................................1 1.1.1 RS-232 标准.....................................................................................................2 1.1.2 RS-422/485 标准..............................................................................................2 1.2 RS-485/RS-422 芯片................................................................................................5 1.2.1 增强型低功耗半双工RS-485 收发器-SP481E/SP485E..............................7 1.2.2 1/10 单位负载 RS-485 收发器-SP481R/SP485R .....................................10 1.2.3 +3.3V 低功耗半双工RS-485 收发器-SP3481/SP3485..............................13 1.2.4 增强型低功耗全双工RS-422 收发器-SP490E/SP491E............................15 1.2.5 +3.3V 低功耗全双工RS-422 收发器-SP3490/SP3491..............................20 1.3 RS-485 接口电路...................................................................................................22 1.3.1 基本RS-485 电路...........................................................................................22 1.3.2 隔离RS-485 电路...........................................................................................23 1.3.3 上电抑制电路.................................................................................................24 1.3.4 RS-485 自动换向电路....................................................................................24 1.4 RS-485 通讯协议...................................................................................................25 1.4.1 ModBus 协议(RTU 模式)...............................................................................25 1.4.2 多功能电能表通讯规约(DL/T645-1997) ......................................................27 1.5 RS-485 程序设计...................................................................................................28 1.5.1 RS-485 接口电路............................................................................................28 1.5.2 通讯规约.........................................................................................................28 1.5.3 程序设计流程图.............................................................................................29 1.5.4 数据接收部分.................................................................................................29 1.5.5 命令执行部分.................................................................................................29 1.5.6 数据发送部分.................................................................................................30 1.5.7 RS-485 程序清单............................................................................................31 1.6 RS-485 应用要点...................................................................................................38 1.6.1 合理选用芯片.................................................................................................38 1.6.2 终端匹配电阻.................................................................................................39 1.6.3 应用层通信协议.............................................................................................39 1.6.4 3V-5V 系统的连接.........................................................................................39 1.6.5 网络节点数.....................................................................................................40 1.6.6 节点与主干距离.............................................................................................40 1.6.7 RS-485 系统的常见故障及处理方法............................................................40 1.6.8 RS-422 与RS-485 的网络拓朴.....................................................................41 1.6.9 RS-422 与RS-485 的接地问题.....................................................................41 1.6.10 RS-422 与RS-485 的瞬态保护.....................................................................