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: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet  (Read 4859 times)

0 Members and 1 Guest are viewing this topic.

Ron_Michallick

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:October 30, 2023, 09:14:14 pm
  • MK64 has newer software, if you are interested.
    • MK64
Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« on: September 01, 2018, 07:08:57 pm »
I have all the electronic pieces to make the Mame powered Spy Hunter cabinet except a two channel analog to PC adapter (that is MAME friendly). I am willing hack and destroy something to save money. I have a real steering panel and pedal assembly for the game and broken game boards.

I saw this description on Ebay, "Wired USB Shock Gamepad Controller Joystick Arcade Joypad for PC" that looks promising. Am I looking in the correct direction? Any one else have success interfacing potentiometers to a PC?

Thanks!

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9402
  • Last login:Today at 06:16:00 am
  • Designated spam hunter
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #1 on: September 01, 2018, 09:23:18 pm »
The lowest cost analog encoder is the KADE MiniArcade 2.0 firmware on an inexpensive 32u4 AVR such as the "Arduino Pro Micro ATmega32U4 5V 16MHz" with no daughterboard/screw terminals. (solder wires to the through-holes or use Dupont pins)

KADE MiniArcade 2.0 beta release thread:
http://forum.arcadecontrols.com/index.php/topic,154126.0.html

Each potentiometer uses VCC (5v), ground, and one analog input. (purple box on the right)
- Port F7 (Left X-axis) for the wheel
- Port F6 (Left Y-axis) for the pedal

That leaves plenty of input ports (gamepad buttons) for the coin(s), triggers, thumb buttons, van button and shifter microswitches.

One thing that the miniArcade 2.0 can't do is make the van button lamp flash, but I think that MAME's Video Options menu has a "Lamps" view that will display it on the screen instead.   ;D

Directions for programming the AVR and wiring microswitches and potentiometers are in the User Guide included in the Mapper software download package.

LMK if you have any questions.   :cheers:

Arduino Pro Micro pinout for MiniArcade 2.0.



Scott

Malenko

  • KNEEL BEFORE ZODlenko!
  • Trade Count: (+58)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 13999
  • Last login:April 09, 2024, 07:27:18 pm
  • Have you played with my GingerBalls?
    • forum.arcadecontrols.com/index.php/topic,142404.msg1475162.html
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #2 on: September 01, 2018, 10:25:38 pm »
APAC
If you're replying to a troll you are part of the problem.
I also need to follow this advice. Ignore or report, don't reply.

baritonomarchetto

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:Yesterday at 01:51:33 pm
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #3 on: September 02, 2018, 04:09:09 am »
Arduino Leonardo / pro micro or any other ATmega 32u4 board. No need for any expensive commercial boards or shield.
« Last Edit: September 02, 2018, 04:12:23 am by baritonomarchetto »

Ron_Michallick

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:October 30, 2023, 09:14:14 pm
  • MK64 has newer software, if you are interested.
    • MK64
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #4 on: September 02, 2018, 02:59:27 pm »
Thank you PL1, baritonomarchetto, and Malenko.

This information is very helpful, I'm going the chose the Arduino  Kade 2.0 option which will be more effort but is a preferred solution for me. I like that the A-Pac is ready to go out of the box, but the cost is emotional prohibitive for me at this time.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:April 21, 2024, 11:59:54 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #5 on: September 02, 2018, 08:24:31 pm »
I'll add that if you decide to go the generic avr route it's quite easy to control leds/lamps via a serial connection and mamehooker supports serial communication... just sayin'. 

Ron_Michallick

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:October 30, 2023, 09:14:14 pm
  • MK64 has newer software, if you are interested.
    • MK64
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #6 on: September 05, 2018, 02:23:14 pm »
Howard,

Instead of a serial connection, could I use a USB to Parallel port adapter like https://www.frys.com/product/8471958 ?
Unless you meant that the KADE 2.0 could change some inputs to output pins.

Building a logic to lamp driver is an easy task for me. I really like the idea of LED / LAMPS instead of on screen indicators.


JudgeRob

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 468
  • Last login:March 05, 2024, 10:55:50 pm
    • forum.arcadecontrols.com/index.php/topic,149265.120.html
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #7 on: September 05, 2018, 02:41:58 pm »
You don't need that cable.  You can just run the serial info over the usb input of the board.  If you use a small board with no usb jack, you can get boards for about $10, but you would need one of these:
https://www.sparkfun.com/products/9716


PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9402
  • Last login:Today at 06:16:00 am
  • Designated spam hunter
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #8 on: September 05, 2018, 04:49:33 pm »
Unless you meant that the KADE 2.0 could change some inputs to output pins.
Unfortunately getting Mame Hooker and the miniArcade 2.0 firmware working on a single AVR is not an option at this time.

Use two separate AVRs FTW.   ;D


Scott

Ron_Michallick

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:October 30, 2023, 09:14:14 pm
  • MK64 has newer software, if you are interested.
    • MK64
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #9 on: September 08, 2018, 07:28:19 pm »
PL1 Scott,

I have my new pro-micro board(s), but I can't program them. The Kade user manual plus other web sites say I have to press a button or add jumper to get allow programming. I don't know where to press or connect. I tried double grounding RST pin to get a bootloader COM port but that never happened.

Windows 10 recognized the board and I installed the dpinst64.exe driver in Admin mode.
device manager is happy and the board get COM5 serial port.

I used this to program the pro-micro hex file that is in local directory and got this error.
C:\AVR\mapper-miniArcade2\programmer\win>dfu-programmer.exe atmega32u4 flash MINIARCADE2.hex
dfu-programmer: no device present.


PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9402
  • Last login:Today at 06:16:00 am
  • Designated spam hunter
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #10 on: September 08, 2018, 10:50:38 pm »
I used this to program the pro-micro hex file that is in local directory and got this error.
C:\AVR\mapper-miniArcade2\programmer\win>dfu-programmer.exe atmega32u4 flash MINIARCADE2.hex
dfu-programmer: no device present.
Dfu-programmer doesn't work with Arduino boards like the Pro Micro because they don't use the DFU bootloader.

Look on pages 13-14 of the User Guide under "Procedures for non-DFU boards".

Good News: I've tested the .bat file on an Arduino Micro (COM9 when in bootloader mode) and it works perfectly.
Code: [Select]
avrdude -p atmega32u4 -P COM9 -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.hex -C avrdude.conf
Bad News:  I can't seem to get the Pro Micro to go into bootloader mode.   :badmood: :banghead:

I have my new pro-micro board(s), but I can't program them. The Kade user manual plus other web sites say I have to press a button or add jumper to get allow programming. I don't know where to press or connect. I tried double grounding RST pin to get a bootloader COM port but that never happened.
Sounds like the "Reset to Bootloader" procedure described here.



"resetting twice quickly will get the Pro Micro to enter bootloader mode for eight seconds."
I'm not seeing any indication that this procedure works with my Pro Micro.  Running the .bat file returns a "programer is not responding" error after a few seconds.   :dunno

"When a Pro Micro is externally reset (by pulling the RST pin low), it’ll only briefly (<750ms) start the bootloader before continuing on to the sketch."
When I run the .bat file quickly after releasing the reset button, avrdude shows "Connecting to programmer: ." but doesn't connect or time out.   :dunno :banghead:

I also tried running the .bat file immediately after plugging in the Pro Micro.  Avrdude returns a "programer is not responding" error after a few seconds.   :dunno

Anyone know if there's some other way to put the Pro Micro into bootloader mode?   :dizzy:


Scott

Ron_Michallick

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:October 30, 2023, 09:14:14 pm
  • MK64 has newer software, if you are interested.
    • MK64
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #11 on: September 09, 2018, 05:54:13 pm »
Scott,

Thank you; Arvdude worked great. The double reset press give me COM 6 for eight seconds every time. My board is flashed and EEPROM is saved.  however in MAME and Kade's game pad tester there is no analog results. The digital buttons show up OK. I set up F6 and F7 as analog in the config. I have 250k pots attached to A1 and A0 port on board. I checked the A0, A1 voltage with a meter and it has good analog inputs.
I attached my dat file and eep file in case your interested. Alternatively you could upload your dat or eep EEPROM that does work and I'll try it.

Sorry for all the questions, but I think I'm really close to getting this working.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9402
  • Last login:Today at 06:16:00 am
  • Designated spam hunter
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #12 on: September 09, 2018, 07:19:22 pm »
The double reset press give me COM 6 for eight seconds every time.
Glad that the double-click reset to bootloader is working for someone.   :embarassed:   :lol

My board is flashed and EEPROM is saved.  however in MAME and Kade's game pad tester there is no analog results. The digital buttons show up OK. I set up F6 and F7 as analog in the config. I have 250k pots attached to A1 and A0 port on board. I checked the A0, A1 voltage with a meter and it has good analog inputs.
I attached my dat file and eep file in case your interested. Alternatively you could upload your dat or eep EEPROM that does work and I'll try it.
250k pots are a lot higher resistance than the usual 5k (arcade) or 100k (PC analog stick) pots.

I haven't tested using those higher-value pots.  They might not allow enough current flow for the ADC circuit.   :dunno

Test to rule out that possibilty:
- Short pin 1 (5V? GND?) to pin 2 (wiper) on one of the pots.  Does that cause the axis to move to max/min?
- Short pin 3 (5V? GND?) to pin 2 (wiper) on one of the pots.  Does that cause the axis to move to max/min?

I'm not sure what settings you used, but the .eep file you posted doesn't match the default or what you get when you just enable analog ports F6 and F7 for a Generic USB/HID Joypad.

Try this:

1. Open the Mapper program

2. File -- Reset settings

3. In Config, select only the boxes for ports F7 and F6, click OK

4. Verify that Output System = Generic USB/HID Joypad

5. Verify that Output mode = Auto Detect

6. Tools -- Save EEPROM config data to file
Code: [Select]
:100000004B4144458A00000101000000000000004F
:100010000102030405060708090A0B0C0D0E0F1058
:100020001112131415161718191A1B1C1D1E1F2048
:100030002122232425262728292A2B2C2D2E000196
:1000400002030405060708090A0B0C0D0E0F101118
:1000500012131415161718191A1B1C1D1E1F202108
:1000600022232425262728292A2B2C2D2E04050679
:100070000708090A0B0C0D0E0F1011121314151698
:100080001718191A1B1C1D5251504F28292B2CFFD1
:0C009000FFFFFFFFFFFFFFFFFFFFFFFF70
:00000001FF

7. Copy/paste the .eep file to the avrdude folder

8. Put the AVR in bootloader mode and run the .bat file to reload the firmware/EEPROM


Scott

Ron_Michallick

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:October 30, 2023, 09:14:14 pm
  • MK64 has newer software, if you are interested.
    • MK64
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #13 on: September 09, 2018, 09:51:00 pm »
Scott,

You are amazing. I followed your steps and it worked   :applaud: . I have no idea why it wasn't working before  :dunno, but It works now. If you haven't helped, I would have been tracking down the "device not migrated error" in the driver events which wouldn't go anywhere because a second win 10 PC I tried didn't get that "error" and still didn't see the analog (before the last eep file). In the end it will go on a win XP system, that is service pack 2. I haven't found the right driver for a game pad, but I'll install service pack 3 first which might automatically have a driver.  250k pots seem to work well, but I wouldn't recommend running them over long wires  ;D  There are just test pots, not the spy hunter pots.
« Last Edit: September 09, 2018, 09:52:35 pm by Ron_Michallick »

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9402
  • Last login:Today at 06:16:00 am
  • Designated spam hunter
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #14 on: September 10, 2018, 12:28:30 am »
Thank you for confirming that the avrdude procedure works.   :cheers:

Finally got my Pro Micro to go into bootloader mode.   :w00t

The problem was poor connection(s) somewhere between the switch/breadboard/pin header/AVR.    :banghead:

User Guide text updated for the next release and added the info to the beta test thread.   ;D


Scott

Ron_Michallick

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:October 30, 2023, 09:14:14 pm
  • MK64 has newer software, if you are interested.
    • MK64
Re: Inexpensive 2 axis analog input needed for Spy Hunter mame cabinet
« Reply #15 on: November 15, 2020, 05:14:22 pm »
Update: the LedWizClone2 board with a ULN2003 is installed in a completed hand built 2' x 2' x 6' cabinet using all the original Spy Hunter hardware. All controls interface to PC using this board.
The ULN2003 boosts the drive for the LED weapons bar I made and the original coin lamps and weapons van lamp. The DB25 connector makes it all modular and if need be, repairable.