Question

I am using msp430f5418, with IAR Embedded workbench 5.10.

A Graphical LCD (ST7565R) is connected through SPI into the MSP..

MSP master uses 8-bit, MSB first mode with SMCLK.

Normally we have to check the busy bit before transferring a byte using 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 display data correctly.

Can anybody explain why is it working??

Is there any need to check for the ready bit or is it safe??

Thank you,

Was it helpful?

Solution

Your software is probably slow enough that the spi transaction completes every time. If you can verify that that is the case and always will be the case then you can argue not to add even more code to do the check. Removing the code that does the check might speed up your routine just enough to be too fast for the spi interface and cause collisions.

In general you should make sure one thing finishes before another starts. And in general how you make sure can be to use hardware features or through analysis or experiments. If the hardware has the feature and you somehow determine you dont need the check it is still a good idea to do a performance test with and without the check. If the performance is not critical or there isnt much difference it is still probably safer to leave the check in, somewhere down the road, even if your code is heavily commented with warnings, a compiler or code change might be just enough to have it not work without the check.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top