transporting ps/2 kb & mouse and a Wacom tablet via serial: feasible? - Page 1
Forum section: electronics / general

author: DiTBho
author_rank: Super Contributor
timestamp: June 27, 2022, 01:47:29 pm
content: The Wacom tablet uses a serial line in NULL modem configuration, transporting data @ 9600bps.I am thinking about using a serial line @ 1MBps to transport ps/2 kb & mouse and the Wacom tablet.Code:. ______________ ______________. | | | |ps/2 keyboard ---->| FIFO | | FIFO |----> ps/2 keyboard| \ | | / |ps/2 mouse ---->| FIFO - merge |========== fast uart ==========| split - FIFO |----> ps/2 mouse| / | | \ |Wacom tablet ---->| FIFO | | FIFO |----> Wacom tablet| | | ||______________| |______________|

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 27, 2022, 05:53:44 pm
content: Sure, why not?Something as cheap as the RP2040 should be fine for this. Heck, with it, you could even add a USB port.

author: Ian.M
author_rank: Super Contributor
timestamp: June 27, 2022, 06:32:25 pm
content: Transport how far?If its only a few meters and the host has full USB support, it may well be simpler/easier to use USB, with a USB serial adapter, and a USB to PS/2 interface on a hub at the input device end.

author: DiTBho
author_rank: Super Contributor
timestamp: June 27, 2022, 07:25:32 pm
content: Quote from: Ian.M on June 27, 2022, 06:32:25 pmYup, I forgot to mention: 3 metersQuote from: Ian.M on June 27, 2022, 06:32:25 pmUnfortunately there is no USB support and I cannot add it.

author: DiTBho
author_rank: Super Contributor
timestamp: June 27, 2022, 07:28:06 pm
content: OK, so tomorrow I will think about the transport-protocol (something very simple), and then I will try to implement it.I have already ordered two RP2040 units like suggested by SiliconWizard

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 27, 2022, 07:52:27 pm
content: For the several-meter 1Mbps link, I'd suggest adding some RS-485 drivers, ideally, and use a twisted pair. 1Mbps UART over a simple 3-m cable might be pushing it a bit, especially if the environment can be a bit noisy.

author: DiTBho
author_rank: Super Contributor
timestamp: June 27, 2022, 08:17:02 pm
content: Quote from: SiliconWizard on June 27, 2022, 07:52:27 pmI will useRS422on a twisted+shielded CAT5 Ethernet cabletwist-pair1 { TX+, TX- }twist-pair2 { RX+, RX- }twist-pair3 { Gnd, Gnd }twist-pair4 { 12V, 12V }The Wacom tablet is powered by 12V (200mA), keyboard and mouse by 5V(500mA), so I will use a DC/DC from 12V to 5V to power them.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 27, 2022, 08:42:51 pm
content: Good.Also be careful with the logic levels. The RP2040 does not have 5-V tolerant IOs AFAIR.

author: magic
author_rank: Super Contributor
timestamp: June 28, 2022, 09:18:04 am
content: Quote from: SiliconWizard on June 27, 2022, 05:53:44 pmNot Arduino?And AVR is 5V tolerant, obviously.BTW, you could also use two PCs running custom DOS software, if we are at that

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 29, 2022, 10:10:55 am
content: The thing that could bite is the latency, so do carefully consider what kind of a protocol you'll use.Personally, I'd use a combined substream-and-length byte, with 8-Nhigh bits the substream channel, andNlow bits indicating length; maybe 4:4, with zero channel reserved for transport and configuration messages, and zero byte (zero channel, zero length) reserved for synchronization. That way, sending 17 zero bytes ensures the other end is synchronized, no matter what was sent before.For example, if one end is an SBC or other built in hardware port, and the other end a microcontroller with suitable serial ports, then zero channel could be used to configure each external port. In fact, one could then even write a simple Linux kernel driver that when bound to a serial port, provides the end point serial ports as device nodes, uses the zero channel for port configuration, and multiplexes the communications on the actual hardware connection.(Alternatively, you could use say 1 bit to indicate control message (even support RTS/CTS handshaking using control messages), 3 bits the channel, and 4 bits for the message length. You do want to keep the message length small, and implement some kind of (round-robin?) scheduling between the channels, to keep the latencies on each channel acceptable.)This is very similar to what I've been playing with on my Odroid HC-1: it doesn't expose any GPIOs, only a basic UART (VCC, RX, TX, GND) with 1.8V logic levels. One of my projects is to use a Teensy 4.x (with 74LVC1T45 level shifters) to interface to the UART, multiplexing the single connection between serial console (exposed by the Teensy via Ethernet and/or USB) and a 2.8" IPS panel 320x240 display. There, too, the main issue is the multiplexing protocol, except that serial messages tend to be short, whereas display commands and data tend to be long, which complicates things if one wants to be efficient. (The Odroid HC-1 does have USB ports, so I could use that instead, however. It's fun to play with...)

author: DiTBho
author_rank: Super Contributor
timestamp: June 29, 2022, 12:08:00 pm
content: Quote from: Nominal Animal on June 29, 2022, 10:10:55 amyup! Good points!I am also considering VHDL design on two small CPLDs for both the two parts, and in this case I can go up to 20MBps with an auto-synchronization protocol over RS422 PHY.I will see next days