您的位置: OpenADSP社区论坛 -> Blackfin专区 -> 新手上路 -> SPI程序继续求助
本帖共有767个阅读者
发表帖子 发表投票 回复主题
SPI程序继续求助
zhoumaicheng(论坛新手)
zhoumaicheng
头衔:社区公民
帮派:无帮无派
帖数:29
金钱:464
积分:54
注册时间:2012/7/10
楼主信息 | 留言 | Email | 主页 | 编辑 | 管理 | 离线
SPI程序继续求助

昨天那个程序的疑问 解决 了,但是我又把程序改了一下*pSPI_CTL = 0x1001|CPHA| CPOL把这个 指令中的0x1001改成0x1000,这时候 *pSPI_TDBR = 0x55; 这一步执行完,SPI-RDBR就 还是0000而不是00ff,怎么 回事情?SPI_CTL当中的TIMOD是怎么回事情?

还有我把0x1001改成1101运行*pSPI_TDBR=0x55的时候SPI_RDBR变成0xffff;能解释一下SPI_CTL的SIZE那位到底怎么 用么?


喜欢学习
等级:论坛新手 参考IP地址:*.*.*.*
2012/7/22 13:35:56
尊贵身份标志
andy(论坛版主)
andy
头衔:社区公民
帮派:无帮无派
帖数:2287
金钱:11132
积分:2263
注册时间:2011/6/8
1信息 | 留言 | Email | 主页 | 编辑 | 管理 | 离线

帮助文件中针对TIMOD的解释:

The TIMOD field is used to specify the action that initiates transfers to/from the receive/transmit buffers. When set to 00, a SPI port transaction is begun when the receive buffer is read. Data from the first read will need to be discarded since the read is needed to initiate the first SPI port transaction. When set to 01, the transaction is initiated when the transmit buffer is written. A value of 10 selects DMA Receive mode and the first transaction is initiated by enabling the SPI for DMA Receive mode. Subsequent individual transactions are initiated by a DMA read of the SPI_RDBR. A value of 11 selects DMA Transmit mode and the transaction is initiated by a DMA write of the SPI_TDBR.

你在00模式,直接读取SPI-RDBR中的数据看看数据是否有变化。

SIZE位为16bit和8bit选择,设置后每次操作的数据为16bit, 所以变为0xffff


这家伙很懒,什么也没有留下!
等级:论坛版主 参考IP地址:*.*.*.*
2012/7/22 13:48:36
Powered by OpenADSP Copyright © 2010 www.Openadsp.com. All rights reserved.159448 Call, 1 Queries, Processed in 0.016602 second(s),