I received my CP2102 usb to serial TTL converter bought on ebay from China for 2.8â‚¬ (about 4$). The delivery from China to my home (France) usually takes about 3-4 weeks, but this time I was lucky as it arrived in less than 2 weeks 🙂
As showed in the following picture, I connected it to my Teensy++:
Blue outlined, the CP2102 board, and red outlined, the Teensy++.
First tests were not so hopeful, as it doesn’t work as-is with the latest sixemu package (v0.12).
I had to deal with 2 problems:
- Rx and Tx pins are for the target device.
- The max speed reachable by the Linux driver is 921600 bit/s and not 1 Mbit/s as written in the datasheet.
I inverted two wires, and changed both the emitter (CP2102) and receiver (Teensy++) speed to 500Kbit/s.
My benchmark program shows that we can reach about 45bytes/ms only writing and about 40bytes/ms writing and reading at the same time. This is good enough for the application. Running at 250Hz, I measured a 6.7ms worst latency, and a 5ms average latency.
Conclusion: this cheap CP2102 converter from ebay seems usable! I will test it further playing over a long time to see if it’s reliable.
Warning: this hardware solution doesn’t work with sixemu v0.22 because the serial connection doesn’t work at the right speed (next release will solve this).
18 Replies to “CP2102 USB to serial TTL converter”
Well 250 with ~7ms is not bad. Its way better then the Bluetooth. It should definitely improve the responsiveness, especially in FPS games.
I have a question tho. Why not use 2 Teensy++ boards. One to process PC input and the other one to forward it to the PS3?
Yeah which is better, two teenseys or a converter?
Considering that you have to talk to the second teensy++ over a serial connection, the first teensy++ will have to behave like a usb to serial converter…
A usb to serial converter is really cheaper than a teensy++ (about 4$ vs 20$).
I'm referring to the speed that can be achieved?
Also have you made the controller code public?
I would like to have a look over the Teensy source code … the hex file is not readable to humanz 😛
The source code is here
The current update report is 48 bytes. The max speed we can achieve at 40bytes/ms is 833 updates/s… it's not really necessary to go that fast (and again, it would require a realtime kernel).
Everything I write for this project is GPL:
Super. Will have a look at the code soon.
I've just ordered my CP2102 from the link you've provided. Now I just need a teensy … and a PS3.
Will have to solve this issues soon.
"The current update report is 48 bytes. The max speed we can achieve at 40bytes/ms is 833 updates/s"
Does that mean that an 8-bit version could break 1600 updates/s?
Actually, no 🙂
I think the max usb polling rate is 1000Hz=1ms latency.
We are all worrying about latency, but:
1- there is no point to go faster than the mouse itself (default is 500Hz for high-end mice).
2- there is no point to run at 1000Hz (cpu load, no realtime kernel…).
3- we don't even know what kind of polling rate the ps3 uses (only a usb sniffer can help us guessing that).
I was only asking…I know the 16 bit is already faster than it needs to be, and would probably still be faster than it needs to be if it were all analog.
I had 2 Teensy ++ lying around, so it was easy for me to build the usb-gimx.
I will be using 1 Teesny ++ as the USB/Serial adapter.
I know GIMX is not designed for 2 Teensy’s… Will this cause any issues, like increased latency?
It’s designed to run with an AVR USB chip + a serial TTL converter.
Using a Teensy as a serial TTL converter fulfills the requirements.
Cool. But will this increase latency?
“I inverted two wires, and changed both the emitter (CP2102) and receiver (Teensy++) speed to 500Kbit/s.”
I read the tutorial, but I can’t find out how to do this. Is this the same as polling rate?
Please check the forum. There is a tutorial with much more details and a “tutorial for dummies”.
Thanks for responding. I looked at the turial, but they only mention Polling rate 500 hz… Is this the same as 500 kbits/s mentioned above?
This blog post isn’t a tutorial. It’s a test about the cp2102 device, that I wrote 1 year ago…
I don’t know what you are trying to do, but if you are trying to build a DIY PC to PS3 USB adapter, you should only read the forum, and post your questions on the forum, in the support section.
(and to answer your question: no, polling rate and baud rate are different things)