Generic I2C GUI?? - Page 1
Forum section: electronics / projects

author: Mario87
author_rank: Frequent Contributor
timestamp: March 12, 2022, 12:40:45 am
content: Hi all,Not sure if this is the best place to put this, but was wondering if anyone has any links to any good generic I2C GUI tools?There is one mentioned by Renesas here that looks perfect:https://www.renesas.com/us/en/document/oth/i2c-gui-tool-user-guideHowever I cannot find a download for the software itself anywhere. Looks like that works with a cheap FTDI FT232H device such as this adafruit unit:https://thepihut.com/products/adafruit-ft232h-breakout-general-purpose-usb-to-gpio-spi-i2cIdeally looking for something like what I have shown above, a simple GUI that lets you connect to an I2C device, read / write individual bytes as well as blocks and doesn't require expensive tools, but can also interface with cheap I2C USB devices such as the Adafruit unit.Thanks

author: DavidAlfa
author_rank: Super Contributor
timestamp: March 12, 2022, 02:04:18 am
content: Neoprogrammer supports scripts, you can use a cheap CH341 and send simple i2c and SPI commands (read, write.. )

author: free_electron
author_rank: Super Contributor
timestamp: March 12, 2022, 03:14:14 am
content: https://www.renesas.com/us/en/products/power-power-management/power-management-ics-pmic-and-pmus/usb-bridgev2-eval-usb-i2c-donglehttps://i2ctools.com/our-clients-customers/idt-inc/

author: Mario87
author_rank: Frequent Contributor
timestamp: March 12, 2022, 10:09:17 pm
content: Thanks to both. However, in the end I managed to find some Arduino code that mostly does the job (did all the write functionality) and then some other code that worked for reading. Put the 2 together and now I can read & write individual bytes from the Arduino serial monitor.Full code listed below incase anyone wants to use it. Have confirmed with the logic analyser that it works as it should.Original link for the code that can write via serial monitor:https://github.com/DinoTools/Serial-I2C-TesterOriginal link for the code that can read via serial monitor (it's the accepted the answer to the question original asked on Stack Exchange):https://arduino.stackexchange.com/questions/60940/arduino-i2c-register-readCode:/*** Test I2C device by using a serial interface.** Copyright (c) 2015 PhiBo (DinoTools)** Permission is hereby granted, free of charge, to any person obtaining a copy* of this software and associated documentation files (the "Software"), to deal* in the Software without restriction, including without limitation the rights* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell* copies of the Software, and to permit persons to whom the Software is* furnished to do so, subject to the following conditions:** The above copyright notice and this permission notice shall be included in* all copies or substantial portions of the Software.*/#include <Wire.h>#define SERIAL_PORT Serialuint8_t slave_addr = 0x01;uint8_t data;uint8_t data_length = 0;void clearSerial(){while(SERIAL_PORT.available() > 0) {SERIAL_PORT.read();}}void readAddress(){uint8_t c;int tmp = 0;SERIAL_PORT.println("Enter slave address as decimal value(1-127) and press the Enter-Key");SERIAL_PORT.print("Slave address: ");while (true) {if(SERIAL_PORT.available() == 0) {continue;}c = SERIAL_PORT.read();if(isDigit(c)) {tmp = tmp * 10 + (c - '0');SERIAL_PORT.write(c);} else if (c == 27) {return;} else if (isControl(c)) {break;}}SERIAL_PORT.println();clearSerial();if (tmp > 0 && tmp < 128) {slave_addr = tmp;} else {SERIAL_PORT.println("Only values in the range 1-127 are allowed");SERIAL_PORT.println("Press any key to continue");waitSerial();}}bool readData(){// Datauint8_t tmp_data;// Lengthuint8_t tmp_data_length = 0;// data octetuint8_t pos_data = 0;// nibble to processuint8_t lower = 0;// character read from serialuint8_t c;SERIAL_PORT.println("Enter data or register as hex string");SERIAL_PORT.print("Data / Register: ");while(true) {if (SERIAL_PORT.available() > 0) {c = SERIAL_PORT.read();if (c == 27) {return false;} else if (isControl(c)) {break;} else if (!isHexadecimalDigit(c)) {continue;}SERIAL_PORT.write(c);if(isLowerCase(c)) {// lower case charactersc -= 87;} else if(isUpperCase(c)) {// upper case charactersc -= 55;} else if(isDigit(c)){// numbersc -= 48;}if(lower == 0) {// process first nibblec = c << 4;pos_data = c;lower = 1;} else {// process second nibblepos_data |= c;tmp_data[tmp_data_length++] = pos_data;lower = 0;}}}SERIAL_PORT.println();if (lower == 1) {SERIAL_PORT.println("Data incomplete.");SERIAL_PORT.println("Press any key to continue");waitSerial();return false;}memcpy(data, tmp_data, tmp_data_length);data_length = tmp_data_length;return true;}void sendI2C(uint8_t *data, uint8_t len) {uint8_t i;SERIAL_PORT.print("Sending data '");for(i = 0; i < len; i++) {if (data < 16) {SERIAL_PORT.print("0");}SERIAL_PORT.print(data, HEX);}SERIAL_PORT.print("' to ");SERIAL_PORT.println(slave_addr);Wire.beginTransmission(slave_addr);Wire.write(data, len);Wire.endTransmission();}void readI2C(uint8_t *data, uint8_t len) {Wire.beginTransmission(slave_addr);Wire.write(data, len); // set register for readWire.endTransmission(false); // false to not release the lineWire.requestFrom(slave_addr,1); // request bytes from register XYbyte buff;Wire.readBytes(buff, 1);SERIAL_PORT.print("Reading data '");for (int i = 0; i < 1; i++) {if (buff < 8) {SERIAL_PORT.print("0");}Serial.println(buff, HEX);}}void waitSerial(){clearSerial();while (SERIAL_PORT.available() == 0);}void setup(){Wire.begin();SERIAL_PORT.begin(9600);}void loop(){uint8_t c;uint8_t i;SERIAL_PORT.println();SERIAL_PORT.println("Serial to I2C");SERIAL_PORT.println("=============");SERIAL_PORT.print("Slave Address: ");SERIAL_PORT.println(slave_addr);SERIAL_PORT.print("Data: ");for(i=0; i < data_length; i++) {if(i % 8 == 0 && i != 0) {SERIAL_PORT.println();SERIAL_PORT.print(" ");}if(data < 16) {SERIAL_PORT.print('0');}SERIAL_PORT.print(data, HEX);}SERIAL_PORT.println();SERIAL_PORT.println("-------------");SERIAL_PORT.println("a = Set slave address");SERIAL_PORT.println("d = Set data to send or register to read");SERIAL_PORT.println("s = Send data");SERIAL_PORT.println("r = Read register");// SERIAL_PORT.println("w = Read and send data");SERIAL_PORT.println();SERIAL_PORT.print("Action: ");clearSerial();waitSerial();c = SERIAL_PORT.read();SERIAL_PORT.println();switch(c) {case 'a':readAddress();break;case 'd':readData();break;case 's':sendI2C(data, data_length);break;case 'w':if(readData()) {sendI2C(data, data_length);}break;case 'r':readI2C(data, data_length);break;}}

author: tooki
author_rank: Super Contributor
timestamp: March 15, 2022, 09:36:38 am
content: I'm usinghttps://engsta.net/download/i2c-scripting-tool/with a cp2112 board from AliExpress. (I paid $3 for mine in August, but they seem to have jumped to $10 now.)Silicon Labs also has demo software for it (including source code). It can control all the features, but is harder to use and doesn't support scripting.

author: bostonman
author_rank: Super Contributor
timestamp: January 30, 2023, 03:17:59 am
content: QuoteI have an I2C IC (pressure sensor) that has SDA and SDL pin. I'm new to I2C and found this thread, so I believe this board is the solution to communicate with it (just want to tinker - don't want to do anything fancy), but where do I find the software; and is it a GUI?

author: NiHaoMike
author_rank: Super Contributor
timestamp: January 30, 2023, 03:54:25 am
content: You can take a look at Bus Pirate for experimenting with I2C and SPI devices.

author: tooki
author_rank: Super Contributor
timestamp: January 30, 2023, 10:34:14 am
content: Quote from: bostonman on January 30, 2023, 03:17:59 amhttps://www.silabs.com/development-tools/interface/cp2112ek-development-kitThe SDK download contains demos, one of which is the control GUI.