4

I am working on designing a Z80 computer and I would like to use a PS/2 Keyboard for input. I would like to use a PIO to communicate with it, but I am having trouble finding any documentation online on how to do so (outside of people saying you can).

I would like to avoid using any additional chips if possible (so no using shift registers) and I don't want to use any microcontrollers.

I believe that to start it would have to have the clock pin of the keyboard trigger an interrupt, outside of that I am not sure. If someone can write a detailed way to accomplish this, I would greatly appreciate it. Or if someone could write a code that works in my system, I would be willing to give a $10 reward via an Amazon Gift Code or something (unless you want to do it out of the generosity of your heart).

Feel free to ask questions. If you want schematics, let me know and I can email them to you. Thank you for your help in advance! I am new to all of this, so please forgive any ignorance on this project or using this forum :)

12

Preface, this is not really how RC.SE works. If you're looking for someone to design your hardware or write you a program, there are many sites out there where you can put a reward for someone taking the job. RC.SE is about answering your questions, as detailed as they are asked

I am working on designing a Z80 computer and I would like to use a PS/2 Keyboard [...] use a PIO

Well, this means you want to bitbang the serial protocol. Not a big deal. Essentially just follow the PS/2 protocol. It can be done synchronous or asynchronous. With a clock rate of just 10-16 kHz either way may work.

I am having trouble finding any documentation online on how to do so

All you need is a Z80 PIO manual and a protocol description, like this one which came up first when searching for "PS/2 protocol". It describes well what the interface expects/delivers, so all neccessary will be to handle the PIO as needed. All details see the Zilog manual.

Now, if you have to ask how to bitbang a rather simple protocoll like PS/2 on a Z80 PIO, then this project might bea above your level and it may be appropriate to rather use either a mouse/keyboard controller as the PC does, or, well, create your own using an AVR, PIC, 8051 or alike. Many projects exist out there, to be be easy adapted.

There is no shame in dedicating this task to another controller, it's the default way. Not at least as doing it from the Z80 will complicate your software, slow down your system and add unnecessary constrains.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.