WCH341-Terminal History


WCH341-Terminal
  • What
  • How
  • History
  • Download

  • I had seen these cheap USB/Serial cables offered on several websites, but always without mention of drivers for Macs. One day I saw one on eBay, and the posting stated it was Mac compatible. Well, I thought, it would only be a $5 mistake if untrue. It was untrue. The enclosed mini-CD had drivers for Windows (who cares what version!) but none for Mac.

    Some time before this, I had come across a project to make a driver for the Prolific PL2303 USB/serial adapater. Now I thought: maybe I can adapt that code to work for the pretty silver bondi blue cable I now owned.

    First problem: There is not much official documentation from Apple about how to implement a KEXT providing serial stream services. Perhaps the plan was for USB to take over everything, but plain old serial will never die.

    Second problem: The code for the osx-pl2303 driver borrows from Apple's code for IrDA and contains unused variables and unnecessary code. This is not necessarily a bad thing, but it confused me plenty at first.

    Third problem: I have been unable to find much documentation for accessing the functions of the chip. However, there is a driver written for linux (search for 'ch341.c') and from reading the code in that file, I was able to figure out how to enable basic IO and even control of the handshake lines (DTR, RTS, etc.)

    So I wrote a simple application to access the chip via USB and test some of the things I learned from the linux code. I was able to read and write serial data, and even change the speed(baud). Great! But writing a driver(KEXT) was another matter entirely. You see, if the applications crashes, it is not big problem. When the driver crashes, the computer must be restarted - the hard way.

    I am still working on the driver (which does not crash now, even when unplugging the cable!) but thought I would clean up the simple app, run it up the flag pole and see who salutes. I need you to help write the next paragraph. Try the app and let me know what does work, what doesn't work, and what should be added....


    Other Software | email: AaronProman at Yahoo