I2C multibit master pulls port low on XEF232

Technical questions regarding the XTC tools and programming with XMOS.
nippoo
Member
Posts: 8
Joined: Tue Sep 12, 2023 11:43 pm

I2C multibit master pulls port low on XEF232

Post by nippoo »

Hi,

We're trying to bring up a custom board based on an XEF232-1024-FB374.

The board comes up fine and is flashable, but we're failing to make I2C work on a multibit port (4E2 and 4E3 on tile 2).

We have confirmed that the port functions electrically: the following code DOES work:

Code: Select all

i2cIOPort <: 0xf;
delay_seconds(1);
i2cIOPort <: 0x0; 
and rises to the full 3.3V, so no other device is pulling the port low. We've also probed the I2C bus with an external device and it all functions correctly.

The following code does not - it just pulls both SCL and SDA low, as soon as i2c_master_single_port() is executed, and no toggling of either SCL or SDA is seen.

Any advice or leads?

Code: Select all

#include <xs1.h>
#include <platform.h>

#include <i2c.h>
#include <debug_print.h>

on tile[2]: port i2cIOPort = XS1_PORT_4E;

void test_i2c(client i2c_master_if i2c) {
  uint8_t data[2] = {0};
  while (1){
    i2c.read(0x28, data, 2, 1);
    debug_printf("Read data %d, %d from the bus.\n", data[0], data[1]);
  }
}

int main(void) {
  interface i2c_master_if i2c[1];
  par {
    on tile[2]: i2c_master_single_port(i2c, 1, i2cIOPort, 100, 2, 3, 0);
    on tile[2]: test_i2c(i2c[0]);
  }
return 0;
}
The proper pull-ups are included, see schematic excerpt:
Screenshot 2025-01-10 at 17.01.14.png
You do not have the required permissions to view the files attached to this post.
User avatar
lukehatpadl
Active Member
Posts: 37
Joined: Sat Jul 08, 2023 5:15 am

Post by lukehatpadl »

Replying on nippoo's behalf, turned out this was resolved by doing xmake clean.

I must say xmake (particularly when used with -j9) is not always completely deterministic :)