This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPIS Data Integrity Check

Hello nordicsemi community. I'm trying to use the SPIS example provided in the NRF52 SDK to receive data from another SPI master running on an FPGA. I modified the code to receive 121 byte transactions. Currently each byte consists of a number which is sequentially increased by one in order to provide predictable data. After every SPI transaction I keep count on the microcontroller and check if the current received count matches the expected count. If an SPI transaction had a data mismatch I toggle an LED on the board. At low SPI speeds (around 10Khz) everything appears to be working fine. However, as soon as I go to higher SPI speeds It appears that data is being skipped and or overwritten in the buffer (the count on the microcontroller and the received count do not match). I believe this might be due to the micro controller not being able to check the data as fast at it is receiving it, does this make sense? If so, is there a better way to make sure that all data is properly being received? I tried logging mismatches into the debug console but this also appears to ruin the timing. 

Related