Author Topic: Is there any recent project to connect a PC (PS/2) keyboard to the CPC?  (Read 19445 times)

0 Members and 1 Guest are viewing this topic.

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.103
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1965
Why emulate if i have orginal Asic's?


Really? How much did you get? Where to get em?  :o
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline Munchausen

  • 6128 Plus
  • ******
  • Posts: 750
  • Country: gb
  • Liked: 194
@gerald, how would you connect this circuit to a CPC+?

EDIT: sorry I just saw your post on the previous page!
« Last Edit: 09:55, 20 July 15 by Munchausen »

Offline n_sonic

  • CPC464
  • **
  • Posts: 7
  • Liked: 0
Very old topic... Gerald, hi! I do not know when you will read this post, but i have a small question to you. How about a mistake in schematic? IC2 pin 13 and IC3 pin 7 connection? May be IC3 pin 7 must be connected to pin 14 of IC2....?  ;)

Offline gerald

  • 6128 Plus
  • ******
  • Posts: 1.128
  • Liked: 812
Very old topic... Gerald, hi! I do not know when you will read this post, but i have a small question to you. How about a mistake in schematic? IC2 pin 13 and IC3 pin 7 connection? May be IC3 pin 7 must be connected to pin 14 of IC2....?  ;)
The 74HCT138 detect writes to PPI port C (F600 = xxxx 0x10 xxxx xxxx). PPI only see A11 (used as chip select) and A9-A8 (used a A1-A0).
Since 74HCT138 input are wired as follow :
 A = A8   = 0
 B = A9   = 1
 C = A11 = 0
You want to detect CBA = 010 = 2, So I am using Y2 on pin 13

Offline n_sonic

  • CPC464
  • **
  • Posts: 7
  • Liked: 0
Anyway, i don't want  to injure you, dear Gerald, but in my one it works fine realy in this wariant 14-7. Working with all my keyboards, brand and noname china. May be it's mystical, but it works... Some time ago i decided to reanimate this (after four years  :) )project. Two days of hard work, replacing avrs and hct138, cheking all wires and contacts... It starts working. I can place hear bios rom rp23256 and your hex files correctly operating in my case. May be it will help to some members of this forum...
« Last Edit: 13:42, 28 January 16 by n_sonic »

Offline gerald

  • 6128 Plus
  • ******
  • Posts: 1.128
  • Liked: 812
Anyway, i don't want  to injure you, dear Gerald, but in my one it works fine realy in this wariant 14-7. Working with all my keyboards, brand and noname china. May be it's mystical, but it works... Some time ago i decided to reanimate this (after four years  :) )project. Two days of hard work, replacing avrs and hct138, cheking all wires and contacts... It starts working. I can place hear bios rom rp23256 and your hex files correctly operating in my case. May be it will help to some members of this forum...
No injure  ;)

14-7 variant will work if you swap A8/A9, which was the case on the 1st released schematics (label were wrongly placed) : Is there any recent project to connect a PC (PS/2) keyboard to the CPC?

BTW, here is the latest version, which should work with all keyboards.
I've fixed the PS2 protocol errors that cause some keyboard to fail (Thanks to @Bryce for sending one of these keyboard)
I've also slightly optimised the code for AVR


Offline n_sonic

  • CPC464
  • **
  • Posts: 7
  • Liked: 0
Thanks Gerald! You`re the best as always! Great wishes from "well-known" Crimea, Sevastopol city...  :D
« Last Edit: 15:42, 28 January 16 by n_sonic »

Offline zrusavpt

  • CPC464
  • **
  • Posts: 10
  • Country: de
  • Liked: 2
Folks, I wonder if you could help me with this project :) I've built it on a piece of perfboard, using the bits and pieces I had at hand (SMD ATTiny2313 and DIL HCT138). It was a challenge to make it work, as I based my work on the 'wrong schematic' with A8/A9 swapped, but logic analyzer and a bit of brain work gave me the hint.
Now, it sort of works, but a single keypress usually results in two different CPC keys being emulated - e.g., pressing 'w' on PS/2 keyboard results in 'wq' or 'qw' displayed on the screen. My first idea is that the ATTiny is somehow slow or whatever. Is there any specific change needed for ATTiny2313 (other than makefile target change)?
Thanks!

Offline gerald

  • 6128 Plus
  • ******
  • Posts: 1.128
  • Liked: 812
Folks, I wonder if you could help me with this project :) I've built it on a piece of perfboard, using the bits and pieces I had at hand (SMD ATTiny2313 and DIL HCT138). It was a challenge to make it work, as I based my work on the 'wrong schematic' with A8/A9 swapped, but logic analyzer and a bit of brain work gave me the hint.
Now, it sort of works, but a single keypress usually results in two different CPC keys being emulated - e.g., pressing 'w' on PS/2 keyboard results in 'wq' or 'qw' displayed on the screen. My first idea is that the ATTiny is somehow slow or whatever. Is there any specific change needed for ATTiny2313 (other than makefile target change)?
Thanks!
The 2313 is fast enough for the task.
The double key may be due to the connection to the keyboard itself. This may happen if the capacitance of the connection is high enough to prevent the keypress to go up fast enough between 2 rows.
Did you try to add pull-up on the keyboard rows (about 4k to 2.4k)

Offline zrusavpt

  • CPC464
  • **
  • Posts: 10
  • Country: de
  • Liked: 2
Thanks, Gerald :) Actually, it did not help, but while adding the resistor net, I did realize I have completely ignored blocking capacitors. I have added one 470uF across the PS/2 keyboard power, and 100nF across the ATTiny and HCT138 power pins.
Now one key press generates just one letter on the screen, however, it's a wrong letter: F produces D, B produces C etc etc :) I believe I have shifted the keyboard rows by one. Could you possibly tell me what AY pin should go to what ATTiny pin? The CPC schematics I have uses X1-X8 for the AY pins, while your schematics uses X0-X7. I assumed AY X1 corresponds to your X0, but it doesn't seem to be the case. Thanks!