Bidirectional Port

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
Posts: 1
Joined: Mon Sep 04, 2017 2:45 pm

Bidirectional Port

Postby mehranpour » Mon Sep 04, 2017 3:13 pm

I have a basic question about Bidirectional GPIO on Multi bit ports.
I want to implement Bidirectional GPIO But it is not possible in multi-bit ports(?) According to I2c Application in multi-bit ports I want to check if I can use I2C structure. is there anyone who has any idea?

Thanks in advance.
User avatar
XCore Addict
Posts: 145
Joined: Tue Mar 26, 2013 12:10 pm

Postby johned » Tue Sep 05, 2017 9:01 am

Hi mehranpour,
This functionality is different between XS-1 and xCORE-200.
Please see the documentation here : ... rc3%29.pdf
Specifically :
Function i2c_master_single_port
Description Implements I2C on a single multi-bit port.
This function implements an I2C master bus using a single port. However, If this
function is used with an L-series or U-series xCORE device then reading from the
bus and clock stretching are not supported. The user needs to be aware that these
restriction are appropriate for the application. On xCORE-200 devices, reading and
clock stretching are supported.

User avatar
XCore Expert
Posts: 764
Joined: Thu Dec 10, 2009 9:20 pm

Postby Ross » Tue Sep 12, 2017 11:11 am

I think there is some confusion here, I *think* the question is just can you do bidi on multiple-bit ports. The answer is yes, on any XMOS device:

port p = XS1_PORT_4A:


// Read from p into x
int x;
p :> x

// Write x back out to p
p <: x

(the I2C issue mentioned related to having SDA and SCL on one single multi-bit port and is related to drive mode restrictions on XS1)

Who is online

Users browsing this forum: No registered users and 12 guests