Webserial, Byte Communication for I2C Writing / Reading #149
|
I have an M5StickCPlus2 = v 1.4 Bus Pirate and I have a Xaio with v 1.6 Bit Pirate I am able to connect via WebSerial and successfully do I2C Transactions but done as bytes representing ascii. I am wanting instead to send communication as bytes to perform i2c reads and writes.
M5StickCPlus I was able to load the FW but only been successful via the M5Stack Burner Utility. Version on there is v 1.4, if there is a newer version for this device, can you point me to it?
|
Replies: 3 comments 1 reply
|
You are currently using the WebSerial terminal, so what you send is parsed as text/ASCII commands. For normal I2C use, switch to I2C mode and use the CLI commands: If you want something closer to byte-level control, use the instruction syntax, scripting lab or web bit bang controller, see docs https://github.com/geo-tp/ESP32-Bit-Pirate/wiki/05-I2C Web tools related: For the M5StickCPlus2, it is no longer supported, you can still use the latest available version (on M5Burner) |
If you need a build more recent than the one in the official release, you need to compile it from source.
I am not sure you need a newer version just to read/write to an I2C device. You send 0x0A and 0x01 to an I2C device at adress 0x0D |
|
There are two separate paths here: the terminal/CLI is still ASCII input, even when you type hex values; the firmware parses those tokens and performs the I2C transaction. For a more byte-oriented I2C transaction from the CLI, use the bracket sequence syntax: For an actual adapter-style workflow, switch the device into the BPIO2 GPIO/SPI/I2C USB adapter, then reconnect with the BPIO2 web tool instead of the terminal: In BPIO2 I2C, use 7-bit address + “Write bytes” + “Read length”; for register reads, put the register address in “Write bytes” and set the read length. I2C uses IO1=SCL and IO2=SDA in that adapter mode. (geo-tp.github.io) If my answer solved your problem, please mark it as answered the question — I'm here to help, and honestly I'm also collecting Galaxy Brain badges along the way 😆 |
There are two separate paths here: the terminal/CLI is still ASCII input, even when you type hex values; the firmware parses those tokens and performs the I2C transaction. For a more byte-oriented I2C transaction from the CLI, use the bracket sequence syntax:
For an actual adapter-style workflow, switch the device into the BPIO2 GPIO/SPI/I2C USB adapter, then reconnect with the BPIO2 web tool instead of the terminal:
In BPIO2 I2C, use 7-bit address + “Write bytes” + “Read length”; for register reads, put the register addres…