Default state of MOSI

Posts: 1
Joined: Wed May 16, 2018 9:50 am

Default state of MOSI

Postby karlie » Fri May 18, 2018 3:38 pm


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?


User avatar
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Default state of MOSI

Postby kolban » Sat May 19, 2018 1:28 pm

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?
Free book on ESP32 available here:

Posts: 15
Joined: Mon Aug 28, 2017 10:25 am

Re: Default state of MOSI

Postby xiaoxufeng » Tue May 22, 2018 8:29 am

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.

Who is online

Users browsing this forum: No registered users and 15 guests