command-tab / ch341eeprom

A libusb based programming tool for 24Cxx serial EEPROMs using the WinChipHead CH341A IC
GNU General Public License v3.0
149 stars 58 forks source link

How can I add support for 27CXXX ROMS? #12

Open MBetulus opened 4 years ago

MBetulus commented 4 years ago

Hi there, I've been searching far and wide but haven't come around a solution to burn W27C512 EEPROMs under linux. Your ch341eeprom probably comes the closest, just lacking support for these 28-pin EEPROMs. Any tips on how I could add it? Greetings

Nable80 commented 4 years ago

Hi!

CH341 is a serial adapter but 27Cxxx are parallel ICs, there's no easy way to connect them to this adapter.

You should look for a proper adapter (or use hot-swapping) and use flashrom software package, it's available in most Linux distros.

MBetulus commented 4 years ago

Hi Nable, thank you for the quick reply! Ha, I guess this one is on me - I bought a SP200S with the CH340C to burn some ROMs for my Ataris :) Didn't know there are parallel AND serial EEPROMs, sorry about that.. Do you have a (cheap) recommendation for parallel ROM burners? Greetings

Nable80 commented 4 years ago

This is an unexpected plot twist.

At first I should say that CH340C is a completely different IC, it has little in common with CH341. 340 is an USB-UART converter while 341 is a USB-I²C/SPI/EPP converter that is usually used in SPI mode for serial flash programmers.

I've tried to find some information about SP200S and it looks like it's heart is some kind of MCU: image

Which chips do you have on your SP200S? CH340 is just an interface converter that translates packets between the MCU and your PC.

Upd: I should also mention that PC sees SP200S programmers just as a virtual COM port (it doesn't require any drivers), most probably you can use its original Win32-based software under WINE without any problems. Most probably your SP200S does support parallel EEPROMs, it just has nothing to do with the CH341 IC and corresponding firmware.

MBetulus commented 4 years ago

I'm sorry for the confusion - Just started thinking about programming my own eeproms a few days ago, after some ROMs in old Ataris started giving up. Silly me "assumed" the 341 was simply a updated version of the 340. That's where assumptions get you!

I attached a photo, but I'll name the IC just in case. Main controller seems to be the STC 90C58RD+. Linux natively recognizes the usb device as "QinHeng Electronics HL-340 USB-Serial adapter ", but I haven't gotten past that - probably because I fed it with parallel EEPROMS :) Greetings IMG_20200518_190336

PS: I haven't tried anything with the UART pins yet

Nable80 commented 4 years ago

Look at the updates in my previous post, please.

STCxx is a relatively famous family of 8051-compatible MCUs.

MBetulus commented 4 years ago

Thanks for the update! Before starting this topic I already managed to create a COM1 Port linked to ttyUSB0 in WINE, but the SP200S Software still didn't manage to find the device. I will retry. It probably doesn't change the fact that it can't handle parallel ROMs..

Nable80 commented 4 years ago

It's quite interesting: SP200S seems to be a popular type of programmer but I couldn't find any mentions of Linux-based software for it. Probably all users are OK with using WINE or something like that.

It's possible to write native software if someone finds the description of its control protocol. It's also possible to reverse-engineer it's protocol but I don't have such device on my side. Probably I can do it with your help and some kind of limited remote access but it may be a somehow time-consuming process.

Your SP200S is definitely a clone so it may come with additional features (judging from the schematics it looks like most required pins are connected). Anyway, it's better to check the documentation first, it should contain a list of supported EEPROMs. It looks like SP300 supports parallel ICs but there are too many clones so you should check the docs from your supplier.

COM1 Port linked to ttyUSB0 in WINE

Is it just ttyUSB0 or /dev/ttyUSB0 ? You should also check permissions: your user must be in the dialout group to access serial ports, check the output of id command and use sudo adduser $USER dialout + reboot or re-login if it isn't true.

command-tab commented 4 years ago

FWIW, I picked up one of these a while back, and it appears to support 27Cxxx EEPROMs: https://www.ebay.com/itm/XGecu-TL866II-Plus-Programmer-for-SPI-Flash-NAND-EEPROM-MCU-PIC-AVR-ship-from-US/323729666027

MBetulus commented 4 years ago

It's quite interesting: SP200S seems to be a popular type of programmer but I couldn't find any mentions of Linux-based software for it. Probably all users are OK with using WINE or something like that.

That's what surprised me as well - I thought I was going crazy because I didn't find any software or anyone with a similar problem - Some CH341 solutions, but none mentioning the CH340!

It's possible to write native software if someone finds the description of its control protocol. It's also possible to reverse-engineer it's protocol but I don't have such device on my side. Probably I can do it with your help and some kind of limited remote access but it may be a somehow time-consuming process.

Glad to help, just tell me what you need. Only if you want to, of course. I'd send the device to you by mail, but considering it only cost 8€ it's probably not worth it.

Is it just ttyUSB0 or /dev/ttyUSB0 ? You should also check permissions: your user must be in the dialout group to access serial ports, check the output of id command and use sudo adduser $USER dialout + reboot or re-login if it isn't true.

I tried both, without success. But I will try to adjust the groups accordingly. WINE probably does not have these groups by default.

FWIW, I picked up one of these a while back, and it appears to support 27Cxxx EEPROMs: https://www.ebay.com/itm/XGecu-TL866II-Plus-Programmer-for-SPI-Flash-NAND-EEPROM-MCU-PIC-AVR-ship-from-US/323729666027

Looks like a sound device. Not sure if the price tag is worth it to me though. When I think about how many ROMs I will most likely burn in the next years, I'd pay >1€ / ROM :D

Edit: Then there's the apprently long established "Willem Programmers", but they seem to be sold out in most stores in Europe. But China has a supply of the v5.0 boards for cheap: https://www.aliexpress.com/item/32398295761.html?spm=a2g0o.productlist.0.0.3ada4c52lJ50sf&algo_pvid=8a5612f7-a108-4735-a99d-7be6fcccf1dd&algo_expid=8a5612f7-a108-4735-a99d-7be6fcccf1dd-5&btsid=0ab6f83115898271502907754e880c&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

Nable80 commented 4 years ago

That's what surprised me as well - I thought I was going crazy because I didn't find any software or anyone with a similar problem - Some CH341 solutions, but none mentioning the CH340!

That's because CH340 has nothing to do with flashing, heh. Just a USB-UART converter.

Glad to help, just tell me what you need. Only if you want to, of course. I'd send the device to you by mail, but considering it only cost 8€ it's probably not worth it.

Thank you! I think it would be simpler and cheaper for me to order it from Ali anyway. Btw, I wonder how long would it take to deliver something nowadays. Probably more than a month or two.

Looks like a sound device. Not sure if the price tag is worth it to me though.

What do you think about the hot-swapping way? I don't have a dedicated parallel programmer, I'm just using an old P2 (i686) PC for such kind of tasks: one can boot it and then replace its BIOS EEPROM with the one that is going to be written. You can also use a PCI card (video or networking one with a socket for extension ROMs) as a adapter. There are also cheap solutions that can be built if you have a LPT port and several 74xx ICs. You can also use some MCU evaluation board (*duino, BluePill or anything like that) and several dozens of wires. There's a trade-off of time vs money: there are cheaper solutions that would consume more time and there are more expensive ready-made solutions. It's up to you to decide which route to follow.

MBetulus commented 4 years ago

The Hot-Swap Idea sounds like a good idea actually. I can't do it with the atari, as the OS is in those ROMs. I also have some i486 PCs where I could remove the BIOS-EEPROM, but they're in storage right now. For the moment I ordered my linked Willem Programmer for ~24€. Guess I'll have to be patient. If you're interested, I would definitely be down to enhance this ch341eeprom Software with support for the CH340 / Willem, fork it or start a new project :)

Nable80 commented 4 years ago

I don't know how, I don't know why, I'm always here and still alive.

@MBetulus

  1. Did you eventually receive your parallel programmer?
  2. Do you have any serial EEPROMs that can be used for testing your SP200S programmer and developing free software to control it?
MBetulus commented 4 years ago

Hi @Nable80 I received my Parallel programmer just last week! I'm traveling right now, but next week I have time to do some testing for you. And yes, I have some 27c256, 28c256 and 28c010 available and ready :)

Nable80 commented 4 years ago

There are really huge parallel EEPROM ICs, does your Atari machine really support them?

MBetulus commented 4 years ago

The 256s are the standard ones for the operating system of most Atari STs.The 1Mbit are just for fun and experimenting :) Also there's some hacks to put two different versions of the OS on the 1Mbit chips and make it switchable, maybe I'll try that some time