How does ADB pin 2 (PSW) work?

6 posts / 0 new
Last post
Lee_Adamson's picture
Offline
Last seen: 6 months 1 day ago
Joined: Apr 25 2022 - 21:55
Posts: 9
How does ADB pin 2 (PSW) work?

What is the purpose of the PSW line on he ADB bus?  I've been looking at schematics of devices and the firmware for them, that convert back and forth between ADB and USB or PS/2, and none of them seem to use this line for anything?

 

I assume it has something to do with the triangle power switch at the top of the keyboard?  But the power key also looks like it produces a "scancode" (or whatever it is called with ADB) on the data line?

 

Thanks folks.  I appreciate it.

Online
Last seen: 1 hour 13 min ago
Joined: Jun 29 2018 - 16:55
Posts: 590
I know not the answer to your

I know not the answer to your question but am quite interested in an ADB keyboard to PS/2 host solution (for use with Briel replica1). I have made adb to USB adapters before, those aren't too bad. 

Lee_Adamson's picture
Offline
Last seen: 6 months 1 day ago
Joined: Apr 25 2022 - 21:55
Posts: 9
I am going to be trying to

I am going to be trying to make an ADB->PS/2 dingus with el-cheapo ESP-01 modules At Some Point (tm).  But the idea will be to hang a powered module off the keyboard, and then other modules off several PS/2 (and USB and hopefully ADB) ports on several computers, and implement a wireless keyboard/mouse switching thing over wifi.  It'll just be streaming PS/2 keyboard and mouse data over two TCP ports, but the rx module on the computer will convert it back into actual serial pulses on the keyboard interface.

 

The idea is to eventually combine this with a convoluted video dingus utilizing some video switch ICs, a composite-to-vga box, a GBS-8200, an RGBI-to-analog-rgb converter, and a raspberry pi, to have a single position from which one can operate all the old computers.  Or at least the ones that can be hooked to an external keyboard and display. 

 

It will be quite a rube goldberg contraption, assuming I ever get around to finishing it.  But I just don't have space to keep all my junk set up all the time with all the monitors and all, which makes me sad inside.  :(

Online
Last seen: 48 min 14 sec ago
Joined: Feb 27 2021 - 18:59
Posts: 607
The purpose, as you surmise,

The purpose, as you surmise, is simply to have soft power control. When a device pulls /PSW to ground, the host computer receives a signal that it can use to go from a standby power state to operating. The reason it's a separate pin is so that the host ADB controller (nor the MCU in the peripherals!) doesn't need to run during standby. On a Mac II the voltage on /PSW comes from a lithium battery.

The Apple IIgs, not having soft power control, doesn't afaik do anything with the /PSW pin. The power key simply acts like any other key. Same with the Mac SE and its relatives.

If you design an adapter from USB or PS2 kb/mouse to ADB, there isn't much you can do with the /PSW signal. Neither USB or PS2 have this type of soft-power control (when a USB keyboard is used to power on a computer, it does so by having the host USB controller and the device MCU running during standby, which requires more power than the simple ADB approach). An adapter that connects via ADB to the host could provide its own power key so that there is a way to turn the computer on.

Lee_Adamson's picture
Offline
Last seen: 6 months 1 day ago
Joined: Apr 25 2022 - 21:55
Posts: 9
I am mostly interested in

I am mostly interested in reading the triangle key with the uC, so that I can use it as a "magic" key.  "Magic-1" through "Magic-+" would make it send F1-F12, "Magic"+arrows would send pgup, pgdn, home, end.  Etc.

 

So it looks like even if it doesn't send a scancode, I can put a pullup on a uC pin, then the triangle key will pull it low, and I can act on it appropriately.  Surely it sends a scancode though.  I remember being able to reset the IIe card in my LC2 back in the day with control-oa-triangle.

Online
Last seen: 48 min 14 sec ago
Joined: Feb 27 2021 - 18:59
Posts: 607
The scan code for the power

The scan code for the power key is $7F.

Log in or register to post comments