Take a look at the schematic of this versatile programmer to learn how to use it properly. An overview of CH341A devices with driver and tools download links
CH341A is an USB interface chip that can emulate UART communication, standard parallel port, memory parallel port and synchronous serial (I2C, SPI). The chip is manufactured by Chinese company Jiangsu QinHeng Ltd. CH341A is used by some cheap memory programmers. The IC is somehow limited in this configuration, because the programmer makes use only of the SPI and I2C interface and leaves a lot of pins unconnected. A popular device is the black CH341A MiniProgrammer that you can buy for 2 to 5 USD.
The problem with these devices is that you get them without any documentation or software. Drivers are available from manufacturer's website (but the site is written in Chinese). Also, some source codes are available from manufacturer. There are open source applications that support this programmer. But, first of all, let's have a look at the hardware.
Photo of the black CH341A Mini Programmer
A quick look at the board reveals the main electronic parts used: CH341A, a 12 MHz crystal required by the chip, a 3.3V regulator, two 7 pin headers and the ZIF (zero insertion force) socket. The programmer can be bought with additional sockets and adapters, some of them with voltage shifting circuits.
Schematic
After some searching I found a schematic of a CH341A based programmer, but it wasn't exactly right and complete. It didn't have the pinheaders on the sides of the ZIF socket which I wanted to know what they are for. I took the multimeter and started to trace lines on the programmer PCB until I got a complete schematic. The schematic is quite simple, based on datasheet.
Schematic of the black CH341A Mini Programmer
I also found WAVGAT store (a seller on AliExpress). Their product page offered a the PCB design of the device (only top side, however).
CH341A Mini Programmer PCB (by WAVGAT/AliExpress)
Now, let's return to the schematic and analyze it a bit. The chip is powered from 5V, so its I/O ports will also use 5V. Basically this is a 5V device. The problem is that any memory you fit in the socket will be powered from 3.3V. And this seems to be the only function of the 3.3V regulator (besides the 3.3V pin on the SPI connector). I don't know why the designer even used a regulator, if it didn't provide a switch to choose between 3.3V or 5V levels and supply.
Sampling chip voltage supply and clock pin with the oscilloscope |
For all of the conspiracy theory adepts who claim there is no voltage levels issue, I kindly recommend getting an oscilloscope and replicating the above setup (yes, I know, the probe cables are not fully shown in photo because they pass through a free energy generator😉). The HIGH state of clock signal reaches 4.5 V and that is above the maximum ratings of some chips.
By reading the datasheet, we can see that the manufacturer recommended to connect a 0.47 uF capacitor between RSTI (pin 2) and VCC for improved stability. There is none on this board.
Chip placement for programming with the MiniProgrammer |
Anyway, I used the device with I2C EEPROMS (3.3V and 5V) compatible and also SPI FLASH memories (3.3V devices) without any issues. For improved reliability and to avoid burning memory chips, I highly recommend using a level shifter. In order to turn this programmer into a 3.3V device, you could cut the 5V line from VCC pin (28) and tie it to the 3.3V output from regulator. You will also need to connect V3 pin (9) to VCC (3.3V). User johnmx from EEVblog Forum has succeeded in converting this programmer to 3.3V levels.
Note that the device works as a programmer only if ACT# pin is connected to ground via a resistor. That's why you should put a jumper across pins 1 and 2 of the UART connector. Otherwise the device will be recognized as a standard USB to serial converter.
Drivers and tools
The manufacturer of CH341A provides a lot of useful things on the product page. Here are the files you can find and what they contain (the first two are the ones you need):
- CH341SER.EXE - self installing archive with USB to serial driver.
- CH341PAR.EXE - self installing archive with multiprotocol interface driver (this one is for the programmer mode).
- CH341SER.ZIP - archive containing driver files and serial API and library (you don't need specific API for standard serial port, but it contains some special functions to get IC version etc.)
- CH341PAR.ZIP - archive containing driver files for interface mode and API (header and library to access the device and use any protocol you want).
- CH341PAR_LINUX.ZIP - archive containing Linux driver source code and Linux API
- CH341SER_LINUX.ZIP - Linux driver source code for serial port (don't need this one, it's already included in kernels)
- CH341EVT.ZIP - some source code and tools written to be used with an evaluation board (may be useful for programming software that can access this device)
- CH341DS1.PDF - datasheet, in Chinese
- CH341DS2.PDF - some additional info and API documentation, in Chinese
- CH341DP.ZIP - contains an ISP programming tool?
- CH341DPS.ZIP - probably similar to the above, once required login to download
A regular user only needs the first two. Just double click on each of them and when the dialog appears click on Install. The API becomes interesting due to the versatility of the chip. You can build your own software that will read/write data from/to sensors, real time clocks or any other devices that use serial communication. You can also interface parallel devices to the chip, but this will require modification of the programmer board in order to connect to pins. Further reading for developers: I2C Programming and SPI Programming using Windows API.
Software
Programming utilities are available for Windows and Linux:
- AsProgrammer and SNANDer are open source tools for Windows.
- IMSProg and other command line utilities are available for Linux.
CH341A devices
There are also some other programmers and boards based on this chip. You can find most of them by searching "CH341A" on Banggood and AliExpress. Here is an overview of the programmers and development boards available:
CH341A Programmers and boards overview
Great job. thanks for taking the time to share the information.
ReplyDeleteMike Z
I got the software installed, switched it to English from Chinese, and loaded the drivers. I still could not program a 24C32 EEPROM. After some board level troubleshooting I found that pins 1,2,3,4 and 15 were not connected to anything! That said, there was no chip ground and no connections to the 24C32 address lines. One other pin, socket pin 15, (EEPROM chip pin 7) was not grounded. that is the read/write line. After adding several jumpers to ground the programmer worked.
ReplyDeleteMike Z
Nice !!! Great info
ReplyDeletethe 470nF capacitor should not be between VCC and RSTI, as you say, but between V3(pin9) and ground where is, as the datasheet I found says, and shoud be between 10nF to 470nF.
ReplyDeleteMy bad, indeed for stability there should be an another capacitor as you wrote.
DeleteBoth are correct. There should be an 0,47 uF ceramic capacitor between pin 9 of the CH341A and GND (for 5V VCC). If an additional (large) electrolytic capacitor is mounted on the VCC line, a ceramic capacitor, value 0.1 - 0.47uF, should be mounted between RSTI (pin 2) and VCC (pin 28), to lengthen the reset interval on the CH341A, because it just takes longer for the chip to reach the valid reset situation. Because no large electrolytic capacitor is been mounted on the PCB (VCC) for this, the RSTI capacitor has probably been omitted tp save cost.
DeleteHow can I do to pay this product
ReplyDeletehttps://drive.google.com/file/d/0ByEQKtsOckWBUVBqajZOUGtLcnM/view
ReplyDeletewhere files are all zipped together and a good video for this is at
https://www.youtube.com/watch?v=L0ChYNwunUE
I have one of these arriving to programme some 24Cxx devices. I don't think the 3.3/5.0 volt issue is a problem here because the SDA and SCL voltages are derived from pull up resistors. So 3.3v devices should not be stressed. However if the pull ups are powered from 3.3v via a LED I doubt the 24Cxx specs are being adhered to - ADA and SCL will only go to less than 2V ????
ReplyDeleteThat was a difficult question. I took the multimeter and measured (again) the voltages on the idle I2C bus. 4.9 volts... I unplugged the programmer and tried to measure resistance between I2C bus pins and power line (3.3V and 5V). Nothing conclusive. So I returned to datasheet. Here is what it says in the Chinese PDF at page 3, section 4.2, pin 24 of 341A (translated with Google): "Chip function configuration output, built-in pull-up resistor, can be connected to the serial EEPROM configuration chip SCL pin". The pull-ups are therefore built-in. And look at the schematic again: only SDA is connected to the LED. What would be pulling SCL up if it weren't the built-in resistors?
DeleteThanks for that, sorry I'm over 2 years late. Your email updates are always of interest, and often useful.
DeleteHi, reading chinese datasheet for CH341 and at end of chapter 5.2 硬件说明 (Hardware description) is stated:
ReplyDeleteCH341芯片支持5V电源电压或者3.3V 电源电压。当使用5V 工作电压时,CH341 芯片的VCC 引脚 输入外部5V 电源,并且V3 引脚应该外接容量为0.01uF~0.1uF 的电源退耦电容。当使用3.3V 工作
电压时,CH341 芯片的V3引脚应该与VCC引脚相连接,同时输入外部的3.3V电源,并且与CH341芯
片相连接的其它电路的工作电压不能超过3.3V。
It can be translated:
The CH341 chip supports a 5V supply voltage or a 3.3V supply voltage. When using a 5V supply voltage, the VCC pin of the CH341 chip inputs an external 5V power supply, and the V3 pin should be externally connected with a power supply decoupling capacitor of 0.01uF to 0.1uF. When working with 3.3V voltage, the V3 pin of the CH341 chip should be connected to the VCC pin, and an external 3.3V power supply is input, and the CH341 core is connected.
The operating voltage of other circuits connected to the chip cannot exceed 3.3V.
As far as I understand, that mean, that chip have internal 3.3V regulator and IO pins are NOT 5V tolerant. It mean, it always use 3V3 for communication with eeprom.
"The operating voltage of other circuits connected to the chip cannot exceed 3.3V" when CH341A is powered from 3.3V. Otherwise, I/O pins use 5V when chip is supplied with 5V. There is no mention of an internal regulator in datasheet.
DeleteYou can easily ascertain yourself. Measure pin 9. When powered by USB, the pin will have 3.4V, which is the value of the sloppy and wonky internal regulator.
DeleteIt stands to reason that all WinChipHead chips use a common core and all have a 3.3V 8051 USB core - it is a good solid idea, since USB bus D+ and D- pins have 3.3V signalling. You will find the LDO designated on datasheets for something like CH559.
This doesn't prevent the chip from having programmable IO pullups which go to 5V and evidently deliver on the order of 4.7V. The reason it's usable at all is that it has 5mA current limiting on MISO, MOSI and CLK pins, not mentioned in the datasheet, but you can ascertain yourself. This current is absorbed by the ESD diodes on the target device and brings the voltage down to within not blowing the target device up!
Hello,
ReplyDeleteI need a recommendation for a capable and quality device that you consider better than the CH341A that can do everything the CH341A does (and more) that I may be able to get for under $75.00 US.
Steve Sybesma
Brighton, CO
Another question would be, can a EZP2010 do everything that a CH341A does (and more)? Are they any more capable/better quality or just the same? It's very hard to evaluate this stuff because I'm just looking at pictures and have no idea of the reputation in the community for any of these. I don't want to waste my time with something that is junk.
ReplyDeleteYou can convert the programmer to 3.3V version by cutting the track from the 3.3V regulator to the chip pin 28 and putting a jumper between 5V and 3.3V pins.
ReplyDeleteThe track is located underside the board and it is very easy to cut with a knife. The result is the same as explained in the EEvblog but no soldering needed.
Do you have a picture or a diagram of where to cut the track with a knife? TYIA!
DeleteLuc, you can follow these guides: https://www.chucknemeth.com/3-3v-ch341a-modification/ and https://www.eevblog.com/forum/repair/ch341a-serial-memory-programmer-power-supply-fix/.
DeleteSTOP! you don't need to mod these for 3.3v chips. measuring while the programmer is not connected will show 5v. connect it to a 3.3v chip, and it will drop to 3.5v
Deleteplease stop spreading this false information!
Correct!!!
DeleteThis comment has been removed by a blog administrator.
ReplyDelete24C02 series EEPROM are I2C devices supported by CH341A. The same chip, CH341A, supports both I2C and SPI protocols. Programming software runs on Windows 7 too.
DeleteInteresting. I have two different CH341 programmers. Neither will program my X24c01 devices. I miss my PonyProg. Is it possible to convert this chip into a parallel port, and use it with PonyProg hardware?
ReplyDeleteUnfortunately not. Although you can use CH341A to emulate serial and parallel ports, you cannot use them with PonyProg. Bit banging does not work with USB serial or USB parallel adapters.
DeleteSir/Madam,
ReplyDeleteJust received the YJ CH341A mini programmer.
Clipped it to the AT24C02D-SSHM-T on our PCB.
It reports:
$ sudo flashrom --programmer ch341a_spi -r backup.bin
Calibrating delay loop...OK.
No EEPROM/flash device found.
Should I follow the:
"When working with 3.3V voltage, the V3 pin of the CH341 chip should be connected to the VCC pin, and an external 3.3V power supply is input, and the CH341 core is connected.?"
Sincerely,
Liu
AT24C02D is an I2C EEPROM. You must clip it in the I2C half of the socket (see here). You'll have to use a different programming software, because flashrom does not support I2C EEPROMS.
DeleteComelius,
DeleteAppreciate your comment.
Could you please recommend a i2c EEPROM programming software compatible with ch341a ?
Sincerely,
Liu
I am a student and completely new to this hardware. I loaded the i2c linux drivers and it created a dev file for the same, but when I try to detect the i2c slave sensor's address through i2cdetect, i2c slaves are detected on each address in the searching range. This happens even if I disconnect the SDA and SCL from the sensor.Anyone who faced similar issues and can help?
ReplyDeleteA system may have multiple sensors there.
DeleteIf SDA and SCL to the sensor disconnected and i2cdetect the same list of hardware, probabley the sensor is not detected at all.
1.Hookup a i2c analyzer to the sensor SDA & SCL and start capturing i2c traffic
2. launch i2cdetect again.
3. look in the i2c capturing to see if any traffic happened to the i2c address of the sensor DUT.
Good luck
Hello, in datasheet is stated that the chip supports paralell memory, can it flash a 28fxx/29fxx family?
ReplyDeleteIt can't flash parallel chips using this programmer.
DeleteAhh, its misleading then, what a pity. I have buyed this with the hope of program old bioses like the P3/P4 because the price of th willem in my country is prohibitive
ReplyDeleteDo you know another altenative for program paralell chips for a budget?
ReplyDeleteI bought the same programmer from this guide and modified it to operate at 3.3V. I've tried in Windows using the drivers above and AsProgrammer and in Ubuntu using flashrom. In both cases I can read the chip and flashrom even correctly identifies the chip automatically. But in both cases the chip verification fails. Every read is different, with a different md5sum. Any thoughts on why this might be?
ReplyDeleteIs every read following a write different? Or just any succesive reads return different data from memory?
DeleteI don't know what to say. Are you sure the wiring is okay? I myself had issues with a SOIC8 clip which had a wire not connected.
Thank you so much for responding to me, especially on an older thread like this.
DeleteMy intended workflow was to extract the SPI Flash bin file, modify a section, and flash the modified bin file back to the chip, so I didn't want to write anything to the chip until I got a good read. I don't know if every read would have been different after a write. Successive reads returned different data.
As I was trying other methods before buying the CH341A programmer, the chip was on a bodged-together carrier board. I thought, however, that my wiring was okay as I could read the correct ID from the chip.
I did get it to work last night, although not using the CH341A programmer. Because of my weird arrangement, I wondered if it could be an issue due to noise on the SPI bus. I wondered if I could fix this by playing with the SPI speed. As the CH341A can't do that, I got my raspberry pi up, which has native SPI and flashrom support, and used flashrom to play around with the speeds. After a lot of trial and error, I got multiple good, verified reads and proceeded to modify the bin file, successfully upload and verify the flash chip, resolder the chip, and boot the device.
With how I arrived at my solution, I do wonder if I could have been helped by adding the datasheet-recommended 0.47 uF capacitor as you describe above.
Although this guide wasn't what solved my problem, it was rich with information and gave me the tools I needed to get where I needed. Thank you so much for the amazing work here.
I don't know if that capacitor would have made a difference. The SPI of CH341A looked rather strange on my logic analyzer. The clock frequency is about 1.7 MHz. Have a look at CH341A SPI. I guess I could do some oscilloscope sampling on the SPI port, sometimes.
DeleteHello admin, thank you for this very useful information about the CH341.
ReplyDeleteWe are creating a video content on YouTube, and we are referring to the schematic of Mini Programmer CH341 in this post.
this is the link : https://youtu.be/hn9P9GnwJkI
I found a version that has a multi voltage switch (1.8V, 2.5V, 3.3V 5V) but the price is a little higher:
ReplyDeletehttps://www.aliexpress.com/item/4001272558261.html
xtw100 progamador nao tem drive para instalacao
ReplyDeletehttps://www.onetransistor.eu/2020/08/xtw100-minprogrammer-schematic-driver.html
DeleteAlguien tiene el código fuente del ch341 para adicionar librerías?
DeleteActually, there's a much easy way to do this fix; you just have to cut a track on the board and add a plastic jumper on pins labeled '3.3V' and '5V'. I've have successfully flashed a Winbond 25Q64FVSIG which is a 3V chip.
ReplyDelete» https://www.geocities.ws/racejay/ch341a/3.3V_Easy_Fix.jpg «
This worked for the voltage but anytime I put the clip on a chip the device would disappear out of windows. I tried with battery in, PSU attached etc.. multiple motherboards. I don't know if that issue is related to the mod or not. The clip is a bastard to get it clip on properly. I eventually de-soldered the chip with my fingers crossed (not experienced). I wasn't confident soldering the chip and de-soldering it again onto the adapter, so instead I took the spring out of the clip and put the bios chip as deep as it would go into the clip and closed it manually. I was able to flash it like that. Now I just need to get it back on the mobo without stuffing it up....
DeleteI'd just like to thank the original author for providing the schematics, and all the other useful information for a newbie like myself.
DeleteI can also confirm, that the "no solder" modification of my black CH341A programmer to 3.3V as suggested by "RaceJay" worked really well to remove the BIOS password from the 25Q128 chip in my HP Folio 9480m. Initially I was a bit reluctant, as I had of cause read about the need to also connect V3 (pin 9) with 3.3V. But at least in my case, this seems not to have been required.
Mind you, I had enough soldering to do in "close quarters". The SOIC-8 clip that came with the programmer was pretty much useless. So I soldered eight thin wires to the pins of the 25Q128, and left this IC on the PCB. I also saw no need to attach the PSU to the notebook, as I've seen suggested at some sites.
Yo he pedido el CH341A , y en su lugar me han enviado el CH341B , el problema es que no se si tiene las mismas caracteristicas de voltajes y conexiones y de si se usa el mismo Software .
ReplyDelete¿ Alguien me podria ayudar o darme alguna orientacion o enlace donde pueda encontrar mas info sobre el CH341B ?.
This comment has been removed by a blog administrator.
ReplyDeleteSe me olvido poner el enlace de lo que me enviaron https://en.mail.qq.com/cgi-bin/ftnExs_download?t=exs_ftn_download&k=70656339bc0e1ad09821c813173053051803025d09085655014852010652490354060114510906561a53550c520907010551060d043075370754530e0005441717b2a9f8ff1e1e5e47655d&code=7ec900d7&fid=72/fad982b6-186b-4ccb-a9ba-665b9c624e44:
DeleteOs dejo por aqui otr enlace par que quiera descargarlo desde Mega : https://mega.nz/file/w75gkDzK#ByEAtrqiCW2UCcP5j9bgOYDq06PQWsCZ6JeC07hYQWg
ReplyDeleteHi
ReplyDeleteTry Neoprogrammer works with the CH341 too
Found a great Video On Youtube about volt modding the CH341a.
ReplyDeleteIt is called... Volt-modding the CH341a Mini Programmer - LFC#278 and here is the LINK...
https://www.youtube.com/watch?v=HwnzzF645hA
This video was a really good video on HOW TO MOD THE CH341a. Take Care.
Stop it... Get some help. THESE DON'T NEED TO BE MODDED! once you connect it to a 3.3v chip it drops to 3.5v
DeleteIt pains me to think how many people have modded and lost 5v compatibility, or botched modding these perfectly fine programmers. x_x
Hi, am I understanding correctly, I should convert my CH341B back to 5V? Now it can only read flash, erase or write only works in single cases and mostly the programmer hangs on libusb timeout error.
DeleteThanks in advance for the answer.
An unmodified programmer supplies the memory with 3.3 V, while using 5 V for data I/O.
DeleteNow my programmer is unstable. I not have idea. An hour ago its wrote and verified the flash without problems, but now trying to write/clear the flash makes the programmer "hang", and flashrom and ch341prog write about libusb timeout or "programmer not ready".
DeleteHow can I fix this and is it related to the modification to 3 volts?
Took about a Day to get My CH341A (Black) working.
ReplyDeleteWhenever i tried a flash erase the USB device would disconnect !.
It transpired that C1,C2,C3 were 10nF. I changed them to 100nF, added 10uF on the 5v input to the regulator and 100nF on the Daughterboard holding the SPI Flash (W25Q64J).
Everything now works with Neoprogrammer.
Nice job!
ReplyDeleteI can't get it to work with the memory ZD25WD40BTIGT . The programmer doesn't find it using the CH341A - USB Programmer 1.30 tool. Any clue?
I don't know, it should find it. Otherwise, select a common 25X40 chip and try to read it.
DeletePlease see my CH341a Linux programmer IMSProg https://github.com/bigbigmdm/IMSProg
ReplyDeleteNice! I wrote a post about it and other Linux utilities: IMSProg and other Linux utilities for CH341A.
DeleteBonjour @ tous...j'ai acheté la fameuse clé avec tout les adaptateur..électro de base j'ai recalé en 3v3...seule hic mon soft reconnais 2 sérial sur un 8P winbond et non 1..je suis largué...je suis sur la version 1.30 impossible de choisir l'un des deux sérial proposé..le chip est soudé sur son support 8 Pin..point d’indication respecté en 5...les erase ou copy test s'arretent a 20% et m'indiquent : Erase operations timeout failed : code 3...avez vous une idée ?
ReplyDeleteWhen CH341A is in programmer mode (ACT pin connected to ground), no serial port appears when you connect it.
DeleteIs reading NEC 780973 possible using CH341A? Anyone tell me how (pinout) please!
ReplyDeleteI am also interested for same question. Anyone?
Deleteme to, but looks like nobody knows?!
DeleteFor the 3V3 SPI operation, could you remove R1, then carefully remove the Power LED and put that LED in place of R1 so that it drops enough voltage from the 5V USB to give approximately 3V3? The Regulator probably would not have enough input voltage to supply the 3V3 that goes to the target IC's supply. The question is though - would this work?
ReplyDeleteIn addition to the LED move above, you could remove the regulator and connect IN to OUT on the PCB. I'm waiting on mine to arrive, so cannot try this yet.
DeleteHi, I measured on my CH431A, on I2C pins (pin 23/24). There is weak pull up internally to VCC at 200Kohm.
ReplyDeleteAm I reading this correctly, that for a bare chip (not mounted to a PCB) you would need to include pull-up resistors for the MISO and MOSI lines? I'm asking a) because I don't see any pull-up resistors and b) because when I try do an "unprotect" command I get an error:
ReplyDeleteCurrent programmer: CH341
Sreg: 11111111
Secktor Lockdown регистр: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Page size is power of 2
Any help would be greatly appreciated.
Kas
There is no need for pull-up resistors.
DeleteI tried with just putting a AT45DB081E in an adapter module but found that the IC became overly hot. When I used the in circuit clip, I do not have this issue, any suggestions why the difference in performance?
DeleteI want to buy this CH341A as youtube has people show its use and also some 5V "modification" to, so very confused as ready to use out of the box?
ReplyDeleteCan i use this as is without changing the jumpers to erase and reprogram old 3.3 Bios chips from pre 2017 M/B? The diagram shows 3.3V available on the top half of the blue socket from the regulator, so... why is everyone saying the chips are getting 5V?? Do i need to adjust jumpers to do simple operation i want to do? Thanks for any help. Also i always though ALL Bios chips were 3.3V?? well the old ones? Please fill in blanks in my knowledge as ready to learn.
Yes you can but if you use it out of the box as it is, there is an increased risk of damaging the BIOS chip. I suggest you buy CH347 which does not have voltage levels issues with SPI memory chips.
DeleteThe chips are getting 5V from CH341A I/O lines because CH341A is powered at 5 V. This is the issue.
Hi, is pin 25 used on this device? as i got this programmer and cant get it to work on any bios chip but found pin 25 not soldered or broken away in post maybe. I just get all FF's scrolling down to bottom, no real data . tried win 7 and 10 and 2 versions of program and clip attached very carefully dozens of time but not one good read.
ReplyDelete