hi i am a student tryin to read the data between two spi devices by tapping the lines in the middle please help me if anyone hav a code to read the ss,mosi,miso,sclk signals using GPIO they vl jst act lyk input port n read
You totally forget that SPI is a synchronous transfer. Your code does not tick forward in sync with the clock signal. And should you step time (increment i) even when no slave select?
And you have a bit of duplicated code in there.
By the way - what is the meaning of the magic number 18? Does it in any way relate to the data you are sniffing?