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;
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;
}