微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI Zigbee设计交流 > 两个cc2538 用ssi0通信,一个配成spi主机,一个配成spi从机. 每次 spi主机接收数据的 前8字节变成 '\0'

两个cc2538 用ssi0通信,一个配成spi主机,一个配成spi从机. 每次 spi主机接收数据的 前8字节变成 '\0'

时间:10-02 整理:3721RD 点击:

如从机发的数据是:"Hello,world!This is slave",
主机接收到是 '\0''\0''\0''\0''\0''\0''\0''\0'Hello,world!This

根据cc2538用户手册 swru319c.pdf 第19.4.2.1节:

In slave mode, the SSI transmits data each time the master initiates a transaction. If the TX FIFO is empty
and the master initiates, the slave transmits the eighth most-recent value in the transmit FIFO. If less than
eight values are written to the TX FIFO since the SSI module clock was enabled using the SSI bit in the
SYS_CTRL_RCGCSSI register, then 0 is transmitted. Take care to ensure that valid data is in the FIFO
as needed. The SSI can be configured to generate an interrupt or a µDMA request when the FIFO is
empty.


我的理解:

从机模式时,在使用SYS_CTRL_RCGCSSI 寄存器的SSI 位使能 ssi模块时钟后,当主机初始化一个数据交换,如从机的 TX FIFO
一直未被填入数据 或 填入的少于8个字节,此时从机调用 SSIPutData() 向 TX FIFO 写入数据,主机就会先收到 8个 '\0' ?

是否这样?

尝试过 从机 先调用 SSIPutData()函数向 TX FIFO 写入9字节数据,然后再通知 主机接收数据,但主机 接收到的数据前8字节依然是'\0'


请问 如何解决?

TI ZigBee协议栈里面,针对CC2538工程里面,关于对LCD的操作,用的是SPI的通信,是否可以参考下。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top