HCS08QG8, How can I know a SPI's transmission is completed?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

HCS08QG8, How can I know a SPI's transmission is completed?

跳至解决方案
1,615 次查看
w_tension
Contributor III


I've took a look at status register, it contains 3-bits: Read buffer full flag, Transmit empty flag, Fault flag.

As I can see, transmit data register is empty doesn't mean "transmit complete",

Data may still in the shift register. If then I disable spi peripheral, error will occur.

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,435 次查看
scottm
Senior Contributor II

Have you tried checking the read buffer full flag?  A byte is clocked in with every byte that is clocked out, so by the time the received byte is marked complete your transmitted byte should be finished as well.  Keep in mind that you'll need to make sure the read full flag is cleared before you start the transmission.

Scott

在原帖中查看解决方案

1 回复
1,436 次查看
scottm
Senior Contributor II

Have you tried checking the read buffer full flag?  A byte is clocked in with every byte that is clocked out, so by the time the received byte is marked complete your transmitted byte should be finished as well.  Keep in mind that you'll need to make sure the read full flag is cleared before you start the transmission.

Scott