• 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.

ADB switch box

Chopsticks

Well-known member
I'm about to build up a simple adb switch box using a microcontroller so I can use just 1 keyboard and mouse with multiple old Macs and I was wondering if anyone could point me in the right direction for resource material relating to the adb spec regarding things like hotplugging and the way the OS polls the port. just want to make sure I don't end up killing anything with things like esd and the like.

also I have read that the mouse looses its 'settings' in regards to the sensitivity of the mouse movement if it is hot plugged, any further info on that would be great too

 

cheesestraws

Well-known member
also I have read that the mouse looses its 'settings' in regards to the sensitivity of the mouse movement if it is hot plugged, any further info on that would be great too


It has been a long time since I poked this, so take this with a pinch of salt, but this is what I remember.  It's legitimate for different pointing devices to have different sensitivities, so the mouse settings are tied to the ADB address of the mouse.  When you hotplug the mouse, it will end up with a different ADB address, so until you tell the Mac to go and rescan the ADB bus, it will behave as a mouse but the adjustment parameters won't be applies to its movement.  When the Mac rescans the bus, everything gets lined back up again.  There were various utilities to force a rescan of the bus.

If I am wrong, I am sure someone will correct me—I may well be.  But this ought to be at least a first approximation to the truth. :)

 

ttb

Well-known member
I am hoping to use a simple S-Video switchbox for the same purpose (less glamorous than a microcontroller, but I think I can handle turning a dial). I hadn't considered the hot plugging issue, though. Looks like Focus Bus Tool and ADB Renewer are candidates for the type of utility @cheesestraws is talking about.

 

davidg5678

Well-known member
There is a book that Apple published called "Guide to the Macintosh Family Hardware". It has quite a bit of documentation for the ADB protocol (among other things), so it might be useful for your project. I think there is probably a copy on the Internet Archive somewhere.

 
Last edited by a moderator:

Chopsticks

Well-known member
Would it help to look into an existing ADB switch box?
it would be handy to have a look at one but they are near impossible to find, not to mention the price of getting one shipped to australia so thats kind of why i figured id just make one

There is a book that Apple published called "Guide to the Macintosh Family Hardware". It has quite a bit of documentation for the ADB protocol (among other things), so it might be useful for your project. I think there is probably a copy on the Internet Archive somewhere.
thank you! i've got this downloading right now, looks like it will be a good read actually


the main reason i was to use a micro controller is just because its easy for me to doing some coding to do what i want. using a mechanical switch isn't something im keen on due to contact bounce possible causing a surge of power etc so im looking at possible using some ttl bus switching IC's.. haven't fleshed this out beyond an idea but i'll probably start putting something together later today to these out the theory

 
Last edited by a moderator:

cheesestraws

Well-known member
it would be handy to have a look at one but they are near impossible to find, not to mention the price of getting one shipped to australia so thats kind of why i figured id just make one
I think the question was more that would photos of the inside of one be useful?  I think @fabian has one—if not, I do—and I'm sure one or both of us could take photos of the innards of ours, if it would be useful

 

Chopsticks

Well-known member
it might be useful but i wouldn't want anyone going to the trouble of doing that, its really only 4 wires after all, but thank you both none the less

 

fabian

Active member
I have one on it's way, it will be delivered later this week.

I'm probably gonna open it up and look inside anyway.

 

saybur

Well-known member
Microchip has a great writeup talking through the low-level behavior of the bus if you end up making a microcontroller project:

http://ww1.microchip.com/downloads/en/AppNotes/00591b.pdf

If you tackle this, maybe a multicore chip like the Propeller would be a good fit to do the software decoding/encoding of the ADB timing?  I don't know hardly anything about them, but it sounds like having separate execution "threads" would be good for keeping track of the mess of different signals all going at once.

 

Chopsticks

Well-known member
Dr.Bott still sells the 4 port ADB model for $149 + shipping.
for a simple adb switch box $150US is overkill for me to be honest.
i just have my se/30 and a performa630DOS in a custom printed case i made so its more a convenience thing for me to just have a switch.
 

Microchip has a great writeup talking through the low-level behavior of the bus if you end up making a microcontroller project:

http://ww1.microchip.com/downloads/en/AppNotes/00591b.pdf

If you tackle this, maybe a multicore chip like the Propeller would be a good fit to do the software decoding/encoding of the ADB timing?  I don't know hardly anything about them, but it sounds like having separate execution "threads" would be good for keeping track of the mess of different signals all going at once.
im not really planning on reimplementing the adb protocol at this time, maybe its something i'll explore down the track but all i need to do is switch the data and power (probably ground too) and i guess switch the PWR ON signal (not that the se/30 supports soft power without mods anyways) so a few transistors soft of thing would do it well. the bidirectional Data line would need something else though being its bidirectional, but i could always be lazy and switch it using a relay..
my use of a micro is more just to allow 'soft buttons' for switching between the outputs, buy driving whatever i use to switch the 3/4 adb pins. and a couple led's etc


ive been reading up on the issue of hot plugging but i haven't found anything conclusive, like i guess esd could have an effect it you physically insert the mini din plug into the mac while on, and it the key tab is broken in theory it might be possible to short out the 5v to ground of the data pin (ill have to check this further though), most makes are fused on the 5v line though so grounding that wouldn't be the end of the world.

ive booted up my se/30 with no keyboard and mouse connected and ive actually hot plugged them if a few times after booting and i haven't had any issues with the mouse tracking and so far or fried the adb controller..

if i had more machine to test i guess could be another story but my se/30 is fine so a simple switch box with some esd transient diodes on the pins for piece of mind would probably suffice

 

davidg5678

Well-known member
I've been reading up on the issue of hot plugging but i haven't found anything conclusive, like i guess esd could have an effect it you physically insert the mini din plug into the mac while on, and it the key tab is broken in theory it might be possible to short out the 5v to ground of the data pin (ill have to check this further though), most makes are fused on the 5v line though so grounding that wouldn't be the end of the world.
I read the chapter on ADB in Apple's book last year while troubleshooting one of my SE/30s that didn't have a working mouse. I don't completely remember what it said about hot swapping, but as far as I can tell, If you are doing the switching with something like a microcontroller, the wires themselves will never actually get physically disconnected. The computers would just think that the signal has stopped momentarily, in other words, think that you have just gotten up from the computer. This would minimize the ESD threat at least. You could probably put something quick together using a few mini-din sockets, tact switches, and a $5 Arduino style board.

Others might know more about how exactly hot-swapping ADB causes damage, but I think in the worst-case scenario, you'd just need to swap the ADB chip with one from the plentiful supply of battery-damaged boards if something goes terribly wrong.

 

Chopsticks

Well-known member
i think and arduino or similar will likely be the direction i take, that and a few hours to construct and slap some simple code together should do the job fine. im likely overthinking the whole esd and hot plug issue, but i only have one se/30 here and its sentimental being ive had it for over half my life and i was born the year it was made so i want to make sure i look after it

 

cheesestraws

Well-known member
ive been reading up on the issue of hot plugging but i haven't found anything conclusive


the wires themselves will never actually get physically disconnected


If I remember correctly, @davidg5678 has it right: ADB is weird because its software can deal with hotplugging mostly fine, but the hardware can't.  I can't remember the details, but I'm pretty sure it's an electric thing.  So if you just have a microcontroller doing the switching and "proxying" the lines through you are probably fine?

 

ArmorAlley

Well-known member
if you do open it up and take some pictures that would be good to get a look at
This was discussed on the ebay Finds thread back in March 2019. The link is below. Several members opened their boyes and took picturesof the innards.

I have a 4-port Black Box ADB KVM if anyone wants new pictures.




 

Trash80toHP_Mini

NIGHT STALKER
I've been reading up on the issue of hot plugging but i haven't found anything conclusive, like i guess esd could have an effect it you physically insert the mini din plug into the mac while on, and it the key tab is broken in theory it might be possible to short out the 5v to ground of the data pin (ill have to check this further though), most makes are fused on the 5v line though so grounding that wouldn't be the end of the world.
I read the chapter on ADB in Apple's book last year while troubleshooting one of my SE/30s that didn't have a working mouse. I don't completely remember what it said about hot swapping, but as far as I can tell, If you are doing the switching with something like a microcontroller, the wires themselves will never actually get physically disconnected. The computers would just think that the signal has stopped momentarily, in other words, think that you have just gotten up from the computer. This would minimize the ESD threat at least. You could probably put something quick together using a few mini-din sockets, tact switches, and a $5 Arduino style board.
I've yet to see anything conclusive on the matter. Given the prevalence of rotary switch based KVM solutions from the day makes me think that approach is fine. A manufacturer, opening themselves up to the possibility litigation over wrecking one or several Macs, K, V & M would have been a serious event. So I doubt that an electronic switching solution is really necessary. Hot swapping is defined as unplugging and re-plugging active peripheral in hot sockets of powered computers. KVM rotary switching is decidedly not the same thing. Any fumble fingered attempt at hot plugging cables runs the chance of damage, but many of us have hot-plugged ADB numerous times without bad things happening.

I always kept an alias of ADB Reset on the desktop of my KVM'd Macs so I could Tab to it to hit enter, running it from the KBD. That done, all was well again in the world of ADB had the mouse lost its place.

It's easy to find two way printer switchboxes with the pushbutton switches like this Black Box Mac KVM, such have plenty of contacts

View attachment 26081

In these days of inexpensive 10x10cm PCBs, maybe do a modular setup of vertical connector boards plugged into chassis components servicing any number of cascaded hookups?

I like the notion of re-purposing unused (in Mac KVM switching) lines an HD15 switchbox for ADB. I also like building octopus cables. Stick a hub in the box and add unswitched Cat-5 to each.





Pin


Name


Dir


Description






1


RED


arrowr.gif.0a1affe4984e88d85f01aebae031afdd.gif



Red Video (75 ohm, 0.7 V p-p)




2


GREEN


arrowr.gif.0a1affe4984e88d85f01aebae031afdd.gif



Green Video (75 ohm, 0.7 V p-p)




3


BLUE


arrowr.gif.0a1affe4984e88d85f01aebae031afdd.gif



Blue Video (75 ohm, 0.7 V p-p)




4


RES


 


RESERVED




5


SGND


arrow.gif.71de7d0c5b7e01d1034c8ca393c1f749.gif



Ground




6


RGND


arrow.gif.71de7d0c5b7e01d1034c8ca393c1f749.gif



Red Ground




7


GGND


arrow.gif.71de7d0c5b7e01d1034c8ca393c1f749.gif



Green Ground




8


BGND


arrow.gif.71de7d0c5b7e01d1034c8ca393c1f749.gif



Blue Ground




9


KEY


-


Key (No pin) / Optional +5V output from graphics card




10


GND


arrow.gif.71de7d0c5b7e01d1034c8ca393c1f749.gif



Sync Ground




11


ID0


arrowl.gif.c9a297d0c57fab7a304b926c67a0fa95.gif



Monitor ID Bit 0 (optional)




12


SDA


arrowl.gif.c9a297d0c57fab7a304b926c67a0fa95.gif



I2C bidirectional data line 




13


HSYNC or CSYNC


arrowr.gif.0a1affe4984e88d85f01aebae031afdd.gif



Horizontal Sync (or Composite Sync)




14


VSYNC


arrowr.gif.0a1affe4984e88d85f01aebae031afdd.gif



Vertical Sync which works also as data clock




15


SCL


arrowl.gif.c9a297d0c57fab7a304b926c67a0fa95.gif



I2C data clock in DDC2, Monitor ID3 in DDC1





 
Top