当前位置:网站首页>SPI master rx time out中断
SPI master rx time out中断
2022-07-07 13:29:00 【lixingdian】
背景:测试spi的time out中断,板子A master rx,板子B slave tx。master设置成超时中断TIME OUT。
slave发数据过来,master并没有触发超时中断。图像上很准确,开始担心是板子这个功能有问题,但是模拟的没问题。应该是设置问题。
模拟告诉我,清除fifo会清除time out寄存器。于是我在初始化的时候清除一次,后面就不会清除flfo。但实际上这样波形都不正确了,究竟是slave怎么把数据发给master。而且依旧触发不了中断,如果设置成done中断就可以触发。但就不是我们想要的time out中断了。模拟又告诉我说rx trigger level为空,设置数据会触发,设置后也无效,后来发现该位有数值限制,不能过大,过大会变成0。设置成正确的数字也无法触发中断。模拟又告诉我,传输数据时因为要接收的数据挺多的,cs一直拉低,会导致板子认为还在接收数据,会触发rxready中断,而不是time out中断。之所以要接收的数据挺多,是因为我的master设置SPI_DataLen为512(bits)了。在文档中解释:
Tx/Rx length
Spi在传输时,有效的SCK数
也间接的反映了发送或者接收数据的长度。
所以当我设置datalen为8以后,就可以触发正常的TIME OUT中断了。
后来看time out中断的文档,才发现自己文档读的不够详细。其实作者写的很清晰了。
当一次传输结束以后,rx fifo中有数据,但是数据量不够触发rx trigger level时,超过一定时间,就会触发time out寄存器。如果清除了fifo肯定也会清除掉调time out计数器。
所以要测试time out,需要
1、发数据的间隔时长长,长到接收完数据后足够触发完TIME OUT再清除fifo。
2、数据量小于rx trigger level,并且不会过多触发rx ready中断。
欢迎大家关注我的微信公众号
边栏推荐
- How to build your own super signature system (yunxiaoduo)?
- LeetCode2_ Add two numbers
- Cocos makes Scrollview to realize the effect of zooming in the middle and zooming out on both sides
- 无线传感器网络--ZigBee和6LoWPAN
- 【數字IC驗證快速入門】26、SystemVerilog項目實踐之AHB-SRAMC(6)(APB協議基本要點)
- Three. JS introductory learning notes 11:three JS group composite object
- 【微信小程序】Chapter(5):微信小程序基础API接口
- C4D learning notes 1- animation - animation key frames
- Monthly observation of internet medical field in May 2022
- 从 1.5 开始搭建一个微服务框架链路追踪 traceId
猜你喜欢
![[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)](/img/78/29eb8581e9a8fb4c6c7e1e35ad7adc.png)
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)

从 1.5 开始搭建一个微服务框架链路追踪 traceId

Starting from 1.5, build a microservice framework link tracking traceid

【数字IC验证快速入门】20、SystemVerilog学习之基本语法7(覆盖率驱动...内含实践练习)
![[quick start of Digital IC Verification] 26. Ahb-sramc of SystemVerilog project practice (6) (basic points of APB protocol)](/img/7e/188e57ee026200478a6f61eb507c92.png)
[quick start of Digital IC Verification] 26. Ahb-sramc of SystemVerilog project practice (6) (basic points of APB protocol)

unnamed prototyped parameters not allowed when body is present

LeetCode2_ Add two numbers

Super simple and fully automated generation super signature system (cloud Xiaoduo minclouds.com cloud service instance), free application in-house test app distribution and hosting platform, maintenan

The download button and debug button in keil are grayed out
![[Lanzhou University] information sharing of postgraduate entrance examination and re examination](/img/06/df5a64441814c9ecfa2f039318496e.jpg)
[Lanzhou University] information sharing of postgraduate entrance examination and re examination
随机推荐
Use of SVN
numpy--疫情数据分析案例
航運船公司人工智能AI產品成熟化標准化規模應用,全球港航人工智能/集裝箱人工智能領軍者CIMC中集飛瞳,打造國際航運智能化標杆
Yunxiaoduo software internal test distribution test platform description document
Spin animation of Cocos performance optimization
Learn good-looking custom scroll bars in 1 minute
Database exception resolution caused by large table delete data deletion
C4D learning notes 2- animation - timeline and time function
What is Base64?
unnamed prototyped parameters not allowed when body is present
Introduction of mongod management database method
持续创作,还得靠它!
Three. JS introductory learning notes 05: external model import -c4d into JSON file for web pages
The bank needs to build the middle office capability of the intelligent customer service module to drive the upgrade of the whole scene intelligent customer service
尤雨溪,来了!
Getting started with webgl (4)
有钱人买房就是不一样
Using eating in cocos Creator
Clang compile link ffmpeg FAQ
Three. JS introductory learning notes 07: external model import -c4d to JSON file for web pages -fbx import