What is SPI?
原文地址:http://www.fpga4fun.com/SPI1.html
SPI is a simple interface that allows one chip to communicate with one or more other chips.
How does it look?
Let's start with a simple example where only two chips have to communicate together.
SPI requires 4 wires to be used in between the two chips.
As you can see, the wires are called SCK, MOSI, MISO and SSEL, and one of the chip is called the SPI master, while the other the SPI slave.
SPI fundamentals
Basically:
- It is synchronous.
- It is serial.
- It is full-duplex.
- It is not plug-and-play.
- There is one (and only one) master, and one (or more) slaves.
In more details:
- A clock is generated by the master, and one bit of data is transferred each time the clock toggles.
- Data is serialized before being transmitted, so that it fits on a single wire.
- There are two wires for data, one for each direction.
- The master and slave know beforehand the details of the communication (bit order, length of data words exchanged, etc...)
- The master is always the one who initiates communication.
Because SPI is synchronous and full-duplex, every time the clock toggles, two bits are actually transmitted (one in each direction).
Simple transfer
Let's assume that the master and slave expect 8-bits data transfers, with MSB transmitted first.
Here's how would look a single 8-bits data transfer.
The line MOSI is the "master output" while MISO is the "slave output". Since SPI is full-duplex, both lines toggles simultaneously, with different data going from master-to-slave, and slave-to-master.
In more datails:
- The master pulls SSEL down to indicate to the slave that communication is starting (SSEL is active low).
- The master toggles the clock eight times and sends eight data bits on its MOSI line. At the same time it receives eight data bits from the slave on the MISO line.
- The master pulls SSEL up to indicate that the transfer is over.
If the master had more than one 8-bits data to send/receive, it could keep sending/receiving and de-assert SSEL only when it is done.
Multiple slaves
An SPI master can communicate with multiples slaves by connecting most signals in parallel and adding SSEL lines, or by chaining the slaves.
With the multiple SSEL lines technique, only one SSEL line is actived at a time, and slaves that are not selected must not drive the MISO line.
How fast is it?
SPI can easily achieve a few Mbps (mega-bits-per-seconds). That means it can be used for uncompressed audio, or compressed video.
What is SPI?的更多相关文章
- SPI基础知识
Serial Peripheral Interface 是摩托罗拉公司提出的一种总线协议,主要应用在EEPROM,FLASH,实时时钟,A/D转换,以及数字信号处理和数字信号解码器中 是一种高速,全双 ...
- spi子系统之驱动SSD1306 OLED
spi子系统之驱动SSD1306 OLED 接触Linux之前,曾以为读源码可以更快的学习软件,于是前几个博客都是一边读源码一边添加注释,甚至精读到每一行代码,实际上效果并不理想,看过之后就忘记了.主 ...
- java中的SPI机制
1 SPI机制简介 SPI的全名为Service Provider Interface.大多数开发人员可能不熟悉,因为这个是针对厂商或者插件的.在java.util.ServiceLoader的文档里 ...
- 基于TQ2440的SPI驱动学习(OLED)
平台简介 开发板:TQ2440 (NandFlash:256M 内存:64M) u-boot版本:u-boot-2015.04 内核版本:Linux-3.14 作者:彭东林 邮箱:pengdongl ...
- SPI协议及IO模拟
SPI协议 SPI协议网上资料比较多,但是也比较乱,当初在网上搜集的错误资料导致现在比较混乱. SPI协议资料比较正规的是: 1.SPI的规约协议英文文档,例如<摩托罗拉spi协议规范> ...
- STM32F412应用开发笔记之三:SPI总线通讯与AD采集
本次我们在NUCLEO-F412ZG试验模拟量输入采集.我们的模拟量输入采用ADI公司的AD7705,是一片16位两路差分输入的AD采集芯片.具有SPI接口,我们将采用SPI接口与AD7705通讯.两 ...
- spi 10方式编写
//第一个CS变低的时候要sclk为高电平,第一个跳变沿进行赋值 module spi(input clk,input rst_n,output reg sclk,output reg cs,outp ...
- 挣值管理(PV、EV、AC、SV、CV、SPI、CPI) 记忆
挣值管理法中的PV.EV.AC.SV.CV.SPI.CPI这些英文简写相信把大家都搞得晕头转向的.在挣值管理法中,需要记忆理解的有三个参数:PV.AC.EV. PV:计划值,在即定时间点前计划 ...
- SPI总线
一.概述. SPI, Serial Perripheral Interface, 串行外围设备接口, 是 Motorola 公司推出的一种同步串行接口技术. SPI 总线在物理上是通过接在外围设备微控 ...
- I2S/PCM/IOM-2、I2C/SPI/UART/GPIO/slimbus
概述 I2S,PCM,IOM-2都是数字音频接口,传数据的. I2C,SPI,UART,GPIO是控制接口,传控制信令的. I2S I2S(Inter-IC Sound Bus)是飞利浦公司为数字音频 ...
随机推荐
- 从0和1到Python
什么是编程语言? 举一个例子: 如果我们不会英语,和一个不会中文的老外交流,怎么办?找个翻译. 电脑只懂0和1组成的机器语言. 用0和1告诉计算机做事很累:人类语言易了解,学习快,效率高. 如果定义一 ...
- Qt开发中的实用笔记二--中文转码问题和string转换问题:
一,中文乱码转码问题 1,转码三句话:window下默认是GBK格式,linux下默认是UTF-8,看情况转换UTF-8/GBK QTextCodec::setCodecForTr(QTextCode ...
- C++编写DLL的方法
http://files.cnblogs.com/files/profession/DllTest.zip 在写C++程序时,时常需要将一个class写成DLL,供客户端程序调用.这样的DLL可以导出 ...
- 如何给Visual Studio 2015安装XNA4.0
从这个地址下载安装包 https://mxa.codeplex.com/releases/view/618279 按照说明步骤依次安装 DirectX XNA Framework 4.0 Redist ...
- 自动化运维web环境搭建:Nginx+Django+uwsgi
参考资料: http://lovelace.blog.51cto.com/1028430/1600594 http://www.cnblogs.com/xiongpq/p/3381069.html 安 ...
- delphi中的各种文件类型介绍【转】
1.DPR: Delphi Project文件,包含了Pascal代码.应用系统的工程文件2.PAS: Pascal文件,Pascal单元的源代码,可以是与窗体有关的单元或是独立的单元.3.DFM:D ...
- 学习taobao框架
参考:https://github.com/xulingbo/xulingbo.github.io/issues http://blog.csdn.net/hguisu/article/details ...
- java sdk与jdk区别
SDK是Software Development Kit的缩写,中文意思是"软件开发工具包".这是一个覆盖面相当广泛的名词,可以这么说:辅助开发某一类软件的相关文档.范例和工具的集 ...
- python学习笔记——2
Python的字符串 在最新的Python 3版本中,字符串是以Unicode编码的,也就是说,Python的字符串支持多语言. 对于单个字符的编码,Python提供了ord()函数获取字符的整数表示 ...
- Best Practices for Performance_4.Optimizing Battery Life 获取充电状态、电池信息,"sticky"类型的广播
http://developer.android.com/training/monitoring-device-state/index.htmlhttp://developer.android.com ...