X68k PS2 Keyboard converter

Started by alamone, November 15, 2013, 12:34:14 AM

Previous topic - Next topic

alamone

Has anyone managed to get this working?
http://d.hatena.ne.jp/nicotakuya/20080710/1215690669

I finally got my USBtinyISP to work properly and have written the "default/ps2x68k.hex" file into the FLASH of the ATTINY26L using AVRDUDE.
I also wrote the lower fuse to 0xE4, according to the "program_fuse.bat" file in the package.

I have double checked that the wiring on my PCB is correct; it only shows 3 wires connected to the X68 side.
The keyboard LEDs do blink when connecting, but I think that only indicates that +5V and GND are properly connected.
The X68k never responds to any key inputs.

I know that people have built and used the M.Sawada circuit successfully. I was looking for something
with less discrete components for less soldering work, but its turning out to be more work since it's not even working.
Am I missing something here? Does the EEPROM need to be programmed with something?

lydux

This is basically the same idea as mine. But I use a very small attiny85 instead, so it does fit directly inside a keyboard.

Quote
The keyboard LEDs do blink when connecting, but I think that only indicates that +5V and GND are properly connected.
That's right, it's an internal self-test sequence inside the keyboard. Having the 3 leds truned on for a second means a correct pass.

According to the schematic and source code, there is an optional led connected the AVR pin 9. It should turn on each time you press a key. Meaning a correct detection of a key. Have it ?

alamone

I just soldered the LED in, it just kind of flickers erratically and not in response to any key inputs at all.
If you have an alternative circuit design that actually works, I may be interested in it.

lydux

Here is NFG wiki link about keyboard : http://gamesx.com/wiki/doku.php?id=x68000:don_t_have_a_keyboard

My older design is the one in the bottom of the page. However, I don't recommand you to build it. My newer one look likes more to yours, it's simplier, so keep it.

I don't have an attiny26, but all 8 bits AVR series are similar. Let me some times finding my newer design source code, modify it, and drawing an equivalent schematics for an attiny26.

Please be patient.

alamone

Sure, thanks for the heads up. In the meantime I'm going to keep trawling YAJ for a reasonably priced keyboard.
I also found this pre-assembled converter; it's a bit pricey, but they have PS/2 and USB versions, both for keyboard and mouse:

http://classicpc.org/cpc_x68000.html

lydux

Ok done !

The wiring is basically the same as nicotakuya design, except that the PS2 side use these pinouts :
- PS2 clock on PB6 (pin 9)
- PS2 data on PB4 (pin 7)
No led, and the rest remains the same.

Here is the raw .hex file content for an attiny26 : http://pastebin.com/MBJUXbbv

As for fuses, 0xE4 for low and the default 0xF7 for high.

Say to me if it does work, and if you need different keys mapping.

alamone

Wow great! I will give it a try tonight. Thanks.

alamone

Hmm, I rewired the lines (PS2 pin5 to AVR pin 9, PS2 pin 1 to AVR pin 7) and tried it, but it does not work; on one keyboard the LEDs stay on the whole time, on the other keyboard the LEDs blink and stay off, either way neither keyboard works. Also, I was not able to adjust the Hfuse - it would error on attempting to modify it, even if I use the -u switch.

avrdude: reading input file "0xF7"
avrdude: writing hfuse (1 bytes):

Writing |                                                    | 0% 0.00s ***failed;

My default value for the hfuse is 0x17. Not sure how critical this is.

lydux

Of course... It can't work if I don't send keystrokes to the x68k... My mistake, sorry !
Please try this newer firmware : http://pastebin.com/WxLMf3se

0x17 for hfuse is also correct, as the higher 3 bits are unused on attiny26.

Quote
Hmm, I rewired the lines (PS2 pin5 to AVR pin 9, PS2 pin 1 to AVR pin 7) and tried it, but it does not work; on one keyboard the LEDs stay on the whole time, on the other keyboard the LEDs blink and stay off, either way neither keyboard works
Strange... All leds should turn on only for a second at startup, then should go and stay off. My code doesn't write to the keyboard, so should not interact with leds.

alamone

Just tried it; now the keyboard LEDs flash on both, but still nothing happening.
I'm starting to wonder if my X68000 itself is bad, but I can't test it without a known working keyboard or adapter. Sigh...

SuperDeadite

Hard to test without a real known working keyboard, but there was one point where my keyboard stopped working, then if I plugged it in it would short out the whole system, a day later the PSU died.  Replaced it with a spare, and all issues went away.

alamone

Just want to report that I got the keyboard converter from classicpc.org and it works fine with my PS/2 keyboard.
A little expensive but worth it to have a ready-to-go solution for me. After getting into switch.x I was able to
switch the boot to SCSI1 and booting into external CF works fine. Just need to replace that noisy 40mm fan now.