PS/2 keyboard - SIO2

218 views
Skip to first unread message

Ian Rutt

unread,
Mar 31, 2026, 3:58:54 AM (10 days ago) Mar 31
to RC2014-Z80
I have the impression from various places that it should be possible to directly connect a PS/2 keyboard to the z80 SIO and read the characters the keyboard sends. 


However, I'm having trouble getting it to work, and I wondered whether anyone has suggestions (especially about how the serial port is configured).

I'm during port B, connecting the PS/2 clock to the clock2 line on the rc2014 backplane, and the PS/2 data line to the Port B rx line. 

I'm aware that some PS/2 keyboards require reseting before they begin transmitting keypresses. I am using this circuit to achieve this, though I intend to devise a better method (one that will allow commands to be sent to the keyboard):


I've connected up a scope and confirmed that the reset circuit works.

I'm also aware that the codes from the keyboard need to be decoded into ASCII characters. I will do this in software.

Does anyone have any insight? Many thanks in advance :)

Alan Cox

unread,
Mar 31, 2026, 6:16:35 AM (9 days ago) Mar 31
to rc201...@googlegroups.com
I've heard the story many times. I've never seen anyone make it actually work with an SIO because you have to deal with start and stop bits on the serial port.

In the end I built a board to bitbang a PS/2 keyboard and then a board that uses an 82C42 (ie a PC style keyboard controller) for the job. You can use a Z80 PIO to drive a PS/2 keyboard in bitbang mode, or pretty much any GPIO chip. You'll need a couple of diodes if you can't switch individual pins between output and input/high impedance.

The 82C42 is definitely the easiest way to do it.

Alan

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/rc2014-z80/bba2eb25-84ec-4a6d-95dd-32248e33ef69n%40googlegroups.com.

Ian Rutt

unread,
Apr 1, 2026, 11:33:08 AM (8 days ago) Apr 1
to RC2014-Z80
Many thanks, Alan - that's very helpful.

"I've heard the story many times" made me chuckle - the mythical PS/2-SIO connection, that everyone's heard of, but nobody's seen...

Ed Silky

unread,
Apr 1, 2026, 1:59:30 PM (8 days ago) Apr 1
to rc201...@googlegroups.com
It wasn't with an SIO, but back in the late 80's we used a PC keyboard on a terminal that we built (for production as a commercial product) using an SCC. Here is the portion of the schematic for the keyboard connector and the SCC. I worked in HW/SW engineering and wrote the firmware for it, but I don't have the source. I do have one of the terminals.

image.png

So, I know this can work! Maybe this will be helpful for those that want to give it a try.
-Ed



Alan Cox

unread,
Apr 1, 2026, 2:22:34 PM (8 days ago) Apr 1
to rc201...@googlegroups.com
Interesting indeed. This is the nearest thing I have seen to an answer so far. Inverting the jobs clock makes sense.

Alan

Alan Cox

unread,
Apr 1, 2026, 2:26:13 PM (8 days ago) Apr 1
to rc201...@googlegroups.com
Kbd clock rather.. trouble with replying on a phone

Ed Silky

unread,
Apr 1, 2026, 3:38:22 PM (8 days ago) Apr 1
to rc201...@googlegroups.com
If there's enough interest, I could hook my logic analyzer up and capture signal traces.

As I said, I wrote the firmware for the terminal, but I don't have the source (just one of the terminals and the schematic), and my memory isn't good enough to remember back 35 years. The processor is an 80C188 and most of the firmware is in C, but parts are in 8086 assembly. The terminal is a TRIAD Systems FDT, used on a TRIAD Automotive or Hardgoods inventory control and sales system. We used a lot of Zilog parts and had a very good working relationship with the Zilog engineers, so that is one of the reasons the terminal uses SCC's even though it is an Intel CPU. I designed hardware and wrote firmware for many Z80 based boards during my 16 years of working there.

-Ed

Ed Silky

unread,
Apr 2, 2026, 11:42:16 PM (7 days ago) Apr 2
to rc201...@googlegroups.com
For those that aren't familiar with the different Zilog peripheral chips, the SCC is similar to the SIO. The SIO has these same signals and capabilities available, so this circuit should work on an SIO.

I don't really have a need for a PS/2 keyboard input, but I might try wiring one up to let people know that it works.
-Ed

Ian Rutt

unread,
Apr 3, 2026, 4:07:17 PM (6 days ago) Apr 3
to RC2014-Z80
Thanks, Ed, that's really interesting. I'll see if I can get it to work.

Ed Silky

unread,
Apr 3, 2026, 8:36:55 PM (6 days ago) Apr 3
to rc201...@googlegroups.com
Okay Ian, as I said, I can hook up my analyzer and get signal traces if they would help. As I remember, we reset it once the terminal had passed its POST and then we just received from it. I'm sure you know that you get a 'make' code from the keyboard when the key is pressed and then a 'break' code when it is released, and every key has a code. So it is up to you to keep track of Shift, Control, Alt, etc.

-Ed

Peter Onion

unread,
Apr 4, 2026, 6:49:49 AM (5 days ago) Apr 4
to RC2014-Z80
Having "bit banged" a PS/2 keyboard interface on my RP2350 based VDU card I would be interested to see these signal traces.  
All the info I found shows the clock line not running continuously so I wonder how that is achieved if one of the SCC clock outputs is used.
PeterO

Ed Silky

unread,
Apr 4, 2026, 12:54:36 PM (5 days ago) Apr 4
to rc201...@googlegroups.com
Hi Peter,
I'll hook it up and get some traces. It might take a day or two.

-Ed

Ed Silky

unread,
Apr 8, 2026, 12:39:01 PM (yesterday) Apr 8
to rc201...@googlegroups.com
I want to let people know that I'm going to get these traces, but I'm busy this week, so it'll probably be the weekend before I can get to them.
Reply all
Reply to author
Forward
0 new messages