wiki:starkadroid

Version 3 (modified by pulkomandy, 14 years ago) ( diff )

--

The Starkadroid is a project I made for building a mamecab. A mamecab is a fake arcade cabinet powered with a PC, and from wich you can play many games.

We had some buttons, a PC, and nothing to put in between. The usual solution is to dismantle a PC gamepad or keyboard and solder the arcade buttons on it. But we had two problems with that :

  • The mamecab we are building will be used in real world situation with people hitting it violently when they game over. we don't want a wire to break and the whole thing to stop working every two weeks. So soldering on a PCB not made for it is not good.
  • There are better uses for gamepads than dismantling them.

Anyway, the device exposes itself as a single gamepad with 2 axis and 36 buttons. Not all of them are used, and maybe the report will change a bit in the future. But I was too lazy to do it properly for now.

Hardware

Kicad project

This is loosely based on the ak2usb. What hapenned :

  • Removed the ps/2 port
  • added 2 6-bit ports to make a matrix keyboard driver.
  • removed the debug led, added 5 'misc' pads on the PCB for future extension.

The device expects the buttons to be connected in a matrix, that is, each button is at the intersection of two different wires. It's a good idea to put a diode in series with each button to avoid interferences. So it should look like this :

(where O is a button and |>|is a diode)

wire 1 -----O---|>wire 7 wire 2 -----O---|>wire 7

...

wire 6 -----O---|>wire 7
wire 1 -----O---|>wire 8 wire 2 -----O---|>wire 8

... ...

wire 6 -----O---|>wire 12

This way you can have up to 36 buttons plugged in.

Software

Source code

The bootloader is the same as for ak2usb. See there for infos.

The software is really straight forward. It scans all the lines on PORTB and reads te result in PORTC for each of them. All of this is put in an HID report descriptor that's then sent to the computer. And then it loops and starts again.

Upgrade

Here are instructions on how to upgrade the firmware :

  • You need a PC with windows or linux, or another OS that can run avrdude.
  • You need another keyboard to control the computer while the adapter is in upgrade mode
  • You need AVRDude ( http://savannah.nongnu.org/projects/avrdude ) or another software that can handle 'usbasp' programming (extreme burner is another example)
  • You need the latest firmware .hex file

Now how to actually do it :

  • Unplug the adapter from the computer
  • On the adapter there is a jumper, when the jumper is closed the adpater will enter upgrade mode, when it is open the adapter works as usual
  • Close the jumper
  • Plug in the adapter again. It should be detected as 'usb asp', not 'starkadroid'.
  • Run the firmware upgrade command :
    avrdude -c usbasp -p atmega8 -Uflash:w:starkadroid.hex
    
  • Wait for it to finish. It is not too long.
  • Unplug the adapter
  • Open the jumper
  • Replug the adapter.

And you're done!

Future plans

I may add some output on the free pins to drive some lights or whatever.

Note: See TracWiki for help on using the wiki.