For testing, I try to read register 0 as the value never changes, I know what I should read.
After, when writeRegister (done with your great help) and readRegister (not working) functions will be operationnal, I will have to read register 3 to know button state.
Of course, I will share code when it’s working (it could even be a sample for non duelink module).
fn ReadR(a,r)
Dim B1[]=[r]
Dim B2[]=[0]
# Write 2 bytes to adress and read nothing
DLI2CWr(a,B1,[])
DLI2CWr(a,[],B2)
return B2[0]
fend
From a Fez Pico, with TinyClr, I can read the ID:
var writeBuffer = new byte[] { 0x00 };
var readBuffer = new byte[] { 0x00 };
var settings = new I2cConnectionSettings(0x6F, 400_000); //The slave's address and the bus speed.
var controller = I2cController.FromName(SC13048.I2cBus.I2c1);
var device = controller.GetDevice(settings);
device.Write(writeBuffer); //This is good for reading register
device.Read(readBuffer); //This is good for reading register
Debug.WriteLine("Read: " + readBuffer[0].ToString("X"));
No worries, we ordered a few modules to test. I am very curious myself because everything looks fine with the other boards we tested but we couldn’t find the sparkfun button.
I just received some modulino modules and I can write just fine but I can’t get read to work. Maybe I am doing something wrong but I do not have an analyzer at home to check.
I also tried Sparkfun Qwiic joystick and also no luck. I am guessing we have a bug in restart conditions.
This is bad news but I think this a good news too: GHI team will find a solution ! I suspect that it is a “software bug” (easier to correct as “hardware bug”).
@Bauland turned out we have a bug in how we handle clock stretching. The devices we have used before did not use clock stretching. We teste this sparkfun qwiic joystick, not button. It should work now but we need to to check and confirm please.