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

Mouse alternative for Macintosh 512k

Hey I have a macintosh 512k with keyboard but no mouse... Can I use the computer without mouse? Is there any solution to convert an now a day mouse using arduino or esp32?
 

Snial

Well-known member
It's not really practical to use an early Mac without a mouse - the mouse was the whole point! The earliest Mac keyboards didn't even have cursor keys! The Original Mac mouse was what's called a quadratic-encoded mouse, different to a PS/2, ADB or USB mouse.

Instead of a communications standard which transmits changes in the x or y coordinate of the mouse position along with the state of the mouse button, an original Mac mouse instead, directly provided the signals from the 2 encoder wheels (one per axis). There are 2 signals per wheel and so there are 2x2 signals + the mouse button = 5 signals in total.

Here's how the signals get encoded:

Code:
Horizontal movement right.

       ___     ___     ___     ___
X1  __/   \___/   \___/   \___/   \_
         ___     ___     ___     ___
X2  ____/   \___/   \___/   \___/   \

Here, X1 goes high before X2, then X1 goes low before X2.

Horizontal movement left:
         ___     ___     ___     ___
X1  ____/   \___/   \___/   \___/   \_
       ___     ___     ___     ___
X2  __/   \___/   \___/   \___/   \

Here, X1 goes high after X2, then X1 goes low after X2.

The same technique works for the two Y signals. They are encoded like this so that only one signal changes at a time. Every time a signal changes, an interrupt is sent to the Mac, and that's a lot of interrupts!

It's possible to translate PS/2, ADB or USB mouse movements to these kind of signals, but you'd have to write some fairly clever software to make sure the signals don't change in a burst, because on a newer mouse you'd read e.g. +5 in the X direction would look like a sudden change, but this has to be spread out over time, but not too slowly or the next mouse movement would arrive and this would make the mouse on the screen lag in realtime.

Finally, I don't know of software that would do the conversion, though it is possible. I hope this helps with the explanation.
 

cheesestraws

Well-known member
Hey I have a macintosh 512k with keyboard but no mouse... Can I use the computer without mouse? Is there any solution to convert an now a day mouse using arduino or esp32?

You have several options, depending on what you want to do.

The Mac 512k uses something called a quadrature mouse, where the signals from the optical wheels in the mouse (which are driven by the ball) and the buttons go directly to the computer, and the computer does something useful with them. This is essentially the same kind of mouse that was used by a lot of other computers, such as the Atari ST, Amiga and Acorn Archimedes series machines (though the pinout is different for each kind of computer)
  • First, You can convert many more modern mice or pointing devices back to this, because newer mice are often basically a quadrature mouse with some extra clever bits in. Here, for example, is a thread I posted on another forum about converting a more modern Kensington trackball for an Acorn: the same could be done for a Mac 512k, you'd just need to use the Mac pinout, here.

    There are other guides online for converting different modern pointing devices for Amiga or Atari use. Those guides can be followed, modified for the pinout, for Mac mice too.

  • Second, you could have a look at @demik 's "Quack" tool, based on an ESP32. This is actually a bluetooth mouse adapter for the 128/512/Lisa, and will let you use bluetooth mice. Here's the github repo for it: https://github.com/demik/quack

  • Third, you could use an arduino to generate the waveforms. I wrote a simple arduino sketch to do this here: https://github.com/cheesestraws/QuadOMatic - mine uses a cheap analogue joystick I had in a drawer, but you could modify it to speak to a PS/2 mouse instead if you wanted, or indeed anything else you happened to have around that could move in four cardinal directions.
 
Last edited:

stepleton

Well-known member
These are great explanations about quadrature encoding! One thing that might help you find mice that are easy to adapt is to search for "bus mouse", which was one of the earliest kinds of mouse for the PC. These also use quadrature encoding, and adapting them to a Mac will probably just involve making a little adaptor.
 

Snial

Well-known member
Acorn Archimedes series machines (though the pinout is different for each kind of computer)
Ironically, that's exactly what I started to do with a 3-button PS/2 mouse for my Acorn A3020 a little while back, but didn't know if I could directly drive the signals or whether I needed some extra resistors to reduce the current. I feel a bit more inspired to restart that project and then, maybe the 3020 will be usable again (I did have a proper Acorn mouse, but it went missing at my Dad's some time ago).
 

demik

Well-known member
You have several options, depending on what you want to do.
  • Second, you could have a look at @demik 's "Quack" tool, based on an ESP32. This is actually a bluetooth mouse adapter for the 128/512/Lisa, and will let you use bluetooth mice. Here's the github repo for it: https://github.com/demik/quack

Thanks for the mention! Quack can also be used to use an ADB Mouse with a 512k as well if you want something more period correct.
 
Thank you so much for all the mentioned articles and explanations, now I'm more comfortable to start. I'll publish here all the updates and doubts I have during this journey! :cool:
 

trag

Well-known member
I thought there was a fairly simple conversion from old serial mice (plugged into a PC's serial (COM) port). Too lazy to go searching though. I'm not sure how common old serial mice are any more.
 

stepleton

Well-known member
I am not so sure... it wouldn't be possible to adapt a serial mouse without electronics. Bus mouse yes: a port adapter with wires in the right places is very likely to be all that's required. For an old serial mouse, you'd either need to do surgery on the mouse itself to recover the quadrature signals that get converted into serial data (essentially bypassing that serial conversion), or you'd have to convert the serial mouse signals back into Mac-compatible quadrature signals. For that, you may need:

- RS-232 voltage adapter (or a way to hack it)
- serial I/O ic to obtain parallel data
- additional logic to latch dx, dy, button state
- four variable-frequency phase-offset clock generators for generating the quadrature signals (two for X, two for Y)

You could do all but the first of these with an arduino and it'd probably be a pretty fun project, but unless you had code from someone else to use, it would be an undertaking. I'd be really impressed to see someone give it a go in 74-series TTL. Hmm, maybe you only need two clock generators if you can pipe a clock through a chain of inverters to offset phase and then an XOR that controls which direction the mouse is going...?
 

cheesestraws

Well-known member
I thought there was a fairly simple conversion from old serial mice (plugged into a PC's serial (COM) port). Too lazy to go searching though. I'm not sure how common old serial mice are any more.

If by "conversion" you mean "open it up and move the wires around inside", probably - having the 9 pin plug already there probably simplifies matters. That would be the same thing as I was talking about above, picking up the quadrature signals inside, just using the existing 9 pin plug to avoid having to wire in a new cable.
 
Of course! Yesterday I tested the code for Arduino QuadOMatic made by @cheesestraws and worked really well using a joystick.
I only used some components that I have around me and this was more as a proof of concept than a product to use daily.

Thank you! @cheesestraws :)

The next step will be to use a real mouse as input to Macintosh 512k.
 

Attachments

  • WhatsApp Image 2023-08-29 at 08.43.42.jpeg
    WhatsApp Image 2023-08-29 at 08.43.42.jpeg
    169.5 KB · Views: 13
Hey guys, yesterday I codded the Arduino to manage signals from the mouse and send quadrature signals to Macintosh 512k, and worked!
Now is functional, but I need to make a better PCB to keep everything reliable.

To perform this task I used the code made by @cheesestraws and the library Arduino-PS2-Mouse-Handler made by getis.



When I have the PCB layout, I'll publish it here! :cool:

@trag thanks for the reference, but the link is not opening for me :confused:.

Logic Analyzer.png
 

Attachments

  • 20230830_091156.jpg
    20230830_091156.jpg
    1.4 MB · Views: 9

Quadraman

Well-known member
The problem is the price that those early mice sell for. I've seen them between $100 and $200 already. The prices on all the early Mac stuff soared, when Steve Jobs died. I'm glad I got a lot of my stuff before then.
 
Top