Profile

Cover photo
David Conran
1,248,338 views
AboutPostsPhotosVideos

Stream

David Conran

Shared publicly  - 
 
\ o /
Former Army chief David Morrison is named as Australian of the Year for his commitment to gender equality, diversity and inclusion.
9
1
Mike Knell's profile photoKatie Bell's profile photo
 
And for his Very Serious Looks.
Add a comment...

David Conran

Shared publicly  - 
1
Tiarnán de Burca's profile photo
 
1.) That took me longer to catch than I'd like to admit.
2.) Without hours on Wikipedia I'll never catch them all.
Add a comment...

David Conran

Shared publicly  - 
 
TL;DR: I made a USB arcade trackball as my first serious electronics/arduino project!

Why? Well that's a long story ...

About 15 years ago, I retrofitted my upright arcade cabinet (Gauntlet II) into a JAMMA-friendly MAME cabinet with an old PC. In the process +Paul Shackel hacked me up a trackball circuit out of an old $5 serial mouse board allowing me to connect it to a 9-pin RS232 serial port. You know, back when PCs had those ports.

Fast forward to a year or so ago, the Celeron 300A PC long dead replaced by a Raspberry Pi (Model B), original arcade monitor replaced by a 4:3 20" LCD panel. Everything was basically fine, except the trackball. Only a handful of games really need it. But, it was there. Surely connecting a 9-pin serial port to a RPi couldn't be that hard right?

Oh So WRONG!
40 simple steps later ...

Plan A.
1: Order a ~$2 9-pin RS232 to USB adapter/cable/device from China.
2: Wait 2 months for the slow boat to arrive.
3: It arrives, then forget about it for many months.
4: Plug it in, and be totally surprised it doesn't work with MAME.
5: Learn that mame4all, unlike advancemame doesn't support serial mice.
6: Learn about inputattach to make a serial mouse appear like a normal (usb) mouse to the rest of the system. No luck.

Plan B.
7: Give up on serial mice. Try to find a mechanical mouse that has a USB interface, and try the same hack as the original.
8: Months pass, and a trip to the USA, and a fortuitous trip to Weird Stuff. $5 usb mechanical mouse found.
9: Get back home, plug in mouse, it works. Now just have to hook it up to the trackball's optos.
10: Forget about it for a couple of months.
11: Try wiring up the mouse to the trackball. No luck. Doesn't work. Bummer.

Plan C.
12: Read up about the Serial->USB adapter. Most cheap ones don't do more than ±5V and have dodgy chipsets.
13: Find other adapters, namely FTDI chipset ones. (Thanks +Jamie Gillespie for the loan)
14: Test FTDI adapter and my cheap one on a linux PC, with input attach. Success. \o/ Cheap one doesn't work. FTDI one has enough voltage to drive the mouse.
15: Before I order an adapter, think, I should just test this in the RPi.
16: Epic fail. Doesn't work. Why?
17: Spend a weekend trying to get the RPi to talk to the mouse behind the adapter. Many forum posts and other unhappy punters later.
18: Turns out the RPi's USB systems sucks puss. Think USB-OTG and drivers written with Intel arch in mind and half a dozen other design kludges take the RPi took. :-(

Plan D:
19: Borrow some more Serial to USB converters.
20: Test them on the RPi. Still no work-y. F#$king RPi USB serial.

Plan E:
21: Go back to using an old PC motherboard with a 9 pin serial on-board.
22: Try a few distros. Get it mostly working. However, it is big, noisy.
23: Turns out the video card isn't supported for SVGAlib, so has to run in full res in X11. It's slow as puss in native res on the LCD.
24: There has to be a better way... Back to the Pi.

Plan F:
25: Make my own mouse.
26: Learn from +Benjamin Low enough basic opto-transistor basics and resistor know-how to be able to convert it to a digital-like signal.
27: Find out that the trackball's opto's are wired up completely differently than Ben expected. Circuit doesn't/won't work.
28: Design my own circuit after working out how the optos are hooked up.
29: Test out the digital signal via the new circuit. Success.
30: Connect it to an arduino, see if I can read the digital signals.
31: Expand out the circuit to handle all 4 optos on the trackball.
32: Success. Get 4 x Ones and Zeros as the ball moves.
33: Wire it up to a piece of veroboard. Much soldering. Test. Still works.
34: Write arduino code to calculate direction of optical wheel/disk rotation. Looking good.
35: Use the arduino 'mouse' library to be a HID usb device.
36: Tweak and calibrate parameters to be more like expected.
37: Cable-tie into neatness.
38: Pre-install into cabinet test indicates a problem. Shorting as cable ties pulled out some cables on the arduino side. Re-route wires and cable-tie to prevent from happening again.
39: Test on the RPi. It works!! Fit it back into the arcade cabinet.
40: Play a quick round of Missile Command, it's done. Finally. Sorted. OCD itch has now been scratched. Clean up and turn off.

Photos, circuit diagrams attached.
My arduino code here: https://drive.google.com/file/d/0B2aVuEL1RXOuT1FRZllTak9xMmc/view?usp=sharing

Chuffness of having built a mouse from near-first principles won't upload. Sorry. :-)

(Edit: Yeah, I just realised I used the veroboard upside-down. Meh, it was my first time using it.)
8
David Conran's profile photo
 
Other mentions and thanks +Darren Tucker for a loan of some other Serial to USB converters; +Jim Mussared for some resistor selection and veroboard advice; +Will Beers for introducing me to Weird Stuff in San Jose; +George Michaelson for a sacrificial USB trackball, alas, not mechanical; +Stefan G. Lesser for offers of mechanical usb mice.
Add a comment...

David Conran

Shared publicly  - 
 
I <3 Halloween/Day of the dead/Zombies/Undead. Brisbane has the largest zombie walks of anywhere in the world. I finally had an excuse to dust off the DSLR after a 18 month break. The Brisbane undead didn't let me down. More photos can be found in another post. Enjoy. #Brainz #brisbanezombiewalk2015 #zombies
October 31, 2015 • 142 moments
6
Add a comment...

David Conran

Shared publicly  - 
 
I'm forever glad I live in a state that doesn't have daylight saving.

For the rest of you, #justsayno  
10
1
Leonie Beccaria's profile photoStu Bur's profile photoStrazdas's profile photoMichael Wolf's profile photo
4 comments
 
+Leonie Beccaria
im sure it causes troubles, new south wales should abolish it too.
Add a comment...

David Conran

Shared publicly  - 
 
After three weeks in cold Europe, tomorrow I'm heading home. This is almost exactly how I feel right now.
2
Sheryl Carr's profile photoDavid Conran's profile photoStefan G. Lesser (wharrgarbl)'s profile photo
4 comments
 
+David Conran Wait. Isn't that what you've been after on this trip?
Add a comment...

David Conran

Shared publicly  - 
 
This. A million times this!

.. and I'm coming up to my work-mandated annual password change too. Hmm.
3
George Michaelson's profile photoLeonie Beccaria's profile photo
2 comments
 
Just loved this Dave
Add a comment...

David Conran

Shared publicly  - 
 
Thanks everyone for making that kickstarter our most successful SMBC book launch ever! If you just missed it and still want in, we will briefly be offering pre-orders. Discuss this comic in the forum. November 18, 2015. Our latest book did wildly better than expected.
2
Add a comment...

David Conran

Shared publicly  - 
 
Beware! Heaps of photos. #BrisbaneZombieWalk2015
6
David Conran's profile photoDaniel McNamara's profile photo
2 comments
 
Gods damnit. I do miss that about Brisbane
Add a comment...

David Conran

Shared publicly  - 
 
\o/ woot!
Google launched Play Music back in 2011 with the option for users to upload their entire music collection for easy streaming. Play Music started with... by Ryan Whitwam in Applications, News
1
Loïc Guelorget's profile photo
 
I trashed all my MP3's long time ago... Spotify Premium...
Add a comment...
Story
Tagline
No-one of consequence
Introduction
The opinions stated here are my own, not necessarily those of my company/employer.
Links
Work
Skills
I can sometimes tell the difference between 1's and 0's ... sometimes.