SPI有关CPOL和CPHA的时序图
SPI模块为了和外设进行数据交换,根据外设工作要求,其输出串行同步时钟极性和相位可以进行配置。
时钟极性(CPOL)对传输协议没有重大的影响。
- 如果CPOL=0,串行同步时钟的空闲状态为低电平;
- 如果CPOL=1,串行同步时钟的空闲状态为高电平。
时钟相位(CPHA)能够配置用于选择两种不同的传输协议之一进行数据传输。
- 如果CPHA=0,在串行同步时钟的第一个跳变沿(上升或下降)数据被采样;
- 如果CPHA=1,在串行同步时钟的第二个跳变沿(上升或下降)数据被采样。
SPI主模块和与之通信的外设音时钟相位和极性应该一致。高位先传输,低位后传输。
【Clock polarity and phase】
In addition to setting the clock frequency, the master must also configure the clock polarity and phase with respect to the data. Freescale's SPI Block Guide names these two options as CPOL and CPHA respectively, and most vendors have adopted that convention.
The timing diagram is shown to the right. The timing is further described below and applies to both the master and the slave device.
• At CPOL=0 the base value of the clock is zero
- For CPHA=0, data is captured on the clock's rising edge and data is propagated on a falling edge.
- For CPHA=1, data is captured on the clock's falling edge and data is propagated on a rising edge.
• At CPOL=1 the base value of the clock is one (inversion of CPOL=0)
- For CPHA=0, data is captured on clock's falling edge and data is propagated on a rising edge.
- For CPHA=1, data is captured on clock's rising edge and data is propagated on a falling edge.
That is, CPHA=0 means sample on the leading (first) clock edge, while CPHA=1 means sample on the trailing (second) clock edge, regardless of whether that clock edge is rising or falling. (CPHA=0,表明在第1个时钟跳变沿采集数据;CPHA=1,表明在第2个时钟跳变沿采集数据。)
Note that with CPHA=0, the data must be stable for a half cycle before the first clock cycle. For all CPOL and CPHA modes, the initial clock value must be stable before the chip select line goes active.(无论CPOL和CPHA是什么模式,在SS信号线有效之前,必须先初始时钟SCK线为稳定状态。)
The MOSI and MISO signals are usually stable (at their reception points) for the half cycle until the next clock transition. (MOSI和MISO在下一个时钟传输前应该保持稳定至少半个周期)
SPI master and slave devices may well sample data at different points in that half cycle.
This adds more flexibility to the communication channel between the master and slave.
Some products use different naming conventions. For example, the TI MSP430 uses the name UCCKPL instead of CPOL, and its UCCKPH is the inverse of CPHA. When connecting two chips together, carefully examine the clock phase initialization values to be sure of using the right settings.
【Timing diagram:(SPI中有关CPOL和CPHA的时序图)】
A timing diagram showing clock polarity and phase.
The red vertical line represents CPHA=0 and the blue vertical line represents CPHA=1.
SPI有关CPOL和CPHA的时序图的更多相关文章
- SPI总线协议及SPI时序图详解
SPI,是英语Serial Peripheral Interface的缩写,顾名思义就是串行外围设备接口.SPI,是一种高速的,全双工,同步的通信总线,并且在芯片的管脚上只占用四根线,节约了芯片的管脚 ...
- SPI总线协议及SPI时序图详解【转】
转自:https://www.cnblogs.com/adylee/p/5399742.html SPI,是英语Serial Peripheral Interface的缩写,顾名思义就是串行外围设备接 ...
- 如何看懂时序图,以DHT21为例
有很多传感器手册给了我们时序图,我们只要按照时序图操作就行了,还有一些是标准接口,例如SPI,IIC,UART,这些可以利用硬件提供的收发器通信,还有一些我们没有足够的接口,或者没有对应的接口与之通信 ...
- [UML]UML系列——时序图(顺序图)sequence diagram
系列文章 [UML]UML系列——用例图Use Case [UML]UML系列——用例图中的各种关系(include.extend) [UML]UML系列——类图Class [UML]UML系列——类 ...
- 使用Astah制作UML时序图
Astah制作UML图--详解 时序图的制作 开篇语: 本文为光荣之路原创文章,欢迎转载,但请注明出处. 做测试的难免看到开发画出各种设计图,都很羡慕,比如: 帅么,漂亮么,其实我们测试人员也可以轻松 ...
- GIT FLOW 时序图
git flow sequence md link: git branching model master->master branch: use default branch Note rig ...
- [转载]UML时序图总结
前言 在我的工作中,用的最多的就是时序图了.可能由于工作的原因,我也是最喜欢画时序图了,很清楚,很明了,什么时候发送什么消息,到达什么状态,一下子就展示在你的脑海里,对于消息驱动的程序来说,是再好不过 ...
- 看懂UML类图与时序图
看懂UML类图和时序图 这里不会将UML的各种元素都提到,我只想讲讲类图中各个类之间的关系: 能看懂类图中各个类之间的线条.箭头代表什么意思后,也就足够应对 日常的工作和交流: 同时,我们应该能将类图 ...
- UML系列04之 UML时序图
概要 本章对UML的时序图进行介绍,主要内容包括:时序图介绍时序图组成 转载请注明出处:http://www.cnblogs.com/skywang12345/p/3523355.html 时序图介绍 ...
随机推荐
- linux LVM详解
1.创建及删除步骤1)创建:linux partition-->pv-->vg-->lv-->fs-->mount2)删除:umount-->lv-->vg- ...
- MySQL的SQL语句
一. MySQL概念 程序 =数据+指令构成,如果下载1个程序需要连带该程序所有代码+数据下载到本地,那这个程序运行起来势必造成本机内存压力暴涨,所以我们需要1个在远程server端帮我们管理数据的软 ...
- 把旧系统迁移到.Net Core 2.0 日记(11) -- Authentication 认证 claimsIdentity 对比 之前的FormAuthentication
实现最简单的认证,类似之前的FormAuthentication 在 Startup 的 ConfigureServices() 方法中添加 Authentication 的配置: 这个CookieA ...
- Java并发编程(五)JVM指令重排
我是不是学了一门假的java...... 引言:在Java中看似顺序的代码在JVM中,可能会出现编译器或者CPU对这些操作指令进行了重新排序:在特定情况下,指令重排将会给我们的程序带来不确定的结果.. ...
- MFC CDHtmlDialog 加载本地资源
步骤:1.资源视图 项目右击选择资源添加,自定义添加新类型 如:JS(会增加JS文件夹)2. 选择1新建的文件夹右击 添加资源 导入 选择js文件引入3. 在资源文件Resource.h文件夹能找到资 ...
- ubuntu下唤醒或休眠远程计算机
ubuntu让我明白,没有什么完美的东西,要想完美必须付出代价.要么花时间折腾,要么花时间赚钱买系统. 人生也是一样,所以不要期待什么完美.哪有那么好的人,在合适的时间合适的地点让你遇见,还对你有感觉 ...
- GitHub下的文件放到Linux系统下
1.在GitHub账号下clone URL 项目. 2.到Linux服务器下执行以下操作: (1) mkdir test (2) cd test/ (3) git clone 复制的项目URL
- 普通程序员,三年成为年薪70w架构师,只因做到了这些
每个程序员.或者说每个工作者都应该有自己的职业规划,如果你不是富二代,不是官二代,也没有职业规划,希望你可以思考一下自己的将来.今天给大家分享的是一篇来自阿里Java架构师对普通程序员的职业建议,希望 ...
- RabbitMQ direct类型的Exchange
就目前来说,Exchange是与消息发送端有关的,因为它可以指定将消息发送到哪个或哪些队列中. 本篇文章介绍的direct类型就是指定将消息定向发送到哪个队列中. direct,顾名思义,就是直接的意 ...
- Android : iperf-2.0.4 网络测试工具
一.源码下载及交叉编译: 下载:https://pan.baidu.com/s/1i6NYDF3 //包含linux和windows上的可执行文件 1. 解压后获得perf-2.0.4源码.2. ...