SPI 2 input wires

Hi folks,

I want to read on both data wires of SPI0 (P9_18,P9_21). I am currently using C++ and spidev.h to do the “normal” thing, now my question is how deep do I have to go for allowing data to be read at both pins. I guess I have to modify at least the ioctl() command, but I don’t have any idea where I could do this. Hope you can give a hint.

Best regards
Rafael Fiebig-Bindner

Screw the question above, I dug into the issue something more and now I wonder if it is even possible? According to the processor data sheet it uses a shift register, which is filled from one register for write and fills another register for read. Now can I reverse this direction on the write command so it fills both registers?

Screw the question above, I dug into the issue something more and now I wonder if it is even possible? According to the processor data sheet it uses a shift register, which is filled from one register for write and fills another register for read. Now can I reverse this direction on the write command so it fills both registers?

You cannot. You have to use two SPI interfaces if you want to receive simultaneously or you have to use on SPI with two chip selects and then alternate the receiving of each channel. The way SPI works is that it shifts bits out of MOSI and simultaneously shifts bits into MISO.

Regards,
John

Thank you John, I’ll then just Bitbang with GPIOs.

Thank you John, I’ll then just Bitbang with GPIOs.

Use the PRU for Bitbang or it will be very slow.

Regards,
John