Running SPI, I2C in the same 8-bit port

If you have a simple question and just want an answer.
User avatar
marcoandarcia
Member++
Posts: 16
Joined: Wed Apr 15, 2015 9:31 am

Running SPI, I2C in the same 8-bit port

Post by marcoandarcia »

Hello everyone, 

I am using a Somanet C22 Board that uses an XS1-L16A-128 XMOS. 

I would like to know if this XMOS architecture allows you to run a SPI channel and I2C interface in the same 8-bit port. I am not even sure I can run a SPI channel in an 8 bit port. I read on the datasheet the following which leads me to believe you can't have MISO and MOSI in the same  8-bit port.  I found this post(http://www.xcore.com/forum/viewtopic.ph ... shared+i2c) on the forum but it seems to contradict itself saying that there is a github example(which I could not find) and then they say is not possible without some hardware hacking. 

 



Thanks in advance!

 

Guest

Post by Guest »

You can configure the port as output port and drive the data out. You can read the data on the same port using peek() function (defined in xs1.h.) and perform bit masking to achieve the desired functionality.