Page 1 of 1

Default state of MOSI

Posted: Fri May 18, 2018 3:38 pm
by karlie
Hi!

I want to use SPI to read out a sensor with ESP IDF and freeRTOS.
The Problem is that the default state of MOSI (using logic analyzer)
is LOW whereas when I used arduino framework and Teensy 3.2 the default state was HIGH and it worked.

Where can I change this?

Cheers

Re: Default state of MOSI

Posted: Sat May 19, 2018 1:28 pm
by kolban
Howdy,
I'm afraid I don't understand (and its likely my problem). I have always assumed that an SPI slave ignored the incoming MOSI signal until its Chip Select (CS) was driven high and the clock pulse said "read MOSI". Until both of those are true, it shouldn't matter what signal appears on the MOSI line?

Re: Default state of MOSI

Posted: Tue May 22, 2018 8:29 am
by ESP_michael
Agree to kolban.
Some additions, ESP32 peripheral seems to keep the MOSI output of the last sent bit. If you really cares about the MOSI state when spi is inactive (CS high), please use some tricks to make sure the last bit is 1.
e.g. send 1 or 8 more ``0`` bits each transaction, or add a new device without CS line and use it to send fake transactions full of 0 after each real transactions.