avatar_Joss

Is there any recent project to connect a PC (PS/2) keyboard to the CPC?

Started by Joss, 18:42, 27 August 12

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Joss


Hi!


First post, first question ..  sorry ... I was looking for information about how to connect a PC keyboard (PS/2) to an Amstrad CPC. I found CPCKey MF-2 Keyboard interface for Amstrad CPC Is there something newer out there?


Thanks!


P.S.: Ahhh ... something about me .... Amstrad CPC was my first computer: CPC664. I still have it up and running (drive belt was changed for a couple of years). I would like to learn something more about it and, as I see, there is a lot of information out there. Thanks for this great place an for keeping the platform alive.

Bryce

Hi,
   welcome to the forum. There's this too: CPCKey - CPCWiki a DIY PS/2 replacement for the keyboard,but it's just as old. Unfortunately, the way the CPC reads key inputs means that the hardware is always relatively complicated too.

Bryce.

Joss

Thanks Bryce. As I see there is nothing else  ::)   ...... I will try to mount it. I was thinking it could be good for CPCs which keyboard does not work anymore ....


Joss





Badstarr

Were you just asking out of general interest or is there a problem with your 664?
Proud owner of 464 GTM64 6128 GTM65, GX4128 and a 464/6128 Plus Hybrid a 20 year long ambition realised! :-)

arnoldemu

Quote from: Bryce on 22:38, 27 August 12
Hi,
   welcome to the forum. There's this too: CPCKey - CPCWiki a DIY PS/2 replacement for the keyboard,but it's just as old. Unfortunately, the way the CPC reads key inputs means that the hardware is always relatively complicated too.

Bryce.
Perhaps we need a Bryce twist on this?
a new idea which is more simple?
would a PIC or something really chip do it?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

HAL6128

Quote from: Joss on 18:42, 27 August 12
Hi!


First post, first question ..  sorry ... I was looking for information about how to connect a PC keyboard (PS/2) to an Amstrad CPC. I found CPCKey MF-2 Keyboard interface for Amstrad CPC Is there something newer out there?


Thanks!


P.S.: Ahhh ... something about me .... Amstrad CPC was my first computer: CPC664. I still have it up and running (drive belt was changed for a couple of years). I would like to learn something more about it and, as I see, there is a lot of information out there. Thanks for this great place an for keeping the platform alive.

...it seems that the post ABBA switch, the other way
gerald has build up some kind of ps/2 keyboard adapter (Don't know if it's the same as mentioned above)? Maybe you can ask him?
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Bryce

Geralds solution looks like a very neat method. He does it properly by interfacing directly to the 8255 instead of using the Keyboard inputs / outputs. However, this could only be used on the Classic CPC as the Plus doesn't have an 8255, you'd need to interface to the ASIC.

Bryce.

arnoldemu

Quote from: Bryce on 09:34, 28 August 12
Geralds solution looks like a very neat method. He does it properly by interfacing directly to the 8255 instead of using the Keyboard inputs / outputs. However, this could only be used on the Classic CPC as the Plus doesn't have an 8255, you'd need to interface to the ASIC.

Bryce.
I forgot about that one.
Nice.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

MaV

I eventually need to build one myself as well, since one of my CPCs has a defect membrane.

My plan is to connect a microcontroller to the keyboard connector on the PCB. It'd need to have 2 x 10 pins dedicated to the keyboard pins and a few for the ps2 keyboard (perhaps even usb?), so a ATtiny or ATmega with 2-4kb and high IO-pin count would suffice.

However, this project has no priority, so it might take me a year or so to actually start it.

Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

Bryce

That's the complicated way of doing it. If it's a classic CPC, you can connect the µP to the 8255. That way you only need to monitor the 4 bits going to the 74LS145 and BDIR / BC2 and feed the result back to PORT A of the 8255. 14 pins instead of 20 and a lot less hardware.

Bryce.

MaV

Quote from: Bryce on 10:10, 28 August 12
That's the complicated way of doing it. If it's a classic CPC, you can connect the µP to the 8255. That way you only need to monitor the 4 bits going to the 74LS145 and BDIR / BC2 and feed the result back to PORT A of the 8255. 14 pins instead of 20 and a lot less hardware.
It's a CPC+ board, but in its current state, it's not usable.

It think connecting to the keyboard connector is an elegant solution as it assures that you can always switch back to a normal keyboard membrane, should you find one. And you don't accidentally damage the board while soldering the connections directly ... I can cope with destroying a puny uC but damaging a CPC board ... an unbearable thought.
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

gerald

Yes, i've done my own PS2 adapter years ago (2004), when I wanted to have a UK keyboard on my French 6128  :D .

It's made of on Atmel 89c2051 and on 74hct138 (under the 8255).
The 74hct138 detect write to the 8255 register C, used to control the PSG and therfore the keyboard matrix scan.
The 89c2051 handle the PS2 keyboard, does the PS2 keycode conversion to CPC matrix and update it on every key press change and access to 8255 C register.
Original keyboard CPC can still be used.

But that's the easy part  ;)

The tight integration was possible thanks to the unmounted resistor network near the 8255 that give access to the keyboard itself column.

The tricky part is the PCB itself (picture of the solder side of the 1st in-place prototype)
[attach=2]
I am using what I had available at that time and all decoupling capacitiors are 0402/0603  ::)
I did a 2nd proto (the one in the 6128) where the only difference is the use of a 8/10 epoxy PCB instead of 16/10. The 8/10 allow proper soldering of socket from the upper side, and give some clearance to the original keyboard. This is mandatory for 6128.

Now, should we consider this as a recent project ?
1. The controller is outdated, and I have to check if I still can compile code for it, at least to check that my code base is still correct  ::) . The compiler I used was a 1996 DOS C compiler  :laugh:
2. PCB would need to be modified to accomodate more human solderable capacitor.

Ideally porting it to a more recent controller would be better. Atmel ATtiny2313/4313 are pin compatible with the 89c2051 and may be fast enough with they embeded oscillator. That would save the 24MHz (yes !!!) quartz, and free 2 pins on which we could either add a mouse port or control an ABBA switch (the other way  ;) ) and a side switch.




Joss

@Badstarr: my 664 is working fine ... at least last time I was using it  ::)  I won't try to touch it, just in case I make something wrong .....  I was getting a couple of CPCs from ebay and one of them has the problem.


@Gerald: since you use microcontroller and not and "old" (but powerfull ;-) 8-bit CPU, i would say: your project is "recent".
Your project looks fine, but I want to use the standard CPC keyboard interface. It should be easy for people who only want to test his/her CPC after a couple of years. You could try to put every information you have about your project and put it in the cpcwiki. It can help other people who are more braver as I am.


I think I will try to build the CPCKey project, just to test if it works and as it uses the standard keyboard interface the CPC should not be broken in the process ..... (it's my first HW project) ...... I will use a Schneider. The Interface can be "hacked" without modification of the components .... I think.


[dreamer on]
Thinking about the project and looking at the schematic of the CPC ... could it be possible to read the reading messages for the keyboard from the expansion port? As I see they are put in the data/address bus and they are read by the PPI. The feedback signal could perhaps come from the joystick port.
If it works, you need an micro controller which host a PS/2 keyboard and read the messages from the expansion port, and give the CPC the feedback about keystroke over the joystick port. You don't need to open the CPC and it can be used with other CPCs.
[dreamer off]


Thanks everyone for your answers.








Bryce

Nice dream, but not a chance. There are quite a few signals you'd need, that don't go to either the expansion port or any other port for that matter.

Bryce.

MacDeath

May i even reverse the question ?


My brother would like to pute a Raspberry inside an Oric Atmos... (but I guess you could fit it inside a CPC...)


What kind of stuff would be needed to turn those old school keyboards (membrane CPC style or other) into a workable USB raspberry friendly awesomness ?


Considering the Raspeberry is quite small sized, I guess you could even put it inside a CPC or PLUS without even removing the Amstrad motherboard.


There could perhaps even be some interesting possibilities with such Raspberry-enhanced Amstrad CPC/PLUS.


Could such Raspberry get a proper OS/App so it could help to display the CPC on a modern monitor through the Raspberry in a "Hardware emulation " mode... like the CPC become a Card to sort of emulate (not emulation but real job actually) the CPC... then the raspberry... well...nevermind. :D

Ynot.zer0

Quote from: MacDeath on 22:07, 28 August 12
May i even reverse the question ?


I have a BeagleBone and I'd like to stick it inside a CPC..... it runs Linux, so I can run an emulator perfectly okay within it.... but can I get the keyboard of the CPC to play nicely - like MacDeath is asking about Raspberry?  anyone got any pointers on whether this is possible / feasible? (I think I may have asked a similar question like this a couple of years ago!  ;D )

MacDeath

I guess such sort of thing would need :


=a Hardware converter "old Keyboard matrix to USB standard", need some chips and solderings, a few appropiate connecters too.

=Some drivers : would it be software (from the OS) or already integrated into the converter (programable chips...). Probably a bit of both.




Hey i didn't knew about this BeagleBone, I guess it is some sort of RarspduinoBerry ?
Those look ice but as I told, I would prefer a solution where you can actually connect those computers with the CPC, giving some good new options more than just emulating old CPC on them.


The best CPC emulator remains the CPC itself.
And those "computers on a small card" surely have enough process power to perform many conversion things to help a CPC...


like :
=emulating DiskDrive or HDD or Tape ?
=be used as a display solution for modern Monitors ?


This must be only sweet dream I guess.


Would need another whole card full of components, and also some lot of soldering right on the CPC motherboard/Connectors too.

Solid point is that such Machine could just be some nice replacement for 3" disk drives...


But I suppose those boards are not 5V friendly (= CPC voltage)





This said, at 149$ or 89$, those machines are not that cheap, and a "CPC shield" would add up a lot on this.

Joss

@Bryce: I had to try  ::)


@MacDeath: old computers keyboards with membrane are switches connected direct to the mainboard, and new computers keyboards are ...... switches too with logic to make it PS/2 or USB compatible. Perhaps can you use an old PC keyboard with a couple of keys which do not work anymore and take the logic to adapt it to the old computer keyboard.
I found this funny project which can be used as example  :D :
Hacking a toy guitar to make a "Frets on Fire" controller
Use the Ory keyboard instead of the guitar.


@Ynot.zer0: nice gadget, I didn't know about it!

arnoldemu

Quote from: MacDeath on 22:07, 28 August 12
Could such Raspberry get a proper OS/App so it could help to display the CPC on a modern monitor through the Raspberry in a "Hardware emulation " mode... like the CPC become a Card to sort of emulate (not emulation but real job actually) the CPC... then the raspberry... well...nevermind. :D
When I get my raspberry pi.. which will now be in october because of delays from RS components, I will convert my wip arnold emulation to it.
then I will have cpc on my hd 1080p television :)

I already borrowed one from a friend, and I compiled Arnold on it and it ran but slowly :(. So I need to work to make emulation faster.
The guy asked for it back.. so now I must wait for mine.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Quote from: MacDeath on 22:07, 28 August 12

Could such Raspberry get a proper OS/App so it could help to display the CPC on a modern monitor through the Raspberry in a "Hardware emulation " mode... like the CPC become a Card to sort of emulate (not emulation but real job actually) the CPC... then the raspberry... well...nevermind. :D
Raspberry runs linux. it has a proper OS and can run many emulators already (snes, spectrum, mame...).
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Quote from: Ynot.zer0 on 23:44, 28 August 12

I have a BeagleBone and I'd like to stick it inside a CPC..... it runs Linux, so I can run an emulator perfectly okay within it.... but can I get the keyboard of the CPC to play nicely - like MacDeath is asking about Raspberry?  anyone got any pointers on whether this is possible / feasible? (I think I may have asked a similar question like this a couple of years ago!  ;D )
When I've done some more optimisations, I think my wip of arnold will work on it.
I see it's a SOC, with ARM cpu, some kind of graphics chip in it.
If it does OpenGL/OpenGL ES/SDL it'll work fine.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Bryce

Connecting a real CPC keyboard to other devices is really easy. A simple µP (PIC/AVR) can easily scan the keys. The only slightly difficult part is the interface to the new device. If it's a USB connection, the device would need to emulate USB HID, but if it was something like an Arduino or Beagle bone, the device could simply produce an 8-bit value on the TTL inputs available. Then the entire hardware would be a PIC and a few resistors / capacitors. Could be made for under €10.

Bryce.

Ynot.zer0

Quote from: arnoldemu on 09:30, 29 August 12
Raspberry runs linux. it has a proper OS and can run many emulators already (snes, spectrum, mame...).
Don't get me wrong, I was eye-ing up the Raspberry Pi recently.... and then I stumbled upon the BeagleBone.
The BeagleBone is like an Arduino on steroids, it has 66 pins that you can play with and do a lot with.  It has capes (same sort of thing as Arduino shields), so you can plug daughter boards into it.  For instance a 3/7" touchscreen LCD.  Or you can build your own daughter board - perhaps for handling the processing of the CPC keyboard key presses and passing these to the BeagleBone?


OOTB the BeagleBone comes with Angstrom Linux and is pretty powerful as it is.  It's the full blown latest 32-bit Linux (probably the same sort of thing as the Raspberry Pi offers?)
With a little bit of investigation (and time) I've got it to also run Debian Linux at a very good speed, in fact I can code Java in eclipse on my laptop and get it to compile and build and run directly from the board.
It will also run Android 2.3.5 and Android 4.0.3 (I found an Android JellyBean beta out in the wild, but I'm not too interested in it at the moment).  If you boot the BeagleBone into Android, it is just that, a full blown Android device running on a 3/7" touchscreen LCD, so if you have any apps that already run on Android they should work as-is.  Not bad for an $89 board..... but, hey it also allows you to tap into all those pins too, so that's where the "it's more than an Arduino / Raspberry Pi" comes from.  My longer term goal is to use it with OpenCV for object recognition in a robot project....
...but as a short-term goal, I like the idea of potentially using one of my old CPC 6128 cases (with no m/board inside), mounting the BeagleBone where the 3" drive bay is, connecting up the existing CPC keyboard as input, work out a way for the 3" or 7" LCD to 'slide' out of where the edge connectors on the back originally were and flip upwards to give a mini-laptop type of feel.... I can then use the power cape to provide power to the BeagleBone and contain it all within the CPC 6128 case itself.  The BeagleBone would boot into linux and then fire up a CPC emulator and have access to the Gbs of .dsk files I have on the microSD card too....   now, if we could just figure out the CPC 6128 keypress translation part....  8)


[edit: I just saw Bryce reply..... wow, looks like the rosetta stone part can be solved!?! I'm no electronics hardware engineer, I plug & plug and write code.... any assistance on how to cobble the PIC / resisters / capacitors together is most appreciated!)


Bryce

When I get time I'll put together a simple schematic. Generally any PIC with 3x 8bit ports + Port A will do. 10 bits output a binary sequence and another 10 then check what bits came back. A lookup table then decides what key was pressed and this ASCII value gets put on the 8bit port going to the Beagleboard. Other than a few pullup resistors (/MCLR pullup) and a few capacitors for the supply, nothing else would be required. You could probably even get away with using the internal PIC clock so that no external crystal is required.

Bryce.

Powered by SMFPacks Menu Editor Mod