当前位置:网站首页>SPI配置
SPI配置
2022-07-26 20:16:00 【四季帆】
1. SPI中的CPOL和CPHA概念
经常会提及SPI分为四种模式:

以上模式仅针对SPI的时钟(SCK)来区分:
CPOL 也就是时钟的极性,用来表示SPI总线在空闲时SCK是低电平还是高电平,低电平为0,高电平为1;
CPHA 也就是时钟的相位,用来决定何时进行信号采样,在第一个跳变沿还是第二个跳变沿,在第一个跳变沿采样则为0,在第二个跳变沿采样则为1。
2. 多从机配置
多个从机可与单个SPI主机一起使用。从机可以采用常规模式连接,或采用菊花链模式连接。
2.1 常规SPI模式
在常规模式下,主机需要为每个从机提供单独的片选信号。一旦主机使能(拉低)片选信号,MOSI/MISO线上的时钟和数据便可用于所选的从机。如果使能多个片选信号,则MISO线上的数据会被破坏,因为主机无法识别哪个从机正在传输数据。

从上图可以看出,随着从机数量的增加,来自主机的片选线的数量也增加。这会快速增加主机需要提供的输入和输出数量,并限制可以使用的从机数量。可以使用其他技术来增加常规模式下的从机数量,例如使用多路复用器或串行转并行转换器产生片选信号。

2.2 菊花链模式
在菊花链模式下,所有从机的片选信号连接在一起,数据从一个从机传播到下一个从机。在此配置中,所有从机同时接收同一SPI时钟。来自主机的数据直接送到第一个从机,该从机将数据提供给下一个从机,依此类推。
使用该方法时,由于数据是从一个从机传播到下一个从机,所以传输数据所需的时钟周期数与菊花链中的从机位置成比例。例如在图7所示的8位系统中,为使第3个从机能够获得数据,需要24个时钟脉冲,而常规SPI模式下只需8个时钟脉冲。

3. 附件
3.1 菊花链模式的优点
菊花链最大的好处就是可以利用有限的信号传输线连接多台设备,共享同一服务,而且不存在总线竞争和阻塞等问题,因为在某设备把信号传递给下一个设备之前,可以修改这个信号。
3.2 菊花链模式的缺点
菊花链的最大缺点是因为是信号串行传输,所以一旦数据链路中的 某设备发生故障的时候,它下面优先级较低的设备就不可能得到服务了。
边栏推荐
- Rare discounts on Apple's official website, with a discount of 600 yuan for all iphone13 series; Chess robot injured the fingers of chess playing children; Domestic go language lovers launch a new pro
- 【MySQL系列】-索引知多少
- What is the role of cache in the storage system of data blocks?
- APaaS低代码平台(一) | 把复杂留给自己,把简单留给用户
- How to block the legendary GEE engine version? Close player account tutorial through script + engine
- 【打新必读】工大科雅估值分析,供热节能产品
- Svn uses fragmented ideas
- Installation and configuration of [basic services] [database] Clickhouse
- Relevant contents about wireless communication
- Apaas low code platform (I) | leave complexity to yourself and simplicity to users
猜你喜欢
随机推荐
Shell function, system function, basename [string / pathname] [suffix] can be understood as taking the file name in the path, dirname file absolute path, and user-defined function
7-year-old boy playing chess too fast? The robot actually broke its finger
LeetCode链表问题——19.删除链表的倒数第N个节点(一题一文学会链表)
Chapter 2: encounter obstacles! Bypass WAF filtering! [SQL injection attack]
微服务化解决文库下载业务问题实践
leetcode 哈希表类
Leetcode hash table class
没有网络怎么配置传奇SF登陆器自动读取列表
Is it reliable, reliable and safe to open an account with a low commission for funds in Galaxy Securities
idea中debug时如何进入指定的用户方法体中?
JDBC的连接
How to upload and download files
LeetCode_ Backtracking_ Medium_ 216. Combined sum III
Why can ThreadLocal achieve thread isolation?
[pytorch advanced] preservation and use of pytorch model
我们被一个 kong 的性能 bug 折腾了一个通宵
LeetCode_ Backtracking_ Medium_ 40. Combined sum II
Buu brush inscription 2
[Oracle training] - deploy Ogg known as zero downtime migration
Introduction to the billing function of wechat payment









