Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Help with basic electronic circuit  (Read 2702 times)

0 Members and 1 Guest are viewing this topic.

thomashenry

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 61
  • Last login:October 11, 2022, 03:55:21 am
  • I want to build my own arcade controls!
Help with basic electronic circuit
« on: July 23, 2022, 05:01:20 am »
Wonder if anyone is able to help. I want to made a small mod to one of my buttons, in order to for an LED to light up when the button is pressed. I want the button to still function as normal. (the purpose of this is for input latency testing). Now I can't just put a LED in series with the button as there's not enough power to turn the LED on, so I need something slightly different, involving a battery, and diodes I imagine. But I'm totally hopeless at this sort of thing! Anyone able to suggest something? Thanks.

Zebidee

  • Trade Count: (+9)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3247
  • Last login:Yesterday at 05:01:12 am
Re: Help with basic electronic circuit
« Reply #1 on: July 23, 2022, 05:37:00 am »
You can buy buttons with LEDs in them, if that is what you want. You need to supply voltage (typically 5v) separately.

If you are doing it yourself:

- LED!
- 5v power supply, and obviously a ground for that as well
- a resistor

Don't use a battery - access 5v "rail" from elsewhere, like your PC power supply or your arcade power supply, whatever you are using and have available.

Resistor value depends on the LED and how bright you want it to be, but typically at least 150-200 ohms). You can go as high as you want, then only downside is the LED will get dimmer, or not light up at all.

You mentioned diodes... LEDs are already (light-emitting) diodes.

You need some basic electronics/wiring/soldering skills, but nothing very complicated.

Scott (PL1) has posted a neat LED wiring diagram on this forum a few times. Quick search would pull that up. There are some useful LED resistor calculators and guides out there in Google land too.
Check out my completed projects!


thomashenry

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 61
  • Last login:October 11, 2022, 03:55:21 am
  • I want to build my own arcade controls!
Re: Help with basic electronic circuit
« Reply #2 on: July 23, 2022, 05:55:23 am »
You can buy buttons with LEDs in them, if that is what you want. You need to supply voltage (typically 5v) separately.

If you are doing it yourself:

- LED!
- 5v power supply, and obviously a ground for that as well
- a resistor

Don't use a battery - access 5v "rail" from elsewhere, like your PC power supply or your arcade power supply, whatever you are using and have available.

Resistor value depends on the LED and how bright you want it to be, but typically at least 150-200 ohms). You can go as high as you want, then only downside is the LED will get dimmer, or not light up at all.

You mentioned diodes... LEDs are already (light-emitting) diodes.

You need some basic electronics/wiring/soldering skills, but nothing very complicated.

Scott (PL1) has posted a neat LED wiring diagram on this forum a few times. Quick search would pull that up. There are some useful LED resistor calculators and guides out there in Google land too.

Thanks! I have done a few searches here but not been able to find what I'm after. I'll actually be connecting it to one of the microswitches of a joystick rather than a button.

Zebidee

  • Trade Count: (+9)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3247
  • Last login:Yesterday at 05:01:12 am
Re: Help with basic electronic circuit
« Reply #3 on: July 23, 2022, 08:16:22 am »
The complicated part of what you want do is the switching. Making the LED come on as you push joystick.

For ideas, you might try using a PNP transistor or a logic inverter gate.

PNP transistor:
- Emitter to 5v
- Collector to LED and appropriate current limiting resistor
- Base to joystick active signal - will also want a limiting resistor (not sure of value, depends how much transistor requires for saturation... 1k might be good place to start).

PNP only passes current from E to C when B is grounded. So, LED only comes on when joystick switch is closed.





For more info: https://www.electronicshub.org/transistor-as-a-switch/

I was also thinking about logic inverter gates, they will only pass current when receiving null input. Really are just fancy transistors. Same result, LED will only turn on if joystick switch is closed/grounded.
Check out my completed projects!


PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9401
  • Last login:Today at 05:01:47 am
  • Designated spam hunter
Re: Help with basic electronic circuit
« Reply #4 on: July 23, 2022, 10:37:53 am »
Scott (PL1) has posted a neat LED wiring diagram on this forum a few times.
I think this is the diagram you're referring to from WannabeJoy's build here.

Example #3 does the "switch not pressed = LED off, switch pressed = LED on" function you're looking for.
- The diagram doesn't show a current limiting resistor, but as Zebidee mentioned you will need one.  https://ledcalculator.net/ is your friend.

Theory of operation for the circuit:
1. The "active low" encoder input (output triggers when ground is applied) is held at logic high (close to 5v) when the switch is not pressed.
- With 5v on the anode (+) of the LED and logic high on the cathode (-) of the LED, there is not enough of a voltage difference to forward bias the LED so it does not light.

2. When the switch is pressed, ground is applied to both the encoder input and the LED cathode.
- The encoder input is pulled low which triggers the encoder to send the keystroke or button press.
- 5v on the LED anode and ground on the LED cathode causes the LED to forward bias/conduct/light up.

NOTE: You'll need a different approach if your encoder is an "active high" device like some of the so-called "zero delay" encoders.




Scott

thomashenry

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 61
  • Last login:October 11, 2022, 03:55:21 am
  • I want to build my own arcade controls!
Re: Help with basic electronic circuit
« Reply #5 on: July 25, 2022, 08:28:41 am »
Scott (PL1) has posted a neat LED wiring diagram on this forum a few times.
I think this is the diagram you're referring to from WannabeJoy's build here.

Example #3 does the "switch not pressed = LED off, switch pressed = LED on" function you're looking for.
- The diagram doesn't show a current limiting resistor, but as Zebidee mentioned you will need one.  https://ledcalculator.net/ is your friend.

Theory of operation for the circuit:
1. The "active low" encoder input (output triggers when ground is applied) is held at logic high (close to 5v) when the switch is not pressed.
- With 5v on the anode (+) of the LED and logic high on the cathode (-) of the LED, there is not enough of a voltage difference to forward bias the LED so it does not light.

2. When the switch is pressed, ground is applied to both the encoder input and the LED cathode.
- The encoder input is pulled low which triggers the encoder to send the keystroke or button press.
- 5v on the LED anode and ground on the LED cathode causes the LED to forward bias/conduct/light up.

NOTE: You'll need a different approach if your encoder is an "active high" device like some of the so-called "zero delay" encoders.




Scott

OK thanks! And in diagram 3, where would the resistor need to go?

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9401
  • Last login:Today at 05:01:47 am
  • Designated spam hunter
Re: Help with basic electronic circuit
« Reply #6 on: July 25, 2022, 09:49:52 am »
OK thanks! And in diagram 3, where would the resistor need to go?
The usual location is between 5v and the anode (+) of the LED. (recommended)

You can put it between ground and the cathode (-) of the LED, but you have to make sure it is on the horizontal line in the diagram, not on the vertical line between ground and the encoder input.


Scott

Zebidee

  • Trade Count: (+9)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3247
  • Last login:Yesterday at 05:01:12 am
Re: Help with basic electronic circuit
« Reply #7 on: July 25, 2022, 03:39:29 pm »
Thanks Scott, this is interesting - I wasn't sure if it was a good idea to run LEDs from the joys/buttons active lines, or needed separate power. But seems it should be OK.

Scott, am wondering...

Do you have an idea of how much current would/could a typical USB encoder safely supply like that? Somewhere like 200-300mA? Which suggests 10 or more 20mA LEDs.
Check out my completed projects!


PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9401
  • Last login:Today at 05:01:47 am
  • Designated spam hunter
Re: Help with basic electronic circuit
« Reply #8 on: July 25, 2022, 06:15:54 pm »
I wasn't sure if it was a good idea to run LEDs from the joys/buttons active lines, or needed separate power.
The LED branch of this circuit isn't drawing power from the data line input ports, it's just sharing ground with them.
- Those ports have resistors that only allow 1 or 2 mA current draw when grounded so that's all that flows through the wire segment marked "NEVER".
- The 20mA of electrons for the LED flows from ground through the wire segment marked "No", through the LED/resistor, to 5v.

Do you have an idea of how much current would/could a typical USB encoder safely supply like that? Somewhere like 200-300mA? Which suggests 10 or more 20mA LEDs.
200-300mA is way too much to try to draw through a typical USB encoder.  :scared

The amount of current you can draw depends on the encoder you're using.
- How many LEDs that amount of current will power depends on the combination of LED and current limiting resistor.

In thomashenry's case, he's using one LED for latency testing so he'll likely need 20mA or less.
- An I-Pac2 can easily provide that from the spinner/trackball pins.  An Arduino can do that, too.

If you want to run more LEDs from the encoder, you need to calculate how many mA those LEDs and current limiting resistors will draw.
- A typical 5v LED/resistor combo will draw 20mA@5v.  A typical 12v LED/resistor combo will draw 5.83mA@5v -- not as bright, not as hot, and longer life than running it on 12v.
- IIRC the 5v pins on an I-Pac2 can provide a total of 60-80(?) mA, but Arduinos usually only provide 40-50(?) mA from any pin.

If the encoder PCB can't provide enough current for your setup, you can grab 5v+ground from a molex connector or a hacked USB cable.
- Connect the molex/USB ground to the encoder ground and daisy-chain the molex/USB 5v to the LED anodes.




Scott

Zebidee

  • Trade Count: (+9)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3247
  • Last login:Yesterday at 05:01:12 am
Re: Help with basic electronic circuit
« Reply #9 on: July 25, 2022, 06:29:23 pm »
Thanks Scott I was mis-reading the circuit diagram.

Reading it with fresh eyes, it is more obvious where the 5v is coming from.

Thanks also for the estimates regarding the USB encoders and current. Makes sense, seems a lot more like I intuitively expected as they are not really designed for providing power.

 :cheers:
Check out my completed projects!


thomashenry

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 61
  • Last login:October 11, 2022, 03:55:21 am
  • I want to build my own arcade controls!
Re: Help with basic electronic circuit
« Reply #10 on: August 01, 2022, 12:20:35 pm »
OK thanks! And in diagram 3, where would the resistor need to go?
The usual location is between 5v and the anode (+) of the LED. (recommended)

You can put it between ground and the cathode (-) of the LED, but you have to make sure it is on the horizontal line in the diagram, not on the vertical line between ground and the encoder input.


Scott

Ok thanks! So if I get my power from a USB cable, I'd put the red 5V wire before the led, and then just ignore the black wire?

This is going to be in an old DB9 joystick for using with old Ataris/8-bits/Amigas, and I really don't want to damage the vintage hardware!

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9401
  • Last login:Today at 05:01:47 am
  • Designated spam hunter
Re: Help with basic electronic circuit
« Reply #11 on: August 02, 2022, 01:38:32 am »
So if I get my power from a USB cable, I'd put the red 5V wire before the led, and then just ignore the black wire?
Tie the USB ground wire to the same ground you're using for the encoder.
- Don't assume that wire colors indicate their function.  Best practice is to always verify with a multimeter.

This is going to be in an old DB9 joystick for using with old Ataris/8-bits/Amigas, and I really don't want to damage the vintage hardware!
This crucial detail might change things a bit.   :banghead:

At first glance, the good news is that computers from that era typically used 5v logic levels, not 3.3v like many newer consoles.

The bad news is that some of these systems might use "active high" inputs (5v triggers the input instead of ground) so you'd end up tying the retro system 5v directly to USB ground.   :scared

To be safe, you'd need to check the system schematics and component datasheets for each system's inputs, and it wouldn't hurt to also confirm with a multimeter.

For example:
-  The common on the Atari joystick is pin 8 of the DB9. (upper left of the schematic here)
- Pin 8 of the DB9 on the Atari CX2600A is tied to ground. (upper left of the schematic below)  That confirms that the Atari CX2600A is an active low device.
- Pins 1-4 (joystick U/D/L/R) on the Atari CX2600A DB9 go to the 6532 RAM-I/O-Timer chip.  The 3rd page of the zipped datasheet here confirms that the operating voltage (VCC) and input voltages (VIN) can handle 5v.
- The CX2600A schematic confirms that pin 20 of the 6532 (upper right) is connected to 5v (lower center).  The connection is shown by the hollow triangle labeled "+5VDC sources" in the power section -- every hollow triangle on the schematic like pin 20 of the 6532 is a 5v power line.



No sense in researching systems you won't be using so exactly which systems you want to use this mod with?
- Atari 2600/5200/7800 consoles?
- Atari 400/800/XL/XE computers?
- Amiga 500/1000 computers?

You should be able to use a battery pack for power instead of USB.

You can put the whole mod (battery pack, LED, current limiting resistor, and a DB9 extension/feedthru cable) in a project box to make the setup more neat, self-contained, and easy to position for video capture.   ;D
- Using a project box on a DB9 extension/feedthru cable will save the effort of modding that old joystick and allow you to use other sticks if desired.


Scott
« Last Edit: August 02, 2022, 01:47:47 am by PL1 »

thomashenry

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 61
  • Last login:October 11, 2022, 03:55:21 am
  • I want to build my own arcade controls!
Re: Help with basic electronic circuit
« Reply #12 on: August 02, 2022, 07:36:48 pm »
So if I get my power from a USB cable, I'd put the red 5V wire before the led, and then just ignore the black wire?
Tie the USB ground wire to the same ground you're using for the encoder.
- Don't assume that wire colors indicate their function.  Best practice is to always verify with a multimeter.

This is going to be in an old DB9 joystick for using with old Ataris/8-bits/Amigas, and I really don't want to damage the vintage hardware!
This crucial detail might change things a bit.   :banghead:

At first glance, the good news is that computers from that era typically used 5v logic levels, not 3.3v like many newer consoles.

The bad news is that some of these systems might use "active high" inputs (5v triggers the input instead of ground) so you'd end up tying the retro system 5v directly to USB ground.   :scared

To be safe, you'd need to check the system schematics and component datasheets for each system's inputs, and it wouldn't hurt to also confirm with a multimeter.

For example:
-  The common on the Atari joystick is pin 8 of the DB9. (upper left of the schematic here)
- Pin 8 of the DB9 on the Atari CX2600A is tied to ground. (upper left of the schematic below)  That confirms that the Atari CX2600A is an active low device.
- Pins 1-4 (joystick U/D/L/R) on the Atari CX2600A DB9 go to the 6532 RAM-I/O-Timer chip.  The 3rd page of the zipped datasheet here confirms that the operating voltage (VCC) and input voltages (VIN) can handle 5v.
- The CX2600A schematic confirms that pin 20 of the 6532 (upper right) is connected to 5v (lower center).  The connection is shown by the hollow triangle labeled "+5VDC sources" in the power section -- every hollow triangle on the schematic like pin 20 of the 6532 is a 5v power line.



No sense in researching systems you won't be using so exactly which systems you want to use this mod with?
- Atari 2600/5200/7800 consoles?
- Atari 400/800/XL/XE computers?
- Amiga 500/1000 computers?

You should be able to use a battery pack for power instead of USB.

You can put the whole mod (battery pack, LED, current limiting resistor, and a DB9 extension/feedthru cable) in a project box to make the setup more neat, self-contained, and easy to position for video capture.   ;D
- Using a project box on a DB9 extension/feedthru cable will save the effort of modding that old joystick and allow you to use other sticks if desired.


Scott

Oh bloody hell, this is getting way more complicated than I imagined! Thanks for the help and patience.

I'll be using the DB9 joystick with an Amiga 1200, a MIST, a PC via a USB-DB9 converter, and with an iPac2, via a DB9 breakout.

The Amiga took standard Atari joysticks, and also puts 5V on pin 7, like the Atari. So I guess I can just connect the anode of the led to pin 7, then the cathode of the led to one of the non ground terminals of one of the microswtiches in the joystick? NC or NC depending if I want the light to come on or go off when the microswitch is pressed?
« Last Edit: August 02, 2022, 09:01:54 pm by thomashenry »

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9401
  • Last login:Today at 05:01:47 am
  • Designated spam hunter
Re: Help with basic electronic circuit
« Reply #13 on: August 03, 2022, 02:15:14 am »
I'll be using the DB9 joystick with an Amiga 1200, a MIST, a PC via a USB-DB9 converter, and with an iPac2, via a DB9 breakout.
That narrows it down quite a bit.   ;D

Five multimeter checks should let us know exactly what we're dealing with.

These are probably all active low devices, but it's a quick and easy check for the two unknowns.
- Set multimeter to "VDC", one lead on ground, and other lead on pin 8.  It should read 0v.

The big question is if all of them have 5v on pin 7 or if you need batteries/USB.
- To check, set multimeter to "VDC", black lead on ground, and red lead on pin 7.

Amiga 1200 - no checks needed.
- There is ground on pin 8 so it is an active low device.
- You've already confirmed that there is 5v on pin 7.  Found a reference stating 50mA max for this pin.

MISTer
- If there is ground on pin 8, it is an active low device.
- Check if there is 5v on pin 7.

PC via a USB-DB9 converter
- If there is ground on pin 8, it is an active low device.
- Check if there is 5v on pin 7.

IPac2, via a DB9 breakout
- Confirmed active low device.
- Check if there is 5v on pin 7.

The Amiga took standard Atari joysticks, and also puts 5V on pin 7, like the Atari. So I guess I can just connect the anode of the led to pin 7, then the cathode of the led to one of the non ground terminals of one of the microswtiches in the joystick? NC or NC depending if I want the light to come on or go off when the microswitch is pressed?
Yes.

If all of the systems you want to use have 5v on pin 7, you can attach the current limiting resistor + anode there.

If you want the LED to be usually off, momentary on when the switch is pressed, connect the cathode to the NO tab. (#3)

If you want the LED to be usually on, momentary off when the switch is pressed, connect the cathode to the NC tab. (#2)



--------------------------

A DB9 M-F breakout board like this one or this one would be great for your application -- plug your stick in on one side and a DB9 extension cord on the other.
- This approach would allow you to easily change which input the LED is tied to or add a battery pack if needed.

 


Scott

thomashenry

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 61
  • Last login:October 11, 2022, 03:55:21 am
  • I want to build my own arcade controls!
Re: Help with basic electronic circuit
« Reply #14 on: August 03, 2022, 03:31:16 am »
I'll be using the DB9 joystick with an Amiga 1200, a MIST, a PC via a USB-DB9 converter, and with an iPac2, via a DB9 breakout.
That narrows it down quite a bit.   ;D

Five multimeter checks should let us know exactly what we're dealing with.

These are probably all active low devices, but it's a quick and easy check for the two unknowns.
- Set multimeter to "VDC", one lead on ground, and other lead on pin 8.  It should read 0v.

The big question is if all of them have 5v on pin 7 or if you need batteries/USB.
- To check, set multimeter to "VDC", black lead on ground, and red lead on pin 7.

Amiga 1200 - no checks needed.
- There is ground on pin 8 so it is an active low device.
- You've already confirmed that there is 5v on pin 7.  Found a reference stating 50mA max for this pin.

MISTer
- If there is ground on pin 8, it is an active low device.
- Check if there is 5v on pin 7.

PC via a USB-DB9 converter
- If there is ground on pin 8, it is an active low device.
- Check if there is 5v on pin 7.

IPac2, via a DB9 breakout
- Confirmed active low device.
- Check if there is 5v on pin 7.

The Amiga took standard Atari joysticks, and also puts 5V on pin 7, like the Atari. So I guess I can just connect the anode of the led to pin 7, then the cathode of the led to one of the non ground terminals of one of the microswtiches in the joystick? NC or NC depending if I want the light to come on or go off when the microswitch is pressed?
Yes.

If all of the systems you want to use have 5v on pin 7, you can attach the current limiting resistor + anode there.

If you want the LED to be usually off, momentary on when the switch is pressed, connect the cathode to the NO tab. (#3)

If you want the LED to be usually on, momentary off when the switch is pressed, connect the cathode to the NC tab. (#2)



--------------------------

A DB9 M-F breakout board like this one or this one would be great for your application -- plug your stick in on one side and a DB9 extension cord on the other.
- This approach would allow you to easily change which input the LED is tied to or add a battery pack if needed.

 


Scott

Thanks so much. It's actually the MIST I'm using, not the MISTer - it's an earlier device, that was specifically designed to recrate the the aMIga and ST (hence the name). It has two DB9 joystick sockets that accept standard Amiga/Atari joysticks. For sure it will have ground on pin 8. Like you say, the question if they all supply 5V on pin7, but I presume they do, otherwise joysticks with standard autofire circuits (very common) would no work with them

That inline breakout box looks perfect, thanks.

Zebidee

  • Trade Count: (+9)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3247
  • Last login:Yesterday at 05:01:12 am
Re: Help with basic electronic circuit
« Reply #15 on: August 03, 2022, 05:04:17 am »
Regardless of how @thomashenry does his thing, this has been an interesting thread. Thanks to Scott in particular.

Check out my completed projects!


thomashenry

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 61
  • Last login:October 11, 2022, 03:55:21 am
  • I want to build my own arcade controls!
Re: Help with basic electronic circuit
« Reply #16 on: August 03, 2022, 05:41:41 am »
Regardless of how @thomashenry does his thing, this has been an interesting thread. Thanks to Scott in particular.

Not the first occasion where he's spent a lot of time explaining things to me. Really appreciated.
« Last Edit: August 03, 2022, 06:20:41 am by thomashenry »

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9401
  • Last login:Today at 05:01:47 am
  • Designated spam hunter
Re: Help with basic electronic circuit
« Reply #17 on: August 03, 2022, 06:17:04 am »
It's actually the MIST I'm using, not the MISTer
D'oh!  My bad.   :embarassed:

For sure it will have ground on pin 8. Like you say, the question if they all supply 5V on pin7, but I presume they do, otherwise joysticks with standard autofire circuits (very common) would no work with them
"For sure" and "presume" are OK . . . until you run into a non-standard system.   :banghead:

Best practice is to confirm 5v and ground with the multimeter or at least confirm that an autofire stick works with that device.

That inline breakout box looks perfect, thanks.
Figured you might like that better than hacking an LED into the stick.   :cheers:

Regardless of how @thomashenry does his thing, this has been an interesting thread. Thanks to Scott in particular.
Thank you.   :cheers:

Threads like this are good for walking people through the research, design, and testing process for circuits; reading schematics and datasheets; and warning about potential pitfalls like accidently connecting 5v to ground, mixing "active low" and "active high" devices, and cheap USB cables that use non-standard wire colors. (i.e. "Don't assume that wire colors indicate their function.")   ;D


Scott

Mike A

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5884
  • Last login:Yesterday at 06:22:05 pm
  • This plan is foolproof
Re: Help with basic electronic circuit
« Reply #18 on: August 03, 2022, 06:22:12 am »
Quote
"For sure" and "presume" are OK . . . until you run into a non-standard system.

If I had a nickel for every time I ran into a nonstandard standard...

When I work on 40 year old hardware that other people have already "repaired" at one time, I strap on a helmet. ---steaming pile of meadow muffin--- is about to get real.

It is really fun when the schematics are wrong.

thomashenry

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 61
  • Last login:October 11, 2022, 03:55:21 am
  • I want to build my own arcade controls!
Re: Help with basic electronic circuit
« Reply #19 on: August 03, 2022, 09:38:16 am »
hmmm- I just put a LED inline with one of the controller inputs and it works the way I want with my DB9-USB adapter on the PC. When the switch is pressed, the light comes on and the control is detected on the computer.

On the MIST, the LED comes on, but the MIST does not detect the input.
« Last Edit: August 03, 2022, 09:48:58 am by thomashenry »

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9401
  • Last login:Today at 05:01:47 am
  • Designated spam hunter
Re: Help with basic electronic circuit
« Reply #20 on: August 03, 2022, 12:29:31 pm »
hmmm- I just put a LED inline with one of the controller inputs and it works the way I want with my DB9-USB adapter on the PC. When the switch is pressed, the light comes on and the control is detected on the computer.

On the MIST, the LED comes on, but the MIST does not detect the input.
Sounds like the voltage drop across the LED and/or resistor is keeping the Input Port on the MIST at a voltage above Logic Low.



When the switch is pressed:
    Black text = Ground/Logic Low
    Red text = Higher voltage than ground that might not register as a Logic Low

Don't wire it with an LED and/or a resistor between Ground and the Input Port like this:

    Ground ---- Switch ---- LED ---- Resistor (?) ---- Input Port

Wire it with nothing but the switch and wires (they have almost zero voltage drop) between Ground and the Input Port like this:

                                       |---- LED ---- Resistor ---- Pin 7 5v
                                       |
    Ground ---- Switch ----|---- Input Port


Scott

thomashenry

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 61
  • Last login:October 11, 2022, 03:55:21 am
  • I want to build my own arcade controls!
Re: Help with basic electronic circuit
« Reply #21 on: August 05, 2022, 05:07:26 am »
Understood! But while I wait for the parts to make the device proper, I had a thought - if the LED being on is enough to prevent the button from registering on the MIST (and Amiga it turns out), then I could just put the LED in parallel, connected to the same pins on the switch as the input and ground. Then, the LED will be ON by default, but with enough draw to mean the device does not see a press. But when the switch is pressed, the current will flow through the path of least resistance, turning the LED off, and the device does see the press. This works! So two slightly different configurations allow this to work both with the USB converter, and the Amiga/MIST.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9401
  • Last login:Today at 05:01:47 am
  • Designated spam hunter
Re: Help with basic electronic circuit
« Reply #22 on: August 05, 2022, 06:46:54 am »
if the LED being on is enough to prevent the button from registering on the MIST (and Amiga it turns out), then I could just put the LED in parallel, connected to the same pins on the switch as the input and ground. Then, the LED will be ON by default, but with enough draw to mean the device does not see a press. But when the switch is pressed, the current will flow through the path of least resistance, turning the LED off, and the device does see the press.
You're getting the hang of it.   :cheers:

It's a variation on #2 where you get the 5v from the input port and the voltge drop across the LED keeps the input port above logic low until you close the switch.

That could be a decent temporary workaround, but the voltage drop across the LED might keep the input port between logic high and low between button presses.
- Not sure if that will interfere with the latency readings you are trying to take.   :dunno




Scott