This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
如从机发的数据是:"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'
请问 如何解决?