- Top Stats

Top Posters Top Topic Starters Top Topics
Bryce 5313
TFM 2507
Gryzor 2256
arnoldemu 1273
TotO 1203
Bryce 90
arnoldemu 70
Gryzor 42
LambdaMike... 39
CraigsBar 35
Amstrad CPC WiFi - 293533 Views Duke 09:36, 07 May 16
CPC Plus cartr... - 211888 Views gerald 17:39, 01 November 14
ACID chip inside - 83057 Views MacDeath 15:52, 23 October 09
Gotek USB in a... - 72318 Views gryzor 18:01, 18 March 14
Pros & Con... - 59824 Views CPCIak 15:07, 11 May 10


Author Topic: Provide Power supply to Joystick port, enabling Autofire, Joy adapters etc.  (Read 7235 times)

0 Members and 1 Guest are viewing this topic.

Offline ikonsgr

  • CPC6128
  • ****
  • Posts: 256
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 162
Hi everyone!
    As you probably already know, our beloved amstrad cpc gameport, unlike many other home micros like Atari/Atari st, amiga, c64 etc, doesn't provide any 5volt power supply.
 Because of that, autofire function on many joysticks is not working, but most important, many usefull adapters designed for standard DB9 gameports (like this usb joystick/gamepad adapter or this DB15 Pc Joystick adapter i  make) can't function either on amstrad cpc!
 Unfortunately, it's not as simple as connecting the 5volt supply to the coresponding pin of joystick port connector, because of the strange way amstrad gameport funcrtions:
It doesn't provide a steady 0 volt/ground pin, instead the "ground" or common-com signal is pulsed, where every 0.02 seconds goes from high to low, and only then amstrad scans movement+fire signals!
  So, what i have to show you, is a  rather simple circuit that will provide the necessary 5volt supply (and 0volt/ground too) to joytisck's DB9 connector, thus enabling the usage of autofire, but most important, allowing any adapter designed for DB9 gameport to function properly!  :)
This is the circuit:

[/size] As you can see, it's rather simple circuit, in essence, a 74LS367 Hex tristate buffer is inserted between joystick's DB9 connector and amstrad's gameport. All the required connections are show in the above diagram, along with the necessary 5volt supply through an Y power cable taken from amstrad's psu.And for everyone that doesn't have any soldering skills,this is the ready made adapter i offer:
Cost is 9euros including standard shipping (+2.5euros for registered with tracking number) and payment with Paypal. if anyone interested please contact to ikonsgr745@hotmail.com to arrange it.[/font]
[attachimg=2]Finally a small teaser:What about playing Zynaps using a modern HAMA usb joystick controller? ;D The design was slightly modified by adding a small resistor in series with the 5volt supply,in order to prevent a short circuit with Joysticks that support second fire button on pin 7.
« Last Edit: 19:17, 05 January 19 by ikonsgr »

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.803
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3772
Cool idea, even if I can't see any pictures in your post. I can see the advantage for auto-fire joysticks, but for newly designed devices a simple flylead solves the issue as I did here with my PS/2 and USB Mouse adapters: http://www.cpcwiki.eu/index.php/PS2Mouse

Edit: Just noticed that you've only connected 1 fire button, so an AMX mouse wouldn't work with your device.

Bryce.
« Last Edit: 15:31, 08 December 16 by Bryce »

Offline ikonsgr

  • CPC6128
  • ****
  • Posts: 256
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 162
Yes, because this is the standard for DB9 atari joystick port. Only one fire button exists on pin 6, any extra button functionality was undocumanted and every company did it differently, for instance, amiga provides 2nd fire button on pin 9 where amstrad gameport had a 2nd fire on pin 7 (where the 5volt supply supposed to be according to standard atari joystick port). In any case, there is one tristate buffer spare, where you can conncet another pin if you want  ;)
Btw, what you mean by "flylead"?  Is this some kind of buffer too? I have tried any other possible way of doing this (even leaving the com pin of amstrad's port unconnected) , but unfortunately nothing seem to work right, except using tristae buffers. Everything else, was either giving garbage on joy output (resulting in abnormal behavior in games etc), or the adapters didn't seem to work.
« Last Edit: 15:59, 08 December 16 by ikonsgr »

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.331
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2245
Btw, what you mean by "flylead"?  Is this some kind of buffer too?
it is a short cable.

In your final design it would be a short cable for the power cable to connect to.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.803
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3772
Exactly. there's two ways of doing the flylead. (1) Have a socket on your device for the normal 5V power lead and then a wire from your device to pass the power on to the CPC or (2) Have a wire from your device to the power socket of the CPC with a socket for the power on the same wire. You can see method 1 in the picture here: http://www.cpcwiki.eu/index.php/File:PS2Mouse.png
You'll also notice that I also used a tristate buffer for the inputs, but I chose the 74LS240.

Bryce.
« Last Edit: 10:35, 09 December 16 by Bryce »

Offline ikonsgr

  • CPC6128
  • ****
  • Posts: 256
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 162
I can see that, but the thing is, without using tristate buffers, which isolate completely all move+fire pins from amstrad's joy port when com signal is HIGH, there is no other way of providing proper 5volt + ground to pins 7 and 8 of joystick's DB9 connector (in order for any DB9 adapter device that needs 5volt power supply -which can be provided directly  from  pins that the standard atari gameport dictates- to function properly ), and at the same time don't mess with amstrad's  peculiar  (and rather annoying)  method of scaning the joystick port and keyboard.


 For instance, both usb and DB15 adapters i make, are for any computer equipped with standard atari gameports. The problem is ,that, if i want to make them usable for amstrad cpc too, it's not enough just to provide an extra power supply flylead, because both adapters use output ports of a pic microcontroller to drive the movement+fire pins of the DB9 gameport, which means that they can only be at HIGH (5volt) or LOW(0 volt) state and NOT the needed high impedance state when amstrad's gameport com signal goes High.
 And as far as i know, from all the home micros equipped with compatible DB9 atari type gameports, ONLY amstrad's need the extra use of tristate buffers (all other computers -amiga, atari, atari st, c64, vic 20 etc- work perfect without buffer). Of course there could be another "solution" of making special versions of the adapters for amstrad cpc only,  with the extra power flylead and the 3state buffers, but doing that way, the usage of these is limited only to the specific adapter, not mentioning the extra complexity and cost.


IMO, the usefulness of such an adapter which provides independant power flylead+buffering, is that by doing so, you can use ANY adapter, which is designed for ANY computer with standard atari DB9 gameport + enabling the autofire function! ;) 


p.s.  Hey Bryce, there's a small case study: i suppose your ps2 mouse adapter can function on  any computer with  DB9 gameport, right? But the added octal 3state buffer+ power supply flylead is only needed for amstrad cpc, right?  So, instead of making all mouse adapters with extra 3state buffers+supply flylead, you can make a simpler and cheaper version for ANY computer, and for anyone who wants to use it with amstrad, he can extra use the adapter i propose here!  ;)




 
« Last Edit: 17:26, 08 December 16 by ikonsgr »

Offline Arnaud

  • Supporter
  • 464 Plus
  • *
  • Posts: 482
  • Country: fr
  • Liked: 380
With this cable are Megadrive GamePads compatible with CPC ?

Will be the same cable for CPC and CPC+ ?

Thanks.
« Last Edit: 19:35, 08 December 16 by Arnaud »

Offline ikonsgr

  • CPC6128
  • ****
  • Posts: 256
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 162
As far as i know, the 9pin ports on 6128+ have the same pinout with the classic amstrad cpc, so you can use the adapter on both machines just fine!
About the megadrive gamepads,i think these where "almost" compatible directly with amostrad joy port (the only problem was the locking of the keyboard when connected i think).
Since sega's gamepads have the same basic (movements+fire+ground) pinout as with amstrad's joystick port, by inserting this adapter between amstrad and megadrive gamepad, most probable it will solve the "Sticky keyboard" problem too (you might need to change the 5volt pin from 7 to 5 as it's on the standard sega controller pinout though). I think i have a sega controller somewhere, but i can't find it to verify  the... "theory"  :)
« Last Edit: 20:24, 08 December 16 by ikonsgr »

Offline keropi

  • CPC664
  • ***
  • Posts: 68
  • Country: gr
  • Liked: 30
IMHO the best pad you can connect to any classic machine is a PS2 joypad with this adapter: http://www.kipper2k.com/psx.html
key cloning, autofire, several modes... it's a work of art with features found nowhere else  :D

Offline 1024MAK

  • Supporter
  • 464 Plus
  • *
  • Posts: 320
  • Country: gb
  • Touching the hot end of an iron will hurt!
  • Liked: 137
The Amstrad made ZX Spectrum +2A, +2B and +3 machines have their joystick ports as part of the keyboard matrix, so have pulsing commons as well.

@ikonsgr BTW nice device  :D

Mark
« Last Edit: 23:45, 08 December 16 by 1024MAK »
Looking forward to summer in Somerset :-)

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.290
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2482
Yes, because this is the standard for DB9 atari joystick port. Only one fire button exists on pin 6, any extra button functionality was undocumanted and every company did it differently, for instance, amiga provides 2nd fire button on pin 9 where amstrad gameport had a 2nd fire on pin 7 (where the 5volt supply supposed to be according to standard atari joystick port).
The ATARI standard left pin7 N/C, so no 5V is provided.

On Amiga and ST, pin7 is used for 5 volt to power the mouse embedded electronic.
On Sega, pin5 is used for 5 volt to power controllers electronic. pin7 is N/C on SMS and SELECT on Megadrive.
On Amstrad, pin7 is used for FIRE2 and pin5 for SPARE on CPC (N/C on PLUS and GX)

That will result:
- A shortcut if you plug a GX4000 controller on it and press FIRE 2, because that will link VCC to GND.
- No power for the IC if you plug a Sega controller.
- Only 1 fire button for Amstrad controller.

So, the idea is good but the task not easy to build a real adapter...  ;)
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.803
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3772
I can see that, but the thing is, without using tristate buffers, which isolate completely all move+fire pins from amstrad's joy port when com signal is HIGH, there is no other way of providing proper 5volt + ground to pins 7 and 8 of joystick's DB9 connector (in order for any DB9 adapter device that needs 5volt power supply -which can be provided directly  from  pins that the standard atari gameport dictates- to function properly ), and at the same time don't mess with amstrad's  peculiar  (and rather annoying)  method of scaning the joystick port and keyboard.


 For instance, both usb and DB15 adapters i make, are for any computer equipped with standard atari gameports. The problem is ,that, if i want to make them usable for amstrad cpc too, it's not enough just to provide an extra power supply flylead, because both adapters use output ports of a pic microcontroller to drive the movement+fire pins of the DB9 gameport, which means that they can only be at HIGH (5volt) or LOW(0 volt) state and NOT the needed high impedance state when amstrad's gameport com signal goes High.
 And as far as i know, from all the home micros equipped with compatible DB9 atari type gameports, ONLY amstrad's need the extra use of tristate buffers (all other computers -amiga, atari, atari st, c64, vic 20 etc- work perfect without buffer). Of course there could be another "solution" of making special versions of the adapters for amstrad cpc only,  with the extra power flylead and the 3state buffers, but doing that way, the usage of these is limited only to the specific adapter, not mentioning the extra complexity and cost.


IMO, the usefulness of such an adapter which provides independant power flylead+buffering, is that by doing so, you can use ANY adapter, which is designed for ANY computer with standard atari DB9 gameport + enabling the autofire function! ;) 


p.s.  Hey Bryce, there's a small case study: i suppose your ps2 mouse adapter can function on  any computer with  DB9 gameport, right? But the added octal 3state buffer+ power supply flylead is only needed for amstrad cpc, right?  So, instead of making all mouse adapters with extra 3state buffers+supply flylead, you can make a simpler and cheaper version for ANY computer, and for anyone who wants to use it with amstrad, he can extra use the adapter i propose here!  ;)

No, my adapter is for CPC only, because if you connected it to an Atari joystick port you'd be feeding 5V into an output and that would cause the magic smoke to escape. Also you have to remember that hardware compatibility is only half of the story. My mouse adapter can (and does) use all three fire buttons, because the software used them. My mouse adapter was designed to replace/emulate the AMX mouse, so it needed to support all software that was AMX Mouse compatible. What's the point of designing a mouse that works on multiple computers, but doesn't support the software on the computer I designed it for?

Bryce.

Offline 1024MAK

  • Supporter
  • 464 Plus
  • *
  • Posts: 320
  • Country: gb
  • Touching the hot end of an iron will hurt!
  • Liked: 137
It should be noted that some auto-fire joysticks don't need a seperate +5V supply, they steal power from the input line(s).
But others do need a +5V supply. The joysticks that I have use pin 7 for the +5V.

Mark
Looking forward to summer in Somerset :-)

Offline ikonsgr

  • CPC6128
  • ****
  • Posts: 256
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 162
IMHO the best pad you can connect to any classic machine is a PS2 joypad with this adapter: http://www.kipper2k.com/psx.html
key cloning, autofire, several modes... it's a work of art with features found nowhere else  :D


Or with a few more euros,  you can have this and be able to connect many usb joysticks/gamepads+ Playstation 2 controllers by using this "almost for free"
this "almost for free"
usb to ps2 controller adapter!  ;)

Offline ikonsgr

  • CPC6128
  • ****
  • Posts: 256
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 162

The ATARI standard left pin7 N/C, so no 5V is provided.

On Amiga and ST, pin7 is used for 5 volt to power the mouse embedded electronic.
On Sega, pin5 is used for 5 volt to power controllers electronic. pin7 is N/C on SMS and SELECT on Megadrive.
On Amstrad, pin7 is used for FIRE2 and pin5 for SPARE on CPC (N/C on PLUS and GX)

That will result:
- A shortcut if you plug a GX4000 controller on it and press FIRE 2, because that will link VCC to GND.
- No power for the IC if you plug a Sega controller.
- Only 1 fire button for Amstrad controller.

So, the idea is good but the task not easy to build a real adapter...  ;)


 Well ,basically, the idea was to built an adapter for amstrad cpc so we don't care for all the others!  ;D

Secondly, i'm sorry to disappoint you, but the information you got that atari had N/C on pin 7 is WRONG! You can easily confirm from wikipedia  and also here too, that  ALL 8 bit Atari models (400, 800, 1200XL, 600XL, 800XL, 65XE, 130XE and 800XE and even the very first ATARI 2600 from 1979! )gave  5volt on pin 7! And the reason to do so ,was that the very popular atari paddle controllers (analogue potentiometers) needed 5volt on the port in order to work! Also, by the mid 80's ,almost ALL popular 8bit and 16bit home micros provided 5volt on pin 7 of their gameports! That includes, not only  amiga and atari st you mentioned, but also  the guiness record seller Commodore 64, commodore 128, VIC 20 and of course all 8bit atari models! So in practice 5volt on pin 7 was truly the "rule of thumb", and NOT doing so, was the exception (notably amstrad cpc and the spectrum models after amstrad purchased sinclair e.g. +2, +3 )
Finally, you are right about the 2nd fire button of amstrad cpc, some joysticks was indeed supported this, and by giving 5volt to pin 7and pressing this fire button, will result in short circuit of the 5volt psu. And that's the only thing that someone must take care  for, although i have already "tested" that many times, with the adapter i made and a joystick with such alternative fire button, and the worst thing that happened is amstrad's reset (possibly caused by voltage drop due to short circuit of the psu)! Of course if you continue pressing the button, you will probably end up burning your 5volt psu!
;D
« Last Edit: 03:06, 10 December 16 by ikonsgr »

Offline ikonsgr

  • CPC6128
  • ****
  • Posts: 256
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 162
It should be noted that some auto-fire joysticks don't need a seperate +5V supply, they steal power from the input line(s).
But others do need a +5V supply. The joysticks that I have use pin 7 for the +5V.

Mark


 I think i have tried something like this in the past, but i couldn't make it to work. It seems that current on input lines was so small that it couldn't support the autofire circuit (i think it was a 555timer ic wired as astable oscillator)

Offline 1024MAK

  • Supporter
  • 464 Plus
  • *
  • Posts: 320
  • Country: gb
  • Touching the hot end of an iron will hurt!
  • Liked: 137

 I think i have tried something like this in the past, but i couldn't make it to work. It seems that current on input lines was so small that it couldn't support the autofire circuit (i think it was a 555timer ic wired as astable oscillator)
Yeah, it needs the joystick port to have normal TTL inputs with reasonable value pull-up resistors.

On the subject of pin 7 being used for +5V or a button input, simply putting a suitable resistor (say 220 ohms) in series with the +5V protects both the computer and the button in the joystick / controller ;-)

Mark
Looking forward to summer in Somerset :-)

Offline ikonsgr

  • CPC6128
  • ****
  • Posts: 256
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 162
Well, that will not work, because by pressing a fire button connected on pin 7 (which has 5volt), you are physically attach this pin (e.g the 5volt) DIRECTLY  on the ground, so any resistor will be practically "by passed"  ;)


Wait, you said "in series"? That might work, although i'm afraid it will create a voltage drop after the resistor, depending on the internal resistance of the circuit attached compared to the resistor in series.
I might try this and see what happens!  ;)
« Last Edit: 03:45, 10 December 16 by ikonsgr »

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.290
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2482
Well ,basically, the idea was to built an adapter for amstrad cpc so we don't care for all the others!  ;D
You will not avoid peoples to plug a controller of their choice on it.
Here is the problem by adding 5Vcc, not the adapter itself... You have to take care about side effects.  ;)

By the way, if your choice is to use pin7 for Vcc you can link input pin9 to output pin7 to allow SMS controllers to use 2 fire buttons instead of left them N/C.

About Wikipedia... I don't trust it.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline ikonsgr

  • CPC6128
  • ****
  • Posts: 256
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 162
Well i "insist" on using pin 7 for 5volt supply, because unfortunately it can't be done otherwise, since this was the standard (btw it's not a matter of "Trust wikipedia", like it or not, almost all homemicros of the 80's equipped with atari gameports had 5volt on pin 7, you can verify this for yourself by checking any 8bit atari model, amiga, atari st, c64), so evey joystick/ controller designed for these (e.g. 99% of joysticks),  expect 5volt on pin 7 (mainly for enabling the autofire circuit)!  ;) 
And that's why 99% of joysticks of that era support only one fire button, since atari standard has only one fire button, and that's how 99% of games work too! They were very few joystick models that support the undocumented 2nd fire on amstrad's pin7 joyport (or even amiga's 2nd fire on pin 9 ) and this was specifically noted even on joystick case itself. For example some quickshot models (for example QuickJoy II turbo) had a switch with indication "cpc 464".
« Last Edit: 16:18, 11 December 16 by ikonsgr »

Offline ikonsgr

  • CPC6128
  • ****
  • Posts: 256
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 162
Good news every one!
I just test what 1024MAK proposed (adding a resistor in series with 5volt supply), and.... IT WORKS PERFECT!!! :D
The resistor doesn't seem to affect the functioning of the chip, and most important, pressing the second fire button doesn't do anything! I even tried to press it constantly for ~10 seconds and the only thing happend is a slight increase in resistor's temp. I used a typical 1/4watt 220 ohn resistor, which is more than enough considering that maximum thermal dissipation on it would be less than half (~120mW)
I already modified the schematics in the first post for anyone want to build it too.
« Last Edit: 16:14, 11 December 16 by ikonsgr »

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.803
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3772
For obvious reason, the chip is getting zero volts when you press the second fire button. Are there any situations where this pin could be permanently shorted? If so, your device wouldn't work in these situations. Also the voltage drop across the resistor is relative to how much current the chip is using. Have you also checked that the chip still works if three outputs are high at the same time, for example when you push the joystick diagnolly while firing?

If it can do all that, you should be fine. If it has problems you could consider dropping the resistor down to 180ohms.

Bryce.
« Last Edit: 11:57, 05 February 17 by Bryce »

Offline ikonsgr

  • CPC6128
  • ****
  • Posts: 256
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 162
Thanks for your usefeul comments and advices Bryce!
The pin we are talking is the 2nd fire button pin, and indeed "disables" the adapter if pressed. Obviously, there is no reason for someone to press it constantly. E
ven if some games used the 2nd fire button, and someone knew it and wanted to use it, he can easily find out that pressing it, will not do anything, so why keep press it? :)
In practice, since every one will know that 2nd fire button is not supported, the resistor exists only to prevent any accidentally pressing of the second fire button.Now,i have tested the adapter with 2-3 Games, and yes Bryce, it seems that works ok, even with 3 signals at the same time (fire+diagonal movement).
I also checked the voltage drop, the output that goes to 74LS367 and Joystick's 9pin D port is about 2.9Volts, and it's practically stable (~0.05 Volts or less) when you use joystick movements+fire.  So, maybe i should use a smaller resistor to increase output voltage.



Offline ikonsgr

  • CPC6128
  • ****
  • Posts: 256
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 162
Hey, Bryce, i was thinking of an alternative way to protect from short circuit without having the problem of voltage drop using the resistor. What about use 78L05 voltage regulator? They have thermal/short circuit protection, and they can handle up to 100mA which is more than enough. Ofcourse, the supply must be from amstrad's monitor  12Volt supply, or a separate 12Volt psu. You think that will work too?


Offline 1024MAK

  • Supporter
  • 464 Plus
  • *
  • Posts: 320
  • Country: gb
  • Touching the hot end of an iron will hurt!
  • Liked: 137
I actually meant, wire the resistor between the +5V from the Amstrad side connector to pin 7 of the "Atari standard" joystick connector. The +5V supply for the 74LS367 IC would still be supplied direct from the +5V power input. By using this arrangement, the 74LS367 IC would receive a nice steady +5V supply voltage.

You could use a 78L05 regulator. But although these do have current and temperature limits, the heat cycling that intermittent short circuits causes, sometime cause them to fail. In the case of protecting the +5V supply of the computer and a switch inside a joystick, a simple resistor is fine IMHO. Remember, while shorted, the power dissipation is 12V * the current. The TI data sheet gives the Peak Output Current as 140mA, but the actual figure does depend on the temperature.

Most joystick auto-fire circuits will work okay with a 220 ohm resistor. But I have only tested this on a couple of joysticks. You could lower the value of the resistor to say 150 ohms if you want less volt drop.

 Mark
« Last Edit: 20:22, 11 December 16 by 1024MAK »
Looking forward to summer in Somerset :-)