• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

PS2 Keyboard on Mac Plus

dougg3

Well-known member
Very, very nice work bbraun!

Just out of curiosity on the USB part, is the hub a software or a hardware limitation? Does the STM32 chip itself not support hubs in host mode, or is it a matter of their software USB stack not supporting it? I don't know nearly enough about USB, I just have noticed hubs have been a problem on a lot of microcontroller USB host projects...

 

bbraun

Well-known member
As best I can tell it's a software limitation. I've found reference to a couple RTOS' around supporting hubs and the stm32f4, although I wasn't really looking for an RTOS, so didn't dig that deeply. I've also found reference to some commercial stacks that support it.

I'm using the ST sample stack, which fundamentally assumes 1 device. So even if I did get USB hub support working, getting the rest of the stack to understand there may be multiple devices would still be an issue. Adding hub support to the sample stack seems beyond the scope of a hobby project, at least for the amount of time I can realistically invest in it. Finding and converting to an RTOS that already supports hubs on this hardware is an option, although my existing adb & pre-adb code would need to be ported.

 

bbraun

Well-known member
That is my intention: to make all of this available to anyone that wants it.

The PS2 keyboard/mouse to pre-ADB setup (with programmed stm32f0discovery and mouse cable) is $20 + shipping.

You'll need your own mini-b usb cable to power the board.

However, please read the comments above about programming it, testing I've done, etc.

Give me a week or so to get all the pieces, assemble, program, and test the board before shipping.

I tried to describe the current status of the various projects in my earlier post, and the intention was to see if there was any interest in any of them. I'm probably not going to run off PCBs for the other variations just for myself. If anyone is interested in the ps2 to adb, usb to adb, or usb to pre-adb, given my earlier comments, I can certainly work on it.

 

CC_333

Well-known member
Is the pre-ADB keyboard connector wired such that a regular phone cable will work unmodified?

c

 

bbraun

Well-known member
Yes, I'm using a stock plus keyboard cable. It's just a straight through rj11 4p4c cable, also sold as a phone handset cable.

 

CC_333

Well-known member
OK, almost...

So it can use either a stock mac Plus cable (which has two wires swapped, if I remember correctly) and a regular, unmodified cord from a phone?

If it doesn't, it should :) . Apparently it was a common mistake to use a regular cord in place of the stock one, causing components to blow up and stuff xx( .

I think I might be interested in one of these, so I can at least use a Plus (or 128k-512k) without a stock keyboard (for testing purposes).

Also, is there a chance you might make an ADB to USB (so one can use ADB mice and keyboards on a USB equipped machine)?

c

 

bbraun

Well-known member
Looking at my plus keyboard cable, it's straight through, but looking at the handset cable I chopped up to make my test cable, it is (was) reversed. Yeah, that would be bad, since power and ground would then be swapped. So, yeah, don't use a handset cable and thanks for pointing that out.

I could do an ADB to USB adapter. The code I have now for ADB is for a device. The host side code is a bit different. But would you be better off getting an iMate? They still show up from time to time on ebay and lemswap. The board I'd use is about $15 + shipping, I'd then need to make a PCB plus components (maybe just an ADB connector?). But I couldn't imagine it being less than about $20-$25, which is slightly cheaper than what iMates seem to go for, but not by much. Plus the iMate is all in a nice case. So, something to think about.

If you're still interested, let me know. Would you be able to program it, or would you be using it as-is?

 

NJRoadfan

Well-known member
Wonder if the ADB to PS/2 adapter works on a IIgs. ROM 01 machines are known to be picky since they have first revision ADB controllers..... after all the IIgs was the first machine to have ADB.

 

bbraun

Well-known member
Well, I went ahead and did another revision of the pre-ADB/PS2 board to fix the DB9 wiring, and added an ADB port, along with a jumper. The idea is to use the jumper to select between pre-ADB and ADB output. This means another 3-4wks before it arrives. I figure even if no one else cares, that board will be "done" and I'll be able to let the project rest. :)

I've back burnered the USB version, mainly because it only supports one mouse or one keyboard at a time. That's just kind of unfortunate. Maybe at a future date I can see about some of the alternatives (hardware or software).

As for whether it works on a ROM1 IIgs, I can give it a try. I've got one in the storage room. The ADB project is still currently in the hacked up wires on a hacked up board stage. It's working well enough as a proof of concept, and I'll be working on refining it and adding keyboard support when the new board arrives.

 

bbraun

Well-known member
I have what will probably be the final PCB of this board:

combopcb1.jpg

It does both pre-ADB and ADB, keyboard and mouse. I've been using it with an SE and a 9600. I can't claim it's perfect, but I've been using it as my work keyboard & mouse for a day or so, and it seems to work OK for me. It has the Mac/ADB jumper on it, but that's actually ignored. It outputs to both pre-ADB and ADB simultaneously. I've got a video of it controlling a Plus and an SE with the same PS2 keyboard & mouse:

If anyone wants one, let me know. Since anyone buying one will be the first to use it besides myself, you should view this as a chance to participate in the development of this project, rather than viewing it as purchasing a final product. I'm selling these at cost, and if anyone wants the source or gerber files to make them yourself, let me know and I can provide those as well. I think it's about $20 for one of these, plus shipping. I'll need to order the stm32f0discovery and program it before sending any of these out, so there will be some lead time.

I don't plan on any further functional revisions of the PCB. I've got 10 PCBs, I'd like to keep a couple for myself. If there's sufficient interest to kick off another PCB run, I'll probably remove the unused jumper, but that's about it. I'll do software updates as bugs are found and fixed, and the update method is mentioned earlier in the thread.

 

bbraun

Well-known member
Oh, one other thing worth mentioning, I've sent off for some PCBs with both pre-ADB and ADB connectors for the stm32f4discovery board, which is the board I'm using for USB. Again, this board can only handle mouse or keyboard, not both, and it'll probably be ~$30 total for parts. So although no revisions are planned for the ps2 version of the board, progress marches on.

Given the limitation of only one keyboard or mouse per board, and that it'll probably take me at least one more revision of the board to get it satisfactory, I don't expect many takers. I'm mostly making the PCBs as a matter of completeness since I've already done most of the software for it with hacked up cables. May as well make some PCBs and make it usable, even if no one wants them. :)

 

bbraun

Well-known member
FWIW, it works for me. The issues I know about currently are:

1) The keyboard LEDs aren't controlled by the computer. System extensions that fiddled with the LEDs on the keyboard won't make the keyboard LEDs blink.

2) more than one keyboard or mouse might not work. My adapter doesn't do any sort of collision detection. Non-keyboard or mouse devices probably will work fine because they'll default to a different address on the adb bus. But having a native keyboard or mouse plugged in along with this adapter probably won't behave right.

3) I'm not entirely sure keyboard repeat works right. I need to do more investigation to see how normal key autorepeat works to make sure I'm doing it right.

Those are just the known issues right now.

I won't really feel comfortable taking someone's money for one of these, even if it is just for the cost of parts, if I don't know it'll work for them. That's why I say anyone that wants one should view it more as participating in the development of the project rather than buying a finished product. I'm literally the only person in the world that has ever used it, with a limited selection of both PS2 and ADB devices.

That said, the above issues are the only ones I know of at the moment. If anyone else is ok with that, I'm fine with sending off a board. I just don't want to misrepresent what you'll get with one of these.

 

NJRoadfan

Well-known member
The keyboard LED thing is normal. The PS/2 protocol is two way, so if your adapter doesn't pass on the ADB request to turn on the lights, it won't work.

 

bbraun

Well-known member
Yes, I know. The adapter is setting the capslock LED its self (mainly for the pre-ADB use). It is just not listening to writes on ADB register 2 of the keyboard ADB device, and translating those into the PS2 commands.

 

paws

Well-known member
Do you have any idea if this will work in an ADB chain? Like, PS/2 mouse -> ADB keyboard -> Mac?

 

bbraun

Well-known member
I just tested it with an M0116 keyboard, and an MS Intellimouse plugged into the ps2/adb adapter, plugged into the M0116. It seems to work fine.

However, if you're interested in a ps2 mouse to adb adapter only, you might be interested in the Gee Three I linked to earlier.

 

bbraun

Well-known member
I tested with a IIgs ROM1, and was able to enter the control panel, navigate around, and use the keyboard in prodos. I haven't tried GS/OS.

 
Top