Does SPI really need a wait loop?

I am using msp430f5418, with IAR Embedded workbench 5.10.

Graphic LCD (ST7565R) connects via SPI to MSP.

MSP Master uses 8-bit first MSB mode with SMCLK.

We usually have to check the busy bit before transferring the byte with SPI, right?

But for my case, even if I send data continuously without checking the busy bit, it works fine and I can view the displayed data correctly.

Can someone please explain why it works?

Is there a need to test the finished bit or is it safe?

Thank,

+3


source to share


1 answer


Your software is probably slow enough that the spi transaction ends every time. If you can verify that this is the case, and always will, then you can object to not adding more code to verify. Removing the code that does the check can speed up your procedure enough to be too fast for the spi interface and cause conflicts.



In general, you need to make sure that one thing ends before the other begins. And in general, as you can be sure, you can use hardware functions either through analysis or experimentation. If the hardware has a feature and you somehow determine that you don't need validation, it's still a good idea to run a performance test with and without validation. If performance isn't critical or there isn't much of a difference, it's still probably safer to leave a check somewhere on the road, even if your code is heavily warned, a compiler or code change may be enough to keep you from running without checking.

+4


source







All Articles