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)是飞利浦公司为数字音频 ...
随机推荐
- DP(Dynamic programming)——尽力学习之中(2016 HUAS ACM 暑假集训-5)
这周不打算按照以往的方式更新博客,而是采用整体的方式.一是因为学的太少,没东西写:二是这篇博客会经常更新的.如题,DP——尽力学习之中. ------------------------------- ...
- [课程设计]Scrum 1.2 Spring 计划&系统流程&DayOne燃尽图
多鱼点餐系统WEB Spring 计划 ● 产品BACKLOG 多鱼点餐系统产品BACKLOG ID Name Imp Est How to demo Notes 1 设计框架结构 10 8 利用美学 ...
- Linux-TCP Queue的一些问题
先来回顾下三次握手里面涉及到的问题:1. 当 client 通过 connect 向 server 发出 SYN 包时,client 会维护一个 socket 等待队列,而 server 会维护一个 ...
- CDN 技术详解(DNS,GSLB,Cache)
CDN 是什么 CDN(Content Delivery Network,内容分发网络),即全网内容加速服务.为了尽可能的避开互联网上有可能影响数据传输速度和稳定性的瓶颈和环节,使内容传输的更快.更稳 ...
- RestEasy 3.x 系列之四:使用Hibernate_Validator进行数据校验
使用Hibernate_Validator进行数据校验,好处不言而喻:规范统一,低耦合度. 1.pom.xml <dependency> <groupId>org.hibern ...
- java编译期优化
java语言的编译期其实是一段不确定的操作过程,因为它可以分为三类编译过程: 1.前端编译:把.java文件转变为.class文件 2.后端编译:把字节码转变为机器码 3.静态提前编译:直接把*.ja ...
- [转]VMware Workstation网络连接的三种模式
经常要使用VMWare Workstation来在本地测试不同的操作系统,以前也搞不清楚网络连接三种模式,最近看了几篇文章才算明白.现总结如下: 1. VMware Workstation的虚拟网络组 ...
- scala环境配置
scala下载 解压 vim ~/.profile export PATH=~/dev/scala/scala-/bin:$PATH idea的scala插件这个由于太大,只能手工下载,注意下载的版本 ...
- ruby生成随机成绩
生成16个86到99范围内的值,并且每个成绩打印一行,这样就可以复制粘贴到Excel中! 16.times {|x| puts (86..99).to_a.sample}
- 简单了解undo
ORACLE 数据库 DML语句执行之前,会将数据块修改前的信息 镜像保存到 undo 段 insert语句 rollback 将会执行一条deleter操作 (相对数据量最小,只需利 ...