Author Topic: transporting ps/2 kb & mouse and a Wacom tablet via serial: feasible?  (Read 572 times)

0 Members and 1 Guest are viewing this topic.

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 2093
  • Country: gb
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: [Select]
.                   ______________                                 ______________
.                  |              |                               |              |
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
                   |              |                               |              |
                   |______________|                               |______________|
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 10183
  • Country: fr
Sure, why not?
Something as cheap as the RP2040 should be fine for this. Heck, with it, you could even add a USB port.
 
The following users thanked this post: DiTBho

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 11546
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.
 
The following users thanked this post: DiTBho

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 2093
  • Country: gb
Transport how far?

Yup, I forgot to mention: 3 meters  :D

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.

Unfortunately there is no USB support and I cannot add it.
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 2093
  • Country: gb
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 :D
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 10183
  • Country: fr
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.
 
The following users thanked this post: DiTBho

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 2093
  • Country: gb
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.

I will use RS422 on a twisted+shielded CAT5 Ethernet cable

twist-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.

 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 10183
  • Country: fr
Good.

Also be careful with the logic levels. The RP2040 does not have 5-V tolerant IOs AFAIR.
 
The following users thanked this post: DiTBho

Online magic

  • Super Contributor
  • ***
  • Posts: 4988
  • Country: pl
RP2040 should be fine for this.
Not Arduino? :scared:
And AVR is 5V tolerant, obviously.

BTW, you could also use two PCs running custom DOS software, if we are at that :-DD
« Last Edit: June 28, 2022, 09:21:50 am by magic »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 4133
  • Country: fi
    • My home page and email address
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-N high bits the substream channel, and N low 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...)
 
The following users thanked this post: DiTBho

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 2093
  • Country: gb
Re: transporting ps/2 kb & mouse and a Wacom tablet via serial: feasible?
« Reply #10 on: June 29, 2022, 12:08:00 pm »
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-N high bits the substream channel, and N low 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.

yup! 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 :D
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf