串行与SPI [英] Serial versus SPI

查看:115
本文介绍了串行与SPI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SPI与串行有什么区别?在阅读有关处理器间通信的文章时,它指出串行接口已被SPI取代,以实现更好/更快的通信?到底有什么区别?

What is the difference between SPI and serial? In reading an article talking about inter-processor communications, it states that serial interfaces are being replaced with SPI for better/faster comms? What exactly is the difference?

推荐答案

串行"一词含义不大.但是我假设您正在谈论传统的串行通信标准. SPI的根本区别在于它是同步.与RS-232(一种异步信令标准)相对.

The word "serial" doesn't mean much. But I'll assume that you are talking about traditional serial communication standards. What's fundamentally different about SPI is that it is synchronous. As opposed to, say, RS-232, an asynchronous signaling standard.

异步信令的一个重要属性是波特率,即字节中位的发送频率.接收器必须做额外的工作才能恢复发送器使用的时钟.典型的UART通过以16倍波特率的速率对信号进行过采样来做到这一点.起始位很重要,它可以使过采样时钟同步.字节之间的延迟可以是任意的,接收器针对每个单独的字节重新同步.该方案存在的问题是发送器和接收器时钟频率之间的不匹配以及时钟抖动,从而有效地限制了波特率.

An important property of asynchronous signaling is the baudrate, the frequency at which the bits in a byte are sent. The receiver has to do extra work to recover the clock that was used by the transmitter. A typical UART does so by over-sampling the signal at a rate 16 times the baudrate. The start-bit is important, which synchronizes the over-sampling clock. Delays between bytes can be arbitrary, the receiver re-synchronizes for each individual byte. Problems with this scheme are a mismatch between the transmitter and the receiver clock frequencies and clock jitter, effectively limiting the baudrate.

这不是SPI的问题,它有一条额外的信号线来传输时钟信号,因此发送器和接收器都使用完全相同的时钟.因此,可以避免失配和抖动,从而提高传输速率.时钟频率完全没有稳定性要求,信号可以简单地在软件中生成.典型的四线布线如下所示:

This is not a problem with SPI, it has an extra signal line that carries the clock signal so that both the transmitter and receiver uses the exact same clock. And is therefore immune from mismatches and jitter, allowing higher transfer rates. No stability requirements at all in the clock frequency, the signals can simply be generated in software. Typical four line wiring looks like this:

SCLK是时钟信号. MOSI和MISO携带数据,SS是片选信号.假定有共同点.详情请参见维基百科文章. electronics.stackexchange.com是一个很好的网站,可以询问有关它的更多问题.

SCLK is the clock signal. MOSI and MISO carry the data, SS is a chip select signal. Common ground is assumed. More about it in this Wikipedia article. electronics.stackexchange.com is a good site to ask more questions about it.

这篇关于串行与SPI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆