当前位置:网站首页>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中断。
欢迎大家关注我的微信公众号
边栏推荐
- LeetCode2_ Add two numbers
- Matlab experience summary
- 讲师征集令 | Apache SeaTunnel(Incubating) Meetup 分享嘉宾火热招募中!
- Super signature principle (fully automated super signature) [Yun Xiaoduo]
- Mesh merging under ue4/ue5 runtime
- The "go to definition" in VS2010 does not respond or prompts the solution of "symbol not found"
- numpy--数据清洗
- The rebound problem of using Scrollview in cocos Creator
- Three. JS introductory learning notes 0: illustration of how webgl and threejs work
- Three. JS introductory learning notes 15: threejs frame animation module
猜你喜欢
神经网络c语言中的指针是怎么回事
2. Heap sort "hard to understand sort"
Introduction of mongod management database method
【数字IC验证快速入门】26、SystemVerilog项目实践之AHB-SRAMC(6)(APB协议基本要点)
山东老博会,2022中国智慧养老展会,智能化养老、适老科技展
[quick start of Digital IC Verification] 22. Ahb-sramc of SystemVerilog project practice (2) (Introduction to AMBA bus)
Monthly observation of internet medical field in May 2022
The difference between full-time graduate students and part-time graduate students!
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)
Three. JS introductory learning notes 05: external model import -c4d into JSON file for web pages
随机推荐
Three. JS introductory learning notes 08:orbitcontrols JS plug-in - mouse control model rotation, zoom in, zoom out, translation, etc
Steps to create P8 certificate and warehousing account
Getting started with webgl (4)
Detailed explanation of Cocos creator 2.4.0 rendering process
Detailed explanation of unity hot update knowledge points and introduction to common solution principles
【数字IC验证快速入门】20、SystemVerilog学习之基本语法7(覆盖率驱动...内含实践练习)
【数字IC验证快速入门】23、SystemVerilog项目实践之AHB-SRAMC(3)(AHB协议基本要点)
Simple understanding and application of TS generics
Asynchronous application of generator function
Database exception resolution caused by large table delete data deletion
JS array foreach source code parsing
神经网络c语言中的指针是怎么回事
Clang compile link ffmpeg FAQ
Webgl texture
Create lib Library in keil and use lib Library
Zhongang Mining: Fluorite continues to lead the growth of new energy market
Nacos conformance protocol cp/ap/jraft/distro protocol
Write sequence frame animation with shader
Implementation of crawling web pages and saving them to MySQL using the scrapy framework
Three. JS introductory learning notes 10:three JS grid