DIY joystick for the BBC Micro – part 4 – a quick lash-up

While waiting for revised PCBs to arrive from China, I figured the time would be well spent learning a little more about the BBC Micro’s analogue port.

And I have taken delivery of a couple of DB15 breakout boards, which meant I could try wiring up the joystick, albeit in a crude and temporary way.

One joystick needs to send two analogue signals – one each for the X and Y axes. For joystick 1 on the Beeb’s analogue port, these signals are named Channel 0 and Channel 1. But which controls which axis?

This is a slightly arbitrary question because the joystick itself can be oriented in any one of four ways, with the two potentiometers – which are set at right angles to each other – positioned top & left, right & top, bottom & right, and left & bottom.

That’s why, on the PCB that connects the joystick to an RJ45 Ethernet socket, I’m using two groups of three headers. The three wires coming from each potentiometer will be terminated with a three-way DuPont header. The centre wire is the signal. The other two are the VREF voltage coming from the BBC Micro (1.8V) and the other is 0V (or GND, if you prefer). Having a three-way connector means that simply flipping it around changes the sense, the direction, in which that axis of the joystick works (for example, it would change up to down and vice versa). Using DuPont headers also means the potentiometers are easily switched between Channel 0 and Channel 1 (or Channels 2 and 3 for the second joystick).

Fire it up

Finding out which channel the Beeb expects to use for X and which for Y was going to be hit & miss. The best way was to find out through simple experiment. This involved wiring up a joystick and running a copy of Elite.

I put the three-way DuPont headers on the wires soldered to the joystick. Then I connected the headers to the DB15 breakout board using male-male jumper cables.

The prototype lash-up in all its glory – including added fire button loveliness.

The Channel 0 signal wire connects to pin 15 on the DB15 and Channel 1 to pin 7. The two VREF wires from the pots both go to pin 14, and similarly, both use pin 8 for the 0V connection. So while there are six wires, only four connections on the DB15 are used.

I guessed which pot to connect to which channel (like I said, it’s pretty arbitrary), plugged in the board and fired up the BBC Master.

Alas, the ‘executive’ version of Elite I have takes an age to get going, with tedious scrolling text and other nonsense before you get to the actual game. Finally, I was able to launch from the space station and … the joystick didn’t work at all.

Then I remembered that Elite determines whether you’re using joystick or keyboard by which ‘fire’ control you use to start the game – the space bar or the joystick fire button. I didn’t yet have a fire button wired up but was able (after sitting through all that bloody scrolling text and whatnot again) to launch the game by hovering over the back of the machine with a jumper cable and briefly shorting out pins 13 (PB0) and 6 (0V). (I later added a momentary button.)

Once launched again, I found that, with one pot (connected to Channel 0) at the bottom and the other (Channel 1) to the right, I was getting more or less the results I was after. In other words, Channel 0 is the X axis and Channel 1 the Y axis. This information is probably available in some documentation somewhere, but finding out this way is more fun.

Note that the VREF wires (purple) and 0V (grey) are commoned. The white wires are the analogue signals. The blue and green go to the fire button.

With each of the pots, I took the arbitrary decision to have VREF attached to the left tab and 0V to the right (the middle tab, of course, has to be the signal).

Take to the air

However, not all was well. In Elite, when I moved the stick forwards, the nose of the spacecraft pitched up. As a pilot, that was all kinds of wrong as far as I was concerned. But I didn’t know if it was a problem with my wiring or a quirk of Elite. The way to find out would be to switch to a more Earth-bound simulation – and that meant Aviator.

Now here’s the thing, Aviator has always been one of the twitchiest flight simulators around. It’s really quite hard to fly, especially when you’re using a joystick with unproven wiring. However, after many crashes, I was able to ascertain that, yes, the roll (X) axis was fine but the pitch (Y) axis was working in the wrong direction.

It’s possible I could have fixed this by rotating the joystick by 90 degrees and swapping the connections between pots and channels. But an easier way was to leave the joystick as it is and reverse the VREF and 0V connections on Channel 1. Job done, and suddenly Aviator became reasonably flyable – in fact, it started to become oddly addictive again…

So I have a working joystick. And I could wrap up this project by using longer wires, adding the fire button and putting the joystick in a box of some kind. But I still like my PCB and Ethernet cable idea, so stay tuned…

[UPDATE 04/07/2019] I’m putting this update here because it doesn’t really deserve a post of its own…

Although I’m still waiting for the amended (ie, working) version of the adapter PCB – the one that plugs into the BBC Micro – it occurred to me that I already have the PCB designed to be wired up to the joystick. That’s essentially just a breakout board for an RJ45 Ethernet socket.

The joystick PCB

And, in fact, the yet-to-arrive PCB is just a simple way of wiring two RJ45 sockets to a DB15 connector, to allow two joysticks to be connected to the Beeb.

But for playing Aviator and Elite – pretty much the only two games I do want to play – I need only one joystick.

So, I took the second of the DB15 breakout boards that I’d bought off Ebay and wired it up to one of my RJ45 breakouts. And I connected the joystick and fire button to another. And then I plugged in an Ethernet cable to connect them. And lo! It works!

Seems obvious when you think about it.

So that’s a handy proof-of-concept for the whole idea of using Ethernet cables. And once I put the joystick and fire button in an enclosure of some sort, it’s a pretty much completed project.

And now, plugged into the Master. It’ll be a lot neater when the wires are hidden inside a box.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.