CH341 à la Bus Pirate - cheap and moderately useful

I would like to present an application that is a collection of test tools using CH341 as a physical interface.
The original purpose of this application was to repair laptop batteries.
However, I had to familiarise myself with the CH341 chip beforehand, I started with more elementary functions like I2C support and the application took the form of a collection of loosely related modules.
Programming the smart battery turned out to be more complicated than I expected and, given that I only have a few such batteries, I stopped at reading their parameters for the time being.

What emerged from this, however, was a tool with a wider range of functions, reminiscent of Bus Pirate.
Currently (version 1.04) funcionality includes:
- detection of I2C devices
- writing/reading raw data using I2C, SPI
- smart battery status reading
- sensor support: BME280/BMP280, Si7021, BMP180, SHT11, LM75, AHT10/AHT20, AS5600, APDS-9960, L3G4200D, BMI160, MPU6050, VL53L0X
- support of displays: HD44780 directly and via PCF8574, SSD1306, MAX7219 8x8 LED, CH455 LED from a DVB-T decoder
- support for Si5351A generator
- support for FM tuner RDA5807M
- support for RTC DS1302 and DS1307
- support for the MCP4725 DAC and ADC ADS1115
- read/write of ETH PHY registers via MDIO interface (Clause 22 + MMD)
- support for Ethernet cable length measurement function via LAN8742 (TDR + CBLN)
Some screenshots and photos:





I found out about the CH455 LED and keypad controller from the topic https://www.elektroda.pl/rtvforum/topic4066595.html, but in my case the "donor" was a WIWA HD-102 (burnt out power supply even before switching to DVB-T2) in which the display with the controller is placed on a separate board connected by tape.





Curiosity: clearly "burnt" segments of the display where "C" was displayed as "CHANNEL":

This is already most of the electronic trinket I have that can be handled.
I have omitted the typical use of the CH341A as a serial memory programmer, as there is already quite a selection of software supporting this.
To the best of my knowledge, the limitations and shortcomings (limited SPI speed, irregularity of the UART output waveform for higher speeds) of the CH341 will not allow the implementation of 1-wire or the WS2812 protocol.
Support for a given chip is most often limited to basic or selected functions, allowing testing but not necessarily giving access to all capabilities.
Much of the source code comes from other open source projects, but I stick to licences that would not introduce problems for commercial use.
For a slightly longer description: https://tomeko.net/software/CH341A_tool/.
Attached: source code (Turbo C++ 2006, one of the ancient versions of C++ Builder) and executable file.
The application only works under Windows x86 or x64, it does not work with Windows ARM or Wine.
It is required to install the driver "CH341PAR" (if the CH341 was used as a programmer, this driver is probably already installed), the application will not run without it..
Comments
Add a commentA simple, small, multi-purpose and multi-purpose programmer - these are the kind of tools that prove most useful. I have suggestions for changes/improvements: 1. the scanner could scan the entire address... [Read more]
. It does indeed fit very nicely on a small graphical display (and the Linux i2cdetect presents it similarly), but I think the text form is more practical in this case. As I look at it now, it would... [Read more]
. You could always add a switch of how the detected devices are presented, as both can be useful in practice. . Detecting a particular chip just based on its address is not possible, because many... [Read more]
. Number of unique IC models with I²C interface , i.e. how many different chips (EEPROMs, sensors, RTC clocks, etc.) have been created with I²C support . 📌 How do you estimate this? ... [Read more]
. Right. Your program is good for quick component tests, without the need to compile examples from Arduino for example. Just now I checked a 4xMAX7219 display I bought from the Chinese with your program... [Read more]
. I haven't thought about series bonding unfortunately - I only have one piece for now. Looks like an empty byte needs to be added on the transitions. . I plan to add one to my next order from... [Read more]
. This is not a nuisance. You only need to additionally press the Write key once so that those words left in the shift registers of the previous cubes reach those cubes displaying the incomplete image... [Read more]
Cool toy :) Merry Christmas Resurrection. [Read more]
I am wondering about CH341 if it could do some EMMC programming as an alternative and cheap solution to large,professional and a lot more expensive programmers.Maybe i am totally wrong since i dont have... [Read more]
If speed is what matters, it would be very unattractive due to the severely limited SPI speed, limited USB Full Speed and the need for polling. Any dedicated USB-SD adapter would be many times better.... [Read more]