# CH341 driver



## balanga (Aug 23, 2018)

I have a couple of USB to serial adapters which when plugged in show that CH341 has been detected. I use one of these adapters which has an RS232 DB9 plug to connect to an X10 unit. When I use this adapter on Linux it talks to the unit but on FreeBSD it doesn't. Presumably the driver for these devices is built into the kernel since I didn't to install it. Where would I find the source for the driver? I'm wondering if there could be any Linuxisms which make it work differently on FreeBSD. 

It has been suggested that I get a different adapter, ie one which uses an FDTI chip. Would that use a different driver?


----------



## balanga (Aug 23, 2018)

On further rummaging I see that support for this device is provided by uchcom().

It says specifically that you need to load it at boot time, which I didn't. It also says what needs to be done to compile it into the kernel, but there is no indication that it is already included, although it must be.

It also says:-





> *BUGS*
> Actually, this chip seems unable to drive other than 8 data bits and 1
> stop bit line.



Not exactly sure what that means but maybe this bug stops my USB serial adapter working.


----------



## SirDice (Aug 23, 2018)

The explanation is right here:

```
Alternatively, to load the	driver as a module at boot time, place the
     following line in loader.conf(5):

	   uchcom_load="YES"
```



balanga said:


> Not exactly sure what that means but maybe this bug stops my USB serial adapter working.


No, this only refers to the serial protocol used, not how you drive it from software. No parity, 8 data bits and 1 stop bit is fairly common, most serial communication happens with those settings.
https://en.wikipedia.org/wiki/8-N-1


----------



## balanga (Aug 24, 2018)

From what I'm told I need a USB serial adapter which use an FTDI chip.... Presumably when that is inserted I would see a msg such as





> uftdi0: FTDI detected


 ... I'm guessing here.

If that is the case then would one of these do? And how would I connect it to a DB9 plug? Maybe using this ...


----------



## balanga (Jan 29, 2019)

I finally managed to have some success with one of these


----------

