- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Every body,
I am doing SPI communication between Pi and PSOC 5LP.
I placed a command
while(!(SPIS_ReadTxStatus() & SPIS_STS_SPI_DONE));
But by doing this, my program just takes too long to fulfill the condition and when I replace the above condition with just:
while(!(SPIS_STS_SPI_DONE));
It does not!
I wonder why it is behaving so wierd?
Looking forward to your answers!
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
while(!(SPIS_STS_SPI_DONE));
The above is testing a constant value for zero. SPIS_STS_SPI_DONE is a #defined value to check for a bit pattern. Checking with
while(!(SPIS_ReadTxStatus() & SPIS_STS_SPI_DONE));
will indeed consume MIPS. Think about to use a "callback macro". Look for that term in SPI datasheet and in Creator help.
Bob