Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I am having trouble with SPI routine in my code. This code was ported over from a STM32 to PSOC and is almost running but I am having trouble with the SPI (which is integral to the project). The 5LP connects to a Radio module and sends/receives data and commands via spi.
It first sets spi to low rate to configure a couple of registers and then high rate. I have used DMA to get rid of inter-digit delays.
There is a little routine called "TestSPI()" in main that I call from various points in the code to check the SPI is working correctly. It works perfectly fine and gives expected results until line 100 (A while loop reading status register).
If I call TestSpi before this line it is fine, call it after line 100 and I get rubbish returned in TestSpi.
If I put a 100ms delay after the while statement then I get correct results, but of course I am not able to delay the code here when the application is running.