Introduction: CH341A Programmer

I recently have purchased a CH341A mini programmer. The mini programmer is OK and can by used to program 24 and 24 series chips. It is very low cost but quite useful as I can use it to flash my computer BIOS and router firmware.

WCH has kindly released its API and C library for developers to utilise the chip. So I have decided to build my own programming software for the mini programmer.

The programming software I have utilise the CH341DLL.dll library provoided by WCH. It can utilise I2C and SPI protocol via USB.

All codes are written in C# and all C++ function calls have been wrapped to be used by C#.

The driver and C library can be downloaded from WCH's website.

Step 1: The Main Window

The main windows provides all the functions we need to read and program these Flash NOR / EEPROM chips. You can also use the menu to perform the same function.

It has in-built HEX editor to edit the file or content read fromt the chip. For example, we can add the MAC code in the router firmware before program it to the chip.

All related functions (Copy / Paste / Search etc) are provided for editing the binary file.

Step 2: Chip Selection

You need to select the chip you want to work on first.

Just click on the "Search" button to search the chip in the chip database. Just type the keywords of your chip and all matching chips will be displayed in the grid.

For 24 series chips (I2C), you will have to select it manually as they don't have any id / signature for us to identify them.

For 25 series chips (SPI), you can use the "Auto Detect" button to read the id / signature of the chip. If an id is found, a chip selection window will pop up for you to select it.

Step 3: Read Chip

Use "Read" button to read the chip you have selected. The content of the chip will be displayed on the HEX editor.

You can use the "Save" button to save the chip content.

Step 4: Program Chip

You can open an existing file by click on the "Open" button.

Once a file has been selected, its content will be loaded to the HEX editor.

You can apply changes to the content before program it to the chip.

Once you are satisfied with the loaded content, click on "Program" button to program it to the chip.

You can also use "Auto" button to program the chip which will verify the data after it was programed.

The SPI chip will be erased automatically before the programming starts. However, you can manually erase the chip as well.

Step 5: Verify Chip

Once you have read or written the chip, It is highly recommanded to verify the read / write content against the content loaded in the HEX editor.

You can verify the content by click on the "Verify" button.

Step 6: File Slicer

The program has in-built file slicer function to slice a certain part of the fiile / loaded content and save it to a file.

This function is very useful when working on router firmwares. For example, extract the last 64KB of the file to save your router's ART information.

Step 7: File Merger

You can also use the file merger to merge two files into one.

Some laptop BIOS utilise multiple chips to store BIOS and EC information. You will need to combine them before you can work on it.

By utilising the merge function, you can combine two files into one for further process.

Step 8: Program Download

Please download the program and source code from my Google Drive below.

The source code has not been well commented yet. I will upload a well commented version once I have added these comments for better reading and unstanding.