SPI three-wire mode

If you have a simple question and just want an answer.
User avatar
ahenshaw
Experienced Member
Posts: 96
Joined: Mon Mar 22, 2010 8:55 pm

SPI three-wire mode

Post by ahenshaw »

Correct me if I'm wrong, but I don't believe the SPI softIP supports three-wire (half-duplex) mode.  Has anybody implemented this?  I need it for interfacing with a DS1302 real-time clock module.

 



User avatar
xsamc
Active Member
Posts: 55
Joined: Fri Mar 04, 2011 3:38 pm

Post by xsamc »

You're correct, the xSOFTip SPI component (sc_spi) does not currently support three-wire buses.

It should be possible to use the current component as a starting point for a three-wire bus master, using a single data line rather than MISO and MOSI lines, but this will involve either avoiding the use of buffered ports, or safely changing the direction of a buffered port on the fly (depending on the performance requirements of your application).

The quad SPI module within the sc_flash repository (https://github.com/xcore/sc_flash/tree/ ... _spi_flash) makes use of a single buffered port for data, and demonstrates how to turn the port around safely.