ST Keyboard on MIST

https://github.com/mist-devel/mist-board/wiki

Moderator: Moderator Team

mgreima
Atariator
Atariator
Posts: 19
Joined: Fri Oct 04, 2013 8:39 am

ST Keyboard on MIST

Post by mgreima »

Hello,
Im trying to connect a MegaST keyboard with Arduino over USB to MIST. The sketch ( https://github.com/devonshire/arduino-a ... d-keyboard ) works almost on my Linux-Box. A few keys dont work as labeled, because of my German Keyboard. So now Im testing it with the xev program on Linux. Is there a similar prog in Atari ST to show the scancodes, to try the kexbord on MIST?

Thanks, Marc.
User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1850
Joined: Fri Feb 08, 2013 12:15 pm

Re: ST Keyboard on MIST

Post by MasterOfGizmo »

Very nteresting project.

I don't know such a program. But in the mist sources you'll find a file named keycodes.h which includes the translation table from usb keycodes to Atari keycodes. You sketch should basically contain the opposite to work perfectly.

Till
MISTeryNano, tiny FPGA based STE: https://github.com/Harbaum/MiSTeryNano
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4025
Joined: Sun Jul 31, 2011 1:11 pm

Re: ST Keyboard on MIST

Post by Eero Tamminen »

mgreima wrote:So now Im testing it with the xev program on Linux. Is there a similar prog in Atari ST to show the scancodes, to try the kexbord on MIST?
Hatari sources includes one: http://hg.tuxfamily.org/mercurialroot/h ... sts/keymap
mgreima
Atariator
Atariator
Posts: 19
Joined: Fri Oct 04, 2013 8:39 am

Re: ST Keyboard on MIST

Post by mgreima »

Thanks, will try this from hatari.
mgreima
Atariator
Atariator
Posts: 19
Joined: Fri Oct 04, 2013 8:39 am

Re: ST Keyboard on MIST

Post by mgreima »

Hello,
Ive found another prg here in this forum for a teensy. Now my MegaST-keyboard works on linux, with the Atari-Mouse and a joystick. A quick check on Mist shows the keyboard works on the osd (Ive added a key for F12). But no mouse on ST :(
ryan
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 116
Joined: Fri Nov 07, 2014 12:17 am

Re: ST Keyboard on MIST

Post by ryan »

Do you have a link for the teensy one? I was actually planning on building such a thing myself. Even ordered a Teensy (tho it's a Teensy 3.1 so may not be applicable.) The Mega ST keyboard is a nice, mechanical keyboard. I could impress my coworkers with its clicky awesomeness, and it's got the Control key in the right place.
joska
Hardware Guru
Hardware Guru
Posts: 5936
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway

Re: ST Keyboard on MIST

Post by joska »

mgreima wrote:Ive found another prg here in this forum for a teensy.
That was probably mine.
mgreima wrote:Now my MegaST-keyboard works on linux, with the Atari-Mouse and a joystick. A quick check on Mist shows the keyboard works on the osd (Ive added a key for F12). But no mouse on ST :(
If the mouse works on Linux but not on MIST then MIST and Teensy isn't compatible :( Maybe the USB mouse implementation on the Teensy doesn't support boot mode.

This sucks, because my MIST "tablet"-project depends on the Teensy. I was planning to use the Teensy to drive the touchscreen.
Jo Even

VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
joska
Hardware Guru
Hardware Guru
Posts: 5936
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway

Re: ST Keyboard on MIST

Post by joska »

ryan wrote:Do you have a link for the teensy one?
See this thread.

ryan wrote:I was actually planning on building such a thing myself. Even ordered a Teensy (tho it's a Teensy 3.1 so may not be applicable.)
The Teensy 3.1 is a 3.3V device. Yes, it's "5v tolerant", but the ST keyboard is not 3.3V tolerant ;) So you'll need a 5v power source for the ST keyboard (maybe there is one on the Teensy 3.1?) and probably a pull-up resistor to 5v on the keyboard's RX line.

ryan wrote:The Mega ST keyboard is a nice, mechanical keyboard. I could impress my coworkers with its clicky awesomeness, and it's got the Control key in the right place.
You have good taste! Yes, the Control key is in the correct place. The Control key placement on modern keyboards is something invented by IBM when they designed their AT. Someone should probably be shot for that.

Not so sure about the Mega ST keyboard "clicky awesomeness" though. My Mega ST keyboard sounds and feels exactly like a normal ST keyboard. I did not even realize that it had switched until I opened it up for repair.
Jo Even

VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
mgreima
Atariator
Atariator
Posts: 19
Joined: Fri Oct 04, 2013 8:39 am

Re: ST Keyboard on MIST

Post by mgreima »

Yes it was your software from that thread.
Thanks for your code.

And it works with a teensy 3.1, thats what i tested. Theres a 5V line to power the keyboard.
ryan
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 116
Joined: Fri Nov 07, 2014 12:17 am

Re: ST Keyboard on MIST

Post by ryan »

So re: IBM inventing the caps locks key in that position for AT I don't think that's correct. I was at the computer history museum in Mountain View quite recently and there I saw WYSE and other 1970s dumb terminals, and typewriters/teletypes, etc. that had it in that position. I think it's inherited from typewriters. Often there'd a scenario too where ctrl would be left of caps, with caps being much smaller (see DEC VT terminals, for example). In any case it's a stupid arrangement. I use ctrl many times a minute, caps locks never.
joska
Hardware Guru
Hardware Guru
Posts: 5936
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway

Re: ST Keyboard on MIST

Post by joska »

ryan wrote:So re: IBM inventing the caps locks key in that position for AT I don't think that's correct.
You can find examples of this from way before the AT. But most personal computer keyboards had the Control-key in the correct position, until IBM decided to make two Control- and Alt-keys to make the keyboard easier to use. Good idea, if they hadn't moved them outside of reach... This was in 1987 (88?) when the first PS/2 was shipped with the Model M keyboard.
ryan wrote:I use ctrl many times a minute, caps locks never.
Exactly. Caps Lock has nothing to do on a modern computer. It's a relic from the old days when people where hacking away at text terminals and case mattered.
Jo Even

VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
ryan
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 116
Joined: Fri Nov 07, 2014 12:17 am

Re: ST Keyboard on MIST

Post by ryan »

Not so sure about the Mega ST keyboard "clicky awesomeness" though. My Mega ST keyboard sounds and feels exactly like a normal ST keyboard. I did not even realize that it had switched until I opened it up for repair.
So I have a Mega ST keyboard kicking around (with no Mega ST [yet]) to go with it. I went down last night and compared it against my Falcon two 1040STFs and a 520STM and it's night and day. The Mega ST is clicky & mechanical keyswitch, though not a super high quality one.

The Mega STE and TT ones though are apparently rubber dome mush again.

On a side note, I just bought a Sharp X68000, and its keyboard is fantastic quality mechanical keyswitches. I am going to build a similar USB converter for it so I can use it elsewhere. The X68000 is like a luxury car version of the 80s 16 bit 68k home computer. Lovely industrial design.
mgreima
Atariator
Atariator
Posts: 19
Joined: Fri Oct 04, 2013 8:39 am

Re: ST Keyboard on MIST

Post by mgreima »

For a converter fron x68000 to usb , heres a link:
https://github.com/tmk/tmk_keyboard/tre ... r/x68k_usb
ryan
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 116
Joined: Fri Nov 07, 2014 12:17 am

Re: ST Keyboard on MIST

Post by ryan »

mgreima wrote:For a converter fron x68000 to usb , heres a link:
https://github.com/tmk/tmk_keyboard/tre ... r/x68k_usb
Nice! Now I just have to get a second Teensy :-)

Or build one with both the RJ and the X68000 connector on it.
User avatar
johannes
Atari nerd
Atari nerd
Posts: 49
Joined: Wed Jun 28, 2006 9:51 am
Location: Germany

Re: ST Keyboard on MIST

Post by johannes »

Hi,

interesting projects! This thread was kick-off for my personal project to attach a 1040ST and a MEGA STE Keyboard to MiST. Currently I am experimenting with the 1040ST keyboard and an Arduino Micro.

The Arduino Micro is cheap (around 18 EUR), tiny and programming of the ATMega is fairly easy. I used a script by Kevin P, for my prototype. He utilized an Arduino Leonard (the same as the Micro, just larger) to built a RPi into a dead ST´s case.

http://www.kevinpeat.com/atari_pi.html

Though it was designed for a 520 ST keyboard, most keys also work on a 1040 ST keyboard. Actually I am currently writing this post on the ATARI keyboard ;-)

Goals:
Make the Arduino code compatible to 1040ST, Mega STE and MegaST Keyboards in different languages. If I can´t automatically figure out which keyboard is attached (I think I cannot), I will implement a programming mode where you can use key sequences of keys, available to all ATARI Layouts, to change Model and language.

Cheers
Johannes
Image
http://www.atari-home.de
Falcon060 w/ SV & Svethlana - Firebee - TT030 - Mega STE - Mega ST4 - Mega ST2 - 1040 ST(F/M) - Lynx II - Jaguar - Portfolio
User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1850
Joined: Fri Feb 08, 2013 12:15 pm

Re: ST Keyboard on MIST

Post by MasterOfGizmo »

I don't think you have to care for languages. The whole setup works on keycodes and as long as the labels on the keys match the language setting of your tos then most mapping should just work out of the box.
MISTeryNano, tiny FPGA based STE: https://github.com/Harbaum/MiSTeryNano
ryan
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 116
Joined: Fri Nov 07, 2014 12:17 am

Re: ST Keyboard on MIST

Post by ryan »

ok so I'm sitting here with a Mega ST keyboard plugged into RJ11 jack, wired up to a Teensy v3.1, and using the code from : https://github.com/devonshire/arduino-a ... d-keyboard

D0 and D1 from the Teensy are wired to RX and TX on the Mega ST keyboard respectively.

It sort of works, and by sort of I mean I see get lowercase letters, and numbers. No modifier keys, shift backspace, return, tab, etc. work.

I see the code for the scancode interpretation, but it appears to not work.

Is there somewhere else to look for a version of this that works with the Teensy?
ryan
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 116
Joined: Fri Nov 07, 2014 12:17 am

Re: ST Keyboard on MIST

Post by ryan »

Never mind, I found the ZIP from the other thread with the actual working source. Works now

A few keymappings are off for my US layout, and i get a little bit of weird repeating / skipping action, not sure why. But I should be able to fix it. I made up a (way too big) wire wrap board.

I may make up a little PCB for this and have it printed. Teensy does seem like somewhat overkill for this, but sure is convenient.
User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1850
Joined: Fri Feb 08, 2013 12:15 pm

Re: ST Keyboard on MIST

Post by MasterOfGizmo »

ryan wrote:Teensy does seem like somewhat overkill for this, but sure is convenient.
Maybe it makes sense to directly add a atmega8u or similar instead of the teensy.
MISTeryNano, tiny FPGA based STE: https://github.com/Harbaum/MiSTeryNano
joska
Hardware Guru
Hardware Guru
Posts: 5936
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway

Re: ST Keyboard on MIST

Post by joska »

The Teensy makes sense because it's so easy to connect to the keyboard (only four wires), and because it has so easy to use USB libraries. It is also quite inexpensive. There is currently no easier solution.
Jo Even

VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1850
Joined: Fri Feb 08, 2013 12:15 pm

Re: ST Keyboard on MIST

Post by MasterOfGizmo »

joska wrote:The Teensy makes sense because it's so easy to connect to the keyboard (only four wires), and because it has so easy to use USB libraries. It is also quite inexpensive. There is currently no easier solution.
The atmega8u is a very close relative to the atmega32u used on the teensy. So i thought that this would basically be a drop-in-replacement.
MISTeryNano, tiny FPGA based STE: https://github.com/Harbaum/MiSTeryNano
joska
Hardware Guru
Hardware Guru
Posts: 5936
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway

Re: ST Keyboard on MIST

Post by joska »

MasterOfGizmo wrote:
joska wrote:The Teensy makes sense because it's so easy to connect to the keyboard (only four wires), and because it has so easy to use USB libraries. It is also quite inexpensive. There is currently no easier solution.
The atmega8u is a very close relative to the atmega32u used on the teensy. So i thought that this would basically be a drop-in-replacement.
Yes, but it does not come on a ready-to-go breakout-board, pre-programmed with a bootloader :) That's the point, the only thing you have to do to connect an ST keyboard to a PC is to solder four wires between the Teensy and the keyboard connector. Then upload the already compiled binary with a single-file programmer and a standard USB cable. It doesn't get much easier than that.

Of course, if you're speaking about making a specific device to interface with ST keyboards then it doesn't make sense to use the more powerful atmega on the Teensy.
Jo Even

VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

Return to “MiST”