Other Parts Discussed in Thread: TPS65400,
Hello Francis / Max,
I'm trying to establish i2c communication b/w ftdi and tps65400. I face the same issue mentioned i.e. I could select particular mux channel of tca9548a but not able to access the slave since SCx not toggling.
Rough python code is here (It would be helpful if you suggest config sequence)
from i2c import *
from pyftdi.i2c import *
import time
i2c = I2cController()
i2c.configure('ftdi://ftdi:2232h/1', clockstretching=False) ### ftdi://ftdi:2232:FT2Y4V6J/1
results = i2c.poll(address = 0x70, write=False, relax=True)
print(results)
slave = i2c.get_port(0x70)
print(slave)
time.sleep(0.00001)
print(slave.frequency)
print(slave.address)
slave_2 = i2c.get_port(0x69) #Based on the resistor value used and the address mentioned in the datasheet
print(slave_2)
print(slave_2.address)
slave.write(out=b'\x80', relax=False, start=True) # channel 4 of mux --> this could be read back
slave_2.write_to(regaddr=0x00, out = b'\x00', relax = False, start = True) #PAGE 0 slave2 tps65400 doesn't ack
Note:
Bypassing mux, I'm able to communicate to tps65400.
ftdi, i2x mux are on one board. tps65400 is in separate board.
Bypassing mux code here
from i2c import *
from pyftdi.i2c import *
import time
#
i2c = I2cController()
i2c.configure('ftdi://ftdi:2232h/1', clockstretching=False) ### ftdi://ftdi:2232:FT2Y4V6J/1
# Get a port to an I2C slave device
# for i in range(20):
results = i2c.poll(address = 0x69, write=False, relax=True)
print(results)
slave = i2c.get_port(0x69) #Based on the resistor value used and the address mentioned in the datasheet
print(slave)
# slave.write(out = b'\x11', relax = True, start = True)
slave.write_to(regaddr=0x10, out = b'\x00', relax = True, start = True) #disable WRITE_PROTECT