cancel
Showing results for 
Search instead for 
Did you mean: 

Confused over SPI/I2S MISO/MOSI terminology for I2S Slave

anonymous.8
Senior II
Posted on January 18, 2017 at 20:49

Hi, I am implementing an I2S Audio interface using the SPI2 peripheral on an

STM32F746NGH6

(STM32F7 Discovery Board). I find ST's terminology of MOSI/MISO confusing because it all depends on if the peripheral is an SPI master or slave as to which pin is an output and which pin is an input. The STM32F745/6 reference manual, page 1050, states '

MISO:

Master In / Slave Out data. In the general case, this pin is used to transmit data in slave mode and receive data in master mode.' They also have this internal crossover switch between the MISO and MOSI pins just to confuse things even more!

In particular, my I2S interface needs to be configured in I2S Slave mode, i.e. the BITCLK and LRCLK pins are inputs while the Serial DATA OUT pin remains, of course, an output. However, the Alternate Function pin mapping table on page 78 of the datasheet says that pin PB15 has the AF function I2S2/SD function. But that is the MOSI pin which, according to STM's documentation, is a slave input, not a slave output.

I wish they'd just do away with the whole MOSI/MISO terminology altogether and just use the pin name SDI for Serial Data In and SDO for Serial Data Out like Microchip does. Then we'd easily know which pin to use.

So my question is this - for an I2S Slave interface do I use the MOSI Pin on PB15 as my Serial Data Out to the DAC, or do I use the MISO pin on PB14?

Thanks.

#spi
2 REPLIES 2
Posted on January 18, 2017 at 21:03

the Serial DATA OUT pin remains, of course, an output.

Of course, that is not 'of course'. If you connect to a DAC it's output, but if you connect to an ADC it's input.

In I2S mode the SPI nomenclature is not valid; in I2S mode the direction of the single I2S data pin I2Sx_SD is given by the SPI_I2SCFGR. I2SCFG. If it's receiver (master or slave), the pin is input; otherwise it's output.

JW

Posted on January 18, 2017 at 21:12

Thanks for that.