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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
577 Views
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.

Labels (1)
Tags (2)
0 Kudos
1 Solution
397 Views
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

View solution in original post

1 Reply
398 Views
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