I'm looking for a way to leave the MOSI signal high on a Raspberry Pi during an SPI transaction. I have an Si8902 ADC which reads voltage from a PCB, and its pins are connected to the appropriate pins on my Raspberry Pi 3. I have the pins connected to an oscilloscope, so I know that the connections are correct, all I need to do is manually control the MOSI pin during an SPI transaction. Basically, the Si8902 chip requires that the controller signals look like this:

enter image description here

As you can see, the EN pin goes low to initiate communication, the SDI (also known as MOSI) transmits the first set of data, the SCK does it's thing, and the SDO reads the input. I have tried every SPI Mode, and searched countless forums, but it appears that the trick is to keep SDI (MOSI) high.

I have tried using both the WiringPi and bcm2835 libraries, which correctly transmits data using the SPI protocol (unfortunately the Si8902 doesn't use standard SPI comms), but I would like to leave SDI high for the duration of the transaction.

Is there a way I can control the SDI pin during an SPI transaction on the Raspberry Pi Model 3? The alternative is that I write an entirely manual SPI library but I really would rather not do that!

Thanks in advance.

1 Answer 1


Yes, set it high!

MOSI is master out serial in. The line will be in the state you tell it to be in. Transmit 1 bits continuously.

E.g. transfer 0xff in each byte while you want MOSI high.

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .