USB - D+/D-信号介绍

2024-06-01 14:20
文章标签 介绍 信号 usb

本文主要是介绍USB - D+/D-信号介绍,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

USB (通用串行总线)信令包括两条数据线 D+ 和 D-,用于差分信令,以提高抗噪能力和数据完整性。这些线路的控制决定了 USB 通信中的数据传输、各种状态和信号协议。

USB 差分信号

差分信号是指数据由 D+ 和 D- 线路之间的电压差来表示,而不是由它们的绝对电压电平来表示。这种技术提高了数据在长距离和嘈杂环境中传输的稳健性。

USB 信号状态

根据 USB 设备的速度和正在执行的操作,D+ 和 D- 线的状态可能处于几种情况之一:

  1. 高速(HS)信号

    • 闲置(J 状态): D+ 为高电平,D- 为低电平。
    • 激活(K 状态): D+ 为低电平,D- 为高电平。
    • SE0(单端归零): D+ 和 D- 均为低电平。
    • 恢复信号: 从挂起状态恢复时,使用 K 状态。
  2. 全速(FS)和低速(LS)信号

    • 闲置(J 状态)
      • 全速: D+ 为高电平,D- 为低电平。
      • 低速: D+ 低,D- 高。
    • 激活(K 状态)
      • 全速: D+ 低,D- 高。
      • 低速: D+ 为高电平,D- 为低电平。
    • SE0(单端归零): D+ 和 D- 均为低电平,表示数据包结束或复位状态。

D+ 和 D- 线路的控制

USB 主机控制器和 USB 设备控制器通过各种信号协议管理 D+ 和 D- 线的状态。这些协议在 USB 硬件和固件中实现,涉及精确的定时和电压电平,以确保可靠的通信。

关键操作
  1. 数据传输

    • 数据使用 NRZI(非归零反转)编码传输,状态之间的转换表示二进制 “0”,无转换表示二进制 “1”。
    • 比特填充用于确保有足够的转换来保持同步。
    • SE0 条件标志着数据传输的结束,使接收器能够识别数据包之间的边界。
    • 在传输数据包结束时,发送器会将 D+ 和 D- 短时间内(通常为 2 比特左右)驱动为低电平。
  2. 复位和速度检测

    • 将 D+ 和 D- 都置低 (SE0) 至少 10 毫秒即表示复位。此操作将重置所有已连接的 USB 设备,使其恢复到默认状态。总线上的设备会识别这一复位信号,并重新初始化其配置,就像它们是新连接的一样。
    • 速度检测是通过主机检查复位后 D+ 和 D- 线的状态来实现的。例如,全速设备在 D+ 上有一个上拉电阻,而低速设备在 D- 上有一个上拉电阻。
  3. 暂停和恢复

    • 在正常运行期间,如果 3 毫秒内没有总线活动,设备就会进入暂停状态以节省电能。
    • 要恢复运行,主机将总线驱动到 SE0 的持续时间最短(通常约为 1 至 2 毫秒),然后过渡到 K 状态(D+ 为低电平,D- 为全速和高速状态下的高电平)至少 20 毫秒至多100ms使所有设备能检测到并唤醒。(有时没有复位信号,而是直接resume信号)
  4. 握手和确认

    • USB 通信包括握手数据包(ACK、NAK、STALL),以管理数据流并确保可靠传输。

###电气特性

  • 全速: 12 Mbps,D+ 端使用 1.5 kΩ 上拉电阻。
  • 低速: 1.5 Mbps,D- 端使用 1.5 kΩ 上拉电阻。
  • 高速: 480 Mbps,最初显示为全速,直到完成高速协商(chirp)。

这个电阻是在设备端的,由USB host来识别USB设备类型。
另外,通常15k 欧姆电阻通常用作主机侧 D+ 和 D- 线路的下拉电阻,以确保在未连接设备时将线路拉至地。

摘要

USB 中的 D+ 和 D- 线通过差分信号进行控制,以管理数据传输和各种 USB 状态。主机和设备控制器使用精确的电压电平和定时来控制这些线路,从而确保 USB 通信的稳健和高效。这种差分信号方法对于在各种可能存在噪声的环境中保持数据完整性和可靠性至关重要。


The USB (Universal Serial Bus) signaling involves two data lines, D+ and D-, which are used for differential signaling to improve noise immunity and data integrity. The control of these lines determines the data transmission, various states, and signaling protocols in USB communication.

USB Differential Signaling

Differential signaling means that data is represented by the voltage difference between the D+ and D- lines, rather than their absolute voltage levels. This technique enhances the robustness of data transmission over longer distances and in noisy environments.

USB Signal States

The state of the D+ and D- lines can be in one of several conditions, depending on the speed of the USB device and the operation being performed:

  1. High-Speed (HS) Signaling:

    • Idle (J State): D+ is high, D- is low.
    • Active (K State): D+ is low, D- is high.
    • SE0 (Single-Ended Zero): Both D+ and D- are low.
    • Resume Signaling: When resuming from suspend, the K state is used.
  2. Full-Speed (FS) and Low-Speed (LS) Signaling:

    • Idle (J State):
      • Full-Speed: D+ is high, D- is low.
      • Low-Speed: D+ is low, D- is high.
    • Active (K State):
      • Full-Speed: D+ is low, D- is high.
      • Low-Speed: D+ is high, D- is low.
    • SE0 (Single-Ended Zero): Both D+ and D- are low, indicating the end of a packet(EOP) or a reset condition.

Control of D+ and D- Lines

The USB host controller and USB device controllers manage the states of D+ and D- lines through various signaling protocols. These protocols are implemented in the USB hardware and firmware, and involve precise timing and voltage levels to ensure reliable communication.

Key Operations

  1. Data Transmission:

    • Data is transmitted using NRZI (Non-Return to Zero Inverted) encoding, where a transition between states indicates a binary ‘0’ and no transition indicates a binary ‘1’.
    • Bit stuffing is used to ensure there are enough transitions to maintain synchronization.
    • The SE0 condition signifies the end of the data transmission, allowing the receiver to recognize the boundary between packets.
    • At the end of transmitting a data packet, the transmitter drives both D+ and D- low for a short period (typically around 2 bit times).
  2. Reset and Speed Detection:

    • A reset condition is indicated by driving both D+ and D- low (SE0) for at least 10 milliseconds. This action resets all connected USB devices, bringing them back to their default state. Devices on the bus recognize this reset signal and reinitialize their configurations as if they were newly connected.

    • Speed detection is achieved by the host checking the state of the D+ and D- lines after reset. For example, full-speed devices have a pull-up resistor on D+, while low-speed devices have a pull-up resistor on D-.

  3. Suspend and Resume:

    • During normal operation, if there is no bus activity for 3 milliseconds, devices enter the suspended state to save power.
    • To resume, the host drives the bus to SE0 for a minimum duration (typically around 1 to 2 milliseconds), followed by a transition to the K state (D+ low, D- high for full-speed and high-speed) for at least 20 ms and at most 100 ms to ensure all devices detect it and wake up the device.
  4. Handshake and Acknowledgment:

    • USB communication includes handshake packets (ACK, NAK, STALL) to manage data flow and ensure reliable transmission.

Electrical Characteristics

  • Full-Speed: 12 Mbps, uses a 1.5 kΩ pull-up resistor on D+.
  • Low-Speed: 1.5 Mbps, uses a 1.5 kΩ pull-up resistor on D-.
  • High-Speed: 480 Mbps, initially appears as full-speed until high-speed negotiation (chirp) is completed.

This resistor is on the device side and is used by the USB host to recognize the USB device type.
Additionally, the 15k ohm resistors are typically used as pull-down resistors on both D+ and D- lines on the host side to ensure the lines are pulled to ground when no device is connected.

Summary

The D+ and D- lines in USB are controlled through differential signaling to manage data transmission and various USB states. The host and device controllers use precise voltage levels and timing to control these lines, ensuring robust and efficient USB communication. This differential signaling method is essential for maintaining data integrity and reliability in diverse and potentially noisy environments.


USB信号线颜色

在这里插入图片描述

一般白色表示D+,绿色D-。很多UART串口线也是红、黑、绿、白的颜色线。绿色RX、白色TX。

接头的线序如下:

在这里插入图片描述

这篇关于USB - D+/D-信号介绍的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!


原文地址:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.chinasem.cn/article/1021251

相关文章

java中BigDecimal里面的subtract函数介绍及实现方法

《java中BigDecimal里面的subtract函数介绍及实现方法》在Java中实现减法操作需要根据数据类型选择不同方法,主要分为数值型减法和字符串减法两种场景,本文给大家介绍java中BigD... 目录Java中BigDecimal里面的subtract函数的意思?一、数值型减法(高精度计算)1.

Pytorch介绍与安装过程

《Pytorch介绍与安装过程》PyTorch因其直观的设计、卓越的灵活性以及强大的动态计算图功能,迅速在学术界和工业界获得了广泛认可,成为当前深度学习研究和开发的主流工具之一,本文给大家介绍Pyto... 目录1、Pytorch介绍1.1、核心理念1.2、核心组件与功能1.3、适用场景与优势总结1.4、优

Java实现本地缓存的常用方案介绍

《Java实现本地缓存的常用方案介绍》本地缓存的代表技术主要有HashMap,GuavaCache,Caffeine和Encahche,这篇文章主要来和大家聊聊java利用这些技术分别实现本地缓存的方... 目录本地缓存实现方式HashMapConcurrentHashMapGuava CacheCaffe

Spring Security介绍及配置实现代码

《SpringSecurity介绍及配置实现代码》SpringSecurity是一个功能强大的Java安全框架,它提供了全面的安全认证(Authentication)和授权(Authorizatio... 目录简介Spring Security配置配置实现代码简介Spring Security是一个功能强

JSR-107缓存规范介绍

《JSR-107缓存规范介绍》JSR是JavaSpecificationRequests的缩写,意思是Java规范提案,下面给大家介绍JSR-107缓存规范的相关知识,感兴趣的朋友一起看看吧... 目录1.什么是jsR-1072.应用调用缓存图示3.JSR-107规范使用4.Spring 缓存机制缓存是每一

Java中 instanceof 的用法详细介绍

《Java中instanceof的用法详细介绍》在Java中,instanceof是一个二元运算符(类型比较操作符),用于检查一个对象是否是某个特定类、接口的实例,或者是否是其子类的实例,这篇文章... 目录引言基本语法基本作用1. 检查对象是否是指定类的实例2. 检查对象是否是子类的实例3. 检查对象是否

什么是ReFS 文件系统? ntfs和refs的优缺点区别介绍

《什么是ReFS文件系统?ntfs和refs的优缺点区别介绍》最近有用户在Win11Insider的安装界面中发现,可以使用ReFS来格式化硬盘,这是不是意味着,ReFS有望在未来成为W... 数十年以来,Windows 系统一直将 NTFS 作为「内置硬盘」的默认文件系统。不过近些年来,微软还在研发一款名

C#使用StackExchange.Redis实现分布式锁的两种方式介绍

《C#使用StackExchange.Redis实现分布式锁的两种方式介绍》分布式锁在集群的架构中发挥着重要的作用,:本文主要介绍C#使用StackExchange.Redis实现分布式锁的... 目录自定义分布式锁获取锁释放锁自动续期StackExchange.Redis分布式锁获取锁释放锁自动续期分布式

redis过期key的删除策略介绍

《redis过期key的删除策略介绍》:本文主要介绍redis过期key的删除策略,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录第一种策略:被动删除第二种策略:定期删除第三种策略:强制删除关于big key的清理UNLINK命令FLUSHALL/FLUSHDB命

usb接口驱动异常问题常用解决方案

《usb接口驱动异常问题常用解决方案》当遇到USB接口驱动异常时,可以通过多种方法来解决,其中主要就包括重装USB控制器、禁用USB选择性暂停设置、更新或安装新的主板驱动等... usb接口驱动异常怎么办,USB接口驱动异常是常见问题,通常由驱动损坏、系统更新冲突、硬件故障或电源管理设置导致。以下是常用解决