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)是飞利浦公司为数字音频 ...
随机推荐
- REGEX.C GNU 提取过滤数据
今天被@SVCHAO 勾起兴趣来了.. 有把正则表达式兴趣捡起来了,试了下notepad++基本上语法倒是没有忘记,不过如果是用在嵌入式的方案的话,似乎还是有点费劲的. 先mark一个基础语法. 单 ...
- CAN总线通信:实现MIC-3680与F28335 CAN总线通信的设置
博主原创: 实现MIC-3680与F28335 CAN总线通信的设置(MIC-3680CAN模块滤波使用单滤波模式): CAN2.0A协议: (使用11位标识符) <1>F28335发送, ...
- vi 颜色配置
一.vi 默认黑色背景上,蓝色注释很难看不清,必须重新设置. (1)查看vi支持的配色方案: $ ls /usr/share/vim/vim72/colors (2)支持如下方案: blue.vim ...
- HelloWorld!
爪哇岛上程序猿,5载忙忙未等闲, 醉里挑灯秒登VPN解决Bug,梦里手撕产品战PM: 但行好事,莫问前程, 泰山崩于前,我依然沐浴更衣焚香沏茶: ...
- dubbo简单demo
zookeeper,可以集群,可以只安装一台 依赖dubbo jar, zkclient等 发布服务 <?xml version="1.0" encoding=" ...
- mysql临时表的产生
sql执行会生成一个巨大的临时表,当内存放不下时,要全部copy 到磁盘,导致IO飙升,时间开销增大. 额外收获知识收藏如下: 临时表存储 MySQL临时表分为"内存临时表"和&q ...
- Vs2015智能提示英文?
Vs2015智能提示英文? 装了vs2015代码的智能提示全部变成英文了 找到这个目录 C:\Program Files (x86)\Reference Assemblies\Microsoft\ ...
- [DFNews] EnCase v7.08发布
EnCase v7.08 近日正式发布,7.08增加了Evidence Processor Manager以及Evidence Processor,不仅可以在本地实现证据处理队列,也支持了通过网络进行 ...
- XE6 & IOS开发之免证书真机调试(1):颁发属于自己的App签名证书(有图有真相)
网上能找到的关于Delphi XE系列的移动开发的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 1.自己给自己颁发证书, ...
- WCF配置
服务端 <system.serviceModel> <services> <service name="WCF.Homedo.Service.Cache.Ser ...