AnsweredAssumed Answered

3 Wire SPI Working

Question asked by Muhammad Waqas Athar on Apr 29, 2013
Latest reply on Apr 30, 2013 by Pavel Chromy
Branched to a new discussion

Hello guys,

Hope you are having fun using mqx.

I have a question regarding getting SPI to work with 3 Wire SPI slave device.

I want to interface graphics lcd with my Kinetis K60 board.On my board , MOSI is connected to slave's SDA( Slave SPI data pin ) using 10k register. and MISO is connected directly to SDA. According to slave datasheet, master device should float SDA pin during read operation.What i am assuming is that master would output 16 clock pulses ( 2 bytes )  with 1st byte containing read command  from master and 2nd byte would contain valid data from slave. now my question is

1 : How to run spi in half duplex mode. ie disable tx or float SDA pin during read operation.

2 : Do i have to disable spi mosi pin using port control to stop it from sending any data on MOSI during 2nd byte read operation.

3: Do i have to pull up/down spi mosi pin using port control settings to float that pin.

 

I tried mqx spi driver both with FULL/Half Duplex settings, but unfortunately using fread/fwrite in both cases send and receive data simultaneously.

I have also checked K60 reference manual  , there they have written in spi features that it supports three-wire synchronous transfer but i cannot find anything in spi registers. neither they have any info how to disable tx or rx or make it work in half duplex mode.

 

Does anyone know how to interface and talk to 3 wire compatible slave using K60. How do i make it work. 

Any help in this regard would be appreciated.

 

Regards

Outcomes