Making a digital joystick for the beeb

discuss both original and modern hardware for the bbc micro/electron
Post Reply
User avatar
leenew
Posts: 4941
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Making a digital joystick for the beeb

Post by leenew »

Hi,
I have been looking at the thread about converting atari joysticks for the beeb.
The best solution for me would be the adapter designed by ZXJIM.

However..... I have just realized that after building this about 8 years ago...
IMG_20121010_120242.jpg
IMG_20121010_120242.jpg (1.22 MiB) Viewed 6134 times
I have a new one of these spare...
IMG_20121010_120303.jpg
IMG_20121010_120303.jpg (2.03 MiB) Viewed 6134 times
It is real arcade quality so should be better than most cheap 30 year old joysticks!

What would be the easiest way of connecting this up??
It is a "HAPP SUPER" btw.

Thanks.
Lee.
CanonMan
Posts: 477
Joined: Fri Jul 15, 2011 9:41 am
Location: Cheshire
Contact:

Re: Making a digital joystick for the beeb

Post by CanonMan »

The attached article should give you some ideas :D
Attachments
Micro_User_v1_n3_May_1983_037.jpg
Micro_User_v1_n3_May_1983_037.jpg (624.26 KiB) Viewed 6119 times
Micro_User_v1_n3_May_1983_038.jpg
Micro_User_v1_n3_May_1983_038.jpg (632.99 KiB) Viewed 6119 times
Micro_User_v1_n3_May_1983_039.jpg
Micro_User_v1_n3_May_1983_039.jpg (682.93 KiB) Viewed 6119 times
Micro_User_v1_n3_May_1983_040.jpg
Micro_User_v1_n3_May_1983_040.jpg (581.74 KiB) Viewed 6119 times
Micro_User_v1_n3_May_1983_041.jpg
Micro_User_v1_n3_May_1983_041.jpg (622.83 KiB) Viewed 6119 times
User avatar
leenew
Posts: 4941
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Making a digital joystick for the beeb

Post by leenew »

nice.
Will peruse this with interest.... :)
CanonMan
Posts: 477
Joined: Fri Jul 15, 2011 9:41 am
Location: Cheshire
Contact:

Re: Making a digital joystick for the beeb

Post by CanonMan »

From what I can remember, there's a few incorrect pin numbers on figure V. Check them against the anaolgue port pinouts in the Acorn manuals, so you don't get caught out!

I'd planned to build a custom joystick containing the circuit in said diagram, but never got round to it. Now I'm planning to just build the circuit and use it with a bog-standard Atari/Commodore compatible joystick - I've got plenty of those knocking around :lol:
User avatar
leenew
Posts: 4941
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Making a digital joystick for the beeb

Post by leenew »

Yep me too :D
I will pull one apart and also check pinout diagrams for the beeb and see where I go from there.
Will I definitely need transistors? or can this not be done with simple wiring?
I seem to remember someone saying it had been over-complicated but can't remember where, or whether he offered the simple solution!
Lee.
CanonMan
Posts: 477
Joined: Fri Jul 15, 2011 9:41 am
Location: Cheshire
Contact:

Re: Making a digital joystick for the beeb

Post by CanonMan »

I'm about to go and cobble together an adaptor on my breadboard. I'll post up some details once I've got it working properly :)
User avatar
1024MAK
Posts: 13491
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Making a digital joystick for the beeb

Post by 1024MAK »

leenew wrote:Yep me too :D
I will pull one apart and also check pinout diagrams for the beeb and see where I go from there.
Will I definitely need transistors? or can this not be done with simple wiring?
I seem to remember someone saying it had been over-complicated but can't remember where, or whether he offered the simple solution!
Lee.
Depends on how the joystick switching function is done, and if you can/want to rewire the joystick.

If individual micro-switches are used, no transistors needed.
If PCB mounted simple switches, rewiring may not be easy/possible.
Or if you still want to be able to use your fav joystick with other (Atari) compatible systems, then the transistors are needed.

Mark
User avatar
PitfallJones
Posts: 455
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

Re: Making a digital joystick for the beeb

Post by PitfallJones »

Here's a previous tread about connecting an Atari joystick to the BBC.

http://stardot.org.uk/forums/viewtopic.php?f=3&t=2894

PJ
User avatar
leenew
Posts: 4941
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Making a digital joystick for the beeb

Post by leenew »

Hi,
I am going to use the arcade joystick pictured above.
This uses 4 individual enclosed microswitches.
I will also use arcade buttons for fire buttons which have individual microswitches.
can i just wire this up? will the port just see full movement when a switch is pressed? or do i maybe need some resistors?
ta.
Lee.
User avatar
paulv
Posts: 3866
Joined: Tue Jan 25, 2011 6:37 pm
Location: Leicestershire
Contact:

Re: Making a digital joystick for the beeb

Post by paulv »

The Competition Pro that was built specifically for the Beeb uses resistors with the micro switches in the following way:
3.jpg
3.jpg (91.9 KiB) Viewed 5994 times
1.jpg
1.jpg (79.02 KiB) Viewed 5994 times
2.jpg
2.jpg (51.93 KiB) Viewed 5994 times
HTH

Paul
User avatar
1024MAK
Posts: 13491
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Making a digital joystick for the beeb

Post by 1024MAK »

leenew wrote:Hi,
I am going to use the arcade joystick pictured above.
This uses 4 individual enclosed microswitches.
I will also use arcade buttons for fire buttons which have individual microswitches.
can i just wire this up? will the port just see full movement when a switch is pressed? or do i maybe need some resistors?
ta.
Lee.
Yes, you will need four resistors, all the same value.
The actual value is not critical, but they must all be the same value (within say 5% to 10%, the normal resistor tolerance is 5%). A value of between 10k ohms and 22k ohms is good.

Use the diagram "Figure II" in the BBC Micro User article above as a guide.

Mark
User avatar
leenew
Posts: 4941
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Making a digital joystick for the beeb

Post by leenew »

Thanks guys,
I think I have all the info now to be able to get the hammer and nails out and start making something. (As soon as I have a little time!)
Can't wait to see what CanonMan comes up with.
I think mine will be very much like a competition pro in 'feel' but more like a house brick in looks :D

Oh! the software in the listings, and the user guide refer to channels 1,2,3 and 4
but the diagram in the A.U.G refers to channels 0,1,2 and 3.
is 0 1 2 3 equiv. to 1,2,3,4 ?
sheesh :oops:
CanonMan
Posts: 477
Joined: Fri Jul 15, 2011 9:41 am
Location: Cheshire
Contact:

Re: Making a digital joystick for the beeb

Post by CanonMan »

Here's what I've done so far...

It's basically the circuit in figure V, but with a few small changes. I've substituted 4k7 resistors for 10k and 10k resitors for 20k, and used BC337 transistors. I've also added a 10k resistor from base to emitter on the 'fire button' transistor.

I have no idea how well it works as I haven't been close enough to a Beeb in the last few days to test it. I'll give it a go over the weekend and see if it needs any tweaking. Hopefully it won't need any, as I've just drawn up a stripboard layout for a dual-joystick version :lol:
Attachments
100_3504.JPG
100_3504.JPG (679.05 KiB) Viewed 5957 times
100_3508.JPG
100_3508.JPG (675.87 KiB) Viewed 5957 times
User avatar
leenew
Posts: 4941
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Making a digital joystick for the beeb

Post by leenew »

Hi,
Got another few minutes to look at this!
I am a bit confused (thick) :D

Page 203 of the BBC User Guide describing the ADVAL command describes the 4 channels, numbered 1,2,3 and 4 being available to test.
Adval (0) being to test for fire buttons.

Page 432 of the Advanced User Guide show the hardware connections for the joystick, and use terminology CH0, CH1, CH2, and CH3 with PB0 and PB1 for fire buttons.

I cannot see anywhere a 'standard', e.g. software developers are always to use CH1 for 'LEFT' or whatever.
I have printouts for Commodore Amiga compatible joystick pinouts and they DO have a standard for up, down, left and right.

So, was there ever a standard? or did joystick compatible games always ask you to press up then down then left then right and configure it from there?

If there was a standard, I think altering an Amiga Joystick would be as simple as soldering the 4 resistors across the microswitches as shown above, and then just obtaining a 9 pin and a 15 pin D Sub plug, and wiring them accordingly. Nothing else needed.

for reference, Here is the Amiga joystick standard:
amiga plug.gif
amiga plug.gif (529 Bytes) Viewed 5887 times

Pin Mouse/Trackball Lightpen Digital Joystick Paddle Dir Comment
1 V-pulse n/c /FORWARD BUTTON 3 IN
2 H-pulse n/c /BACK n/c IN
3 VQ-pulse n/c /LEFT BUTTON 1 IN
4 HQ-pulse n/c /RIGHT BUTTON 2 IN
5 BUTTON 3(M) Penpress n/c PotX IN/OUT
6 BUTTON 1(L) /Beamtrigger /BUTTON 1 n/c IN/OUT
7 +5V +5V +5V +5V OUT 50 mA max
8 GND GND GND GND
9 BUTTON 2(R) BUTTON 2 BUTTON 2 PotY IN/OUT

So, pin 1 is always UP, 2 is always DOWN, 3 is always LEFT and 4 is always RIGHT with 6 and 9 for the 2 FIRE buttons

Also, thinking on, on the BEEB,.... were there that many games that were joystick compatible 'out of the box'??
User avatar
paulv
Posts: 3866
Joined: Tue Jan 25, 2011 6:37 pm
Location: Leicestershire
Contact:

Re: Making a digital joystick for the beeb

Post by paulv »

Remember that the Beeb supports two joysticks on the one analogue port.

CH0 and CH1 for X and Y on one stick, CH1 and CH2 for X and Y on the second.

Being an analogue port, the channels range from @0 to 65535 and sit at around half way when the stick is centred. The figures are approximate and depend on the machine in question and how far out of whack the reference voltage is etc. For most Beebs I've seen none reach the maximum and minimum limits.

Paul
User avatar
sweh
Posts: 3500
Joined: Sat Mar 10, 2012 12:05 pm
Location: 07410 New Jersey
Contact:

Re: Making a digital joystick for the beeb

Post by sweh »

paulv wrote: Being an analogue port, the channels range from @0 to 65535 and sit at around half way when the stick is centred. The figures are approximate and depend on the machine in question and how far out of whack the reference voltage is etc. For most Beebs I've seen none reach the maximum and minimum limits.
Also note that the Beeb ADC only has 4096 values and so increments in steps of 16. I just did a quick test with the Acorn BBC analogue joysticks and ADVAL(1) - the only one I bothered to test - reported a min of 16 and a max of 65520, which would correspond to "1->4095" on the ADC. Of course the numbers are backwards; 16 was "far right", 65520 was "far left" :-)
Rgds
Stephen
User avatar
sydney
Posts: 2964
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: Making a digital joystick for the beeb

Post by sydney »

Image
I've been looking in to getting a wii arcade controller, like the one pictured, connected tom my beebs.

Looking at the photo's in Paul's post I've deduced the following:

All 4 ground pins on the microswitches are connected to each other and ground on the beeb connector(pin 8 ).
The remaining pins on the up and down switch are connected in series to each other and pin 7 on the beeb connector. The same for left and right to pin 15.
Each micro switch has a 10k resistor connecting both of it's pins.
The fire buttons are connected between pins 13 and 6 on the beeb connector.

Does that seem right? Is the value of the resistors critical? I'm only going to connect up one of the fire buttons.

Image
User avatar
1024MAK
Posts: 13491
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Making a digital joystick for the beeb

Post by 1024MAK »

Hi Simon

If you are not using the transistor circuit, then two of the joystick micro-switches cannot be connected to ground. Instead they go to VREF.

See Figure II here:-
Image
Note that this shows the different switches.

You need to use something like this:

Code: Select all

VREF
pin 14 O------+------+-----------------+------+---- VREF
(red)         |      |                 |      |
             |¯|     O  Left          |¯|     O  Up
            R| |      \ Switch       R| |      \ Switch
             |_|     O                |_|     O
              |      |                 |      |
Ch0           |      |                 |      |         Ch1
pin 15 O------+------+                 +------+-------O pin 7
(green)       |      |                 |      |         (blue)
             |¯|     O  Right         |¯|     O  Down
            R| |      \ Switch       R| |      \ Switch
             |_|     O                |_|     O
              |      |                 |      |
A-GND         |      |                 |      |
pin 8  O------+------+-----------------+------+---- Ground
(black)

Note pin 15 is shown as channel 0 for port pin out, but BASIC uses ADVAL(1).
Note pin 7 is shown as channel 1 for port pin out, but BASIC uses ADVAL(2).
Fire switch 1 wired between pin 13 (white) and ground.
Fire switch 2 wired between pin 10 (yellow) and ground.
Colours quoted are the wire colours in my home made joystick cable.
As I said above
1024MAK wrote:Yes, you will need four resistors, all the same value.
The actual value is not critical, but they must all be the same value (within say 5% to 10%, the normal resistor tolerance is 5%). A value of between 10k ohms and 22k ohms is good.

Use the diagram "Figure II" in the BBC Micro User article above as a guide.
Mark
User avatar
sydney
Posts: 2964
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: Making a digital joystick for the beeb

Post by sydney »

Thanks Mark. I just ordered some 10k resistors and some 15 way d connectors with shells so should hopefully be done by the end of the week!
User avatar
sydney
Posts: 2964
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: Making a digital joystick for the beeb

Post by sydney »

Thanks for the help Mark, it only worked 1st time!
sydney wrote:Looking at the photo's in Paul's post I've deduced the following:

All 4 ground pins on the microswitches are connected to each other and ground on the beeb connector(pin 8 ).
The remaining pins on the up and down switch are connected in series to each other and pin 7 on the beeb connector. The same for left and right to pin 15.
The above is almost completely incorrect!
User avatar
1024MAK
Posts: 13491
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Making a digital joystick for the beeb

Post by 1024MAK »

Good on you Simon! 8) =D>

Glad it works as intended :D

Mark
User avatar
sydney
Posts: 2964
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: Making a digital joystick for the beeb

Post by sydney »

If anyone wants a 15 pin connector and shell I have 9 left. They cost me £13 for 10 so give me £1.30+postage and I'll pop one in an envelope. I also have lots of 10k resistors, you can have 4 free with each connector.
User avatar
aotta
Posts: 456
Joined: Fri May 26, 2017 9:57 am
Location: Italy
Contact:

Re: Making a digital joystick for the beeb

Post by aotta »

resuming this old but interesting thread to give my little hints to who want to adapt an analogic joystick for his beeb:
bought (by mistake, i had to admit... :) ) a Voltmace 3a for "commodore", i tested with my c64 and didn't work well so... i found this thread and added the 5v line to the potentiometer, and a 22k resistor between 5v and variable line of both potentiometer (this because the 100k potentiometer seemed too high for beeb, and joystick gave always too high reading).
Now it works very well!
voltmace4.jpg
voltmace4.jpg (7.7 KiB) Viewed 5017 times
voltmace2.jpg
voltmace2.jpg (23.08 KiB) Viewed 5017 times
voltmace1.jpg
voltmace1.jpg (16.34 KiB) Viewed 5017 times
voltmace3.jpg
voltmace3.jpg (25.82 KiB) Viewed 5017 times
User avatar
tricky
Posts: 8150
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Making a digital joystick for the beeb

Post by tricky »

An analogue joystick doesn't use the 5v.
Analogue gnd (0v) and vref (~1.8v) should be connected to the pot and even 1M ohm pots work fine.

I think the idea is the first 4 pins in a diamond do one stick, then the two diagonal do a buttun, repeat for the other stick and finish with a triangle for the light pen ;) neat if a little wasteful.
Last edited by tricky on Wed Jan 30, 2019 11:02 pm, edited 2 times in total.
User avatar
aotta
Posts: 456
Joined: Fri May 26, 2017 9:57 am
Location: Italy
Contact:

Re: Making a digital joystick for the beeb

Post by aotta »

It was i thought... Then tried the schematics found in the old article posted above, and added the resistor... You are surely right, anyway my mod now works too

And, i had only 6 wires in the voltmace cable... And 5v is needed for fire buttons (I don't know if 1.8v is enough for pullling button..)
Last edited by aotta on Wed Jan 30, 2019 11:21 pm, edited 2 times in total.
User avatar
tricky
Posts: 8150
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Making a digital joystick for the beeb

Post by tricky »

Sorry to keep going on!
On a beeb joystick, the fire button only connects to 0v so for a two button stick you only need: 1.8v, ch0, ch1, 0v, fb0 and fb1.
I don't know the joystick you are talking about, so it might want 5v for something else or I could just be completely wrong!
I'm pretty sure on my Atari to beeb adapters I only use the 5v for the analogue switch ic. On my megadrive to beeb ones, the 5v is needed for the switch and for the pad as they have internal ICs.
Sorry for rambling.
I would have thought that you mod would make the stick off centre.
User avatar
aotta
Posts: 456
Joined: Fri May 26, 2017 9:57 am
Location: Italy
Contact:

Re: Making a digital joystick for the beeb

Post by aotta »

tricky wrote: Thu Jan 31, 2019 7:22 am Sorry to keep going on!
On a beeb joystick, the fire button only connects to 0v so for a two button stick you only need: 1.8v, ch0, ch1, 0v, fb0 and fb1.
I don't know the joystick you are talking about, so it might want 5v for something else or I could just be completely wrong!
I'm pretty sure on my Atari to beeb adapters I only use the 5v for the analogue switch ic. On my megadrive to beeb ones, the 5v is needed for the switch and for the pad as they have internal ICs.
Sorry for rambling.
I would have thought that you mod would make the stick off centre.
It's right Tricky, i rechecked the schematic and it's 0v (not 5v) line that i ported from buttons' pcb to potentiometers. And, i placed the resistors between 0v and variable pins. Sorry, but i didn't test voltage with multimeter, and probably inverted 7 & 8 pin when looking at db9 original connection.
Anyway, my joy is well centered (probably the 22k resistor drop pin 1 5v to a value near the pin 14 1.8v), but i'll made a test in next days removing resistors and connecting the Vref instead of 5v.
Thank you for reporting my mistake!
Post Reply

Return to “8-bit acorn hardware”