MJoy

Not a real project this time, most likely an implementation of another person project.

If you like to play videogames in your computer as much as I do, you probably already heard about the MJoy, which is an USB joystick made by Mindaugas that uses an ATmega8 and have 24 buttons, one hatswitch (or POV or D-Pad depending on the game) and 6 analog axes.

100_5385

It’s oriented to flight simulators games, but can be used for any game, it’s should work wonderfully if you are trying to build a MAME cabinet (Uh, I might try that later).

And it can do that with really simple components, just some resistors, 12 MHz crystal, zener diodes and some diodes to prevent phantom keys (and of course, an ATmega8).

Anyway, since I was already etching the beta board myself, I made a little board for this implementation.

100_5382

But this part is so simple that you can do it in a protoboard or perfboard.

And I know, I know, I should use a B USB connector since it’s a downstream device, but I couldn’t find one, so I used a female A USB connector and a male-to-male A cable.

Unfortunately, Mindaugas site was been down for ages, and people who wish to build one depend on web.archive or the first version of the project, since its still on its original place.

So I will post the code here, but as soon as the site is back I will remove it.

I used the alternative version, made by LazyCamel, but you can try any version to see if it works for you (aren’t you glad now that I put that general purpose connector on the beta card?).

Just put a 12 MHz crystal in the connector in the beta card, 22pF ceramic capacitors in the crystal capacitors place (if you don’t know here it is, just click in the top view photo of the beta card and then see the notes on flickr), always remember to connect Agnd to ground and Vref and AVcc to the positive power supply before you program the code.

Connect the ground on the USB board with the ground on the beta board, same with the 5V, then connect -D to pin 2 on the ATmega8 and +D to pin 3 and 4.

Program the code and then program the fuses, MJoy suggest that you should only program the SPIEN fuse, I suggest that you program the CKOPT fuse to, so it should something like this on PonyProg.

That should be it.

Any doubt, take a look at the schematics that LazyCamel made, there is even a board there, so you shouldn’t have any problems.

The code in hex from LazyCamel
The pdf from LazyCamel with the schematics and the board that he made.

The schematics and the board file in eagle format with the B-female USB connector.
The schematics and the board file in eagle format with the A-female USB connector.

The
schematics in PNG.

The board is released as-is under
Creative Commons 3.0 - Attribution - Share Alike

13 Responses to “MJoy”

  1. Gabriel Says:

    Seems pretty cool! If I only knew what the heck does this means…

    (Mockery from a friend absolutely clueless about what electronic is)

  2. Electronics-Lab.com Blog » Blog Archive » MJoy- USB video game controller Says:

    [...] MJoy- USB video game controller - [Link] [...]

  3. Michiel Says:

    This means, that you can build your own controller using Variable resistors, switches etc. The microcontoller translates 8 analog channels and 32 switches. This gives a lot of possibilities. Verry cool project.

  4. rami_lpm Says:

    awesome! since mindaugas closed, this is one of the only places that still distributes mjoy. thanks a lot.

  5. Michiel Says:

    I have build the board, and Windows recognises the MJoy Hardware. Now there is a differnce between this version and the original. That is de USB connection. On this one it is pin 2 and 3, on the original it is pin 14 and 15. Why this difference, and where is the source that supports this version.

  6. Izuna Says:

    Hey Michiel!
    Send us a photo of the board you made!

    Yes, there is two versions of the MJoy, the one Mindaugas, the original author made and the other one that LazyCamel made, both work the same, as far as I can tell, LazyCamel arranged the USB pins to 2 and 3 instead of the 14 and 15 because that would make the code simpler and to give the opportunity to program the controller using rs232, but I doubt we will ever see this done.

    The other major difference is that LazyCamel used one of the pins of the atmega to implement a “status good” led to show that the Mjoy is working alright, but, because of that, his version only have 24 buttons instead of the 28 of the Mindaugas version.

    The hex i provided on the site is for the LazyCamel version, the one with the USB pins on the 2 and 3 pins, but you should be able to find the hex for the Mindaugas version here:

    http://web.archive.org/web/20070403011435/http://www.mindaugas.com/projects/MJoy/Versions/4/mjoy.hex

    Any questions just leave a note and I answer as soon as I can, ok?

  7. Mark Says:

    Hi, this looks like something i can tinker with, do you have a complete parts list?? Or a link to LazyCamel, i could only find links in Russian.
    thanks
    mark

  8. Izuna Says:

    Your best shot would be the web archive from mindaugas site, he explain things way better than i do…

    Go here ->
    http://web.archive.org/web/20070403011435/www.mindaugas.com/projects/MJoy/Versions.php

    Theoretically i have plans to make a board for the MJoy but i always postpone it…

  9. Macgaiver Says:

    Hello unfortunately it up according to plan and properly recording the AtMega8 with a professional recorder of EPROM, and given the mounting step, the windows still does not recognize the Joystick “MJoy” someone could try to explain why not? the file. I used HEX posted here is done by “lazyCamel” Thank

    Sure my terrible english.

  10. Izuna Says:

    No prob with the english dude, but since you are from brazil to, i will talk in portuguese, ok?

    Primeiramente, empresa legal cara, interessante a idéia de vender tanto a placa quanto a solução inteira. Precisando de estagiário me chama tá…rs

    Infelizmente tem um monte de coisa que pode dar errado, eu tive bastante problema por ter esquecido de gravar os fuses do atmega, então de uma verificada nisso, aproveita e vê se o .hex gravou direito no atmega.

    Tirando isso tem duas versões da placa, a que ta no .pdf é a que você deveria usar, tem uma outra versão que não é compatível com esse software.

    Caso você ainda não tenha feito a placa definitiva da pra tentar a outra versão que usa uma pinagem e softwares diferente mas tem funcionamento semelhante, e o site é em português então talvez você tenha mais facilidade:
    http://br.geocities.com/zerodigit1/MJOY/index.htm

    Só pra avisar o outro site não é meu e eu não testei essa versão mas deve funcionar também, qualquer coisa posta aqui de novo que eu tento ajudar mais.

  11. Macgaiver Says:

    Primeiramente. Obrigado Izuna.
    Bom minha idéia de projeto é fazer um simulador de Voo mesmo, usando este joystick, se bem que o meu negócio é aprender mesmo.
    Por favor dá uma examinada nesta foto que capturei da tela do meu gravador de Eproms que é um Elnec BeeProg+
    http://www.multijogos.com.br/fotos/atmega8.png

    Por favor tente encontrar quais fuses devo usar, tentei uma certa combinação mais não obtive sucesso, fora as versões diferentes que já montei em meu proto-board heheeh.
    desculpe por postar em português, meu inglês é mais que péssimo, só google ajudando.

  12. Izuna Says:

    Provavelmente eram os fuses mesmo, quando ele diz “external clock” ele quer dizer uma fonte de clock externo como um gerador de função ou o 555 por exemplo, não um cristal como é o caso.

    Então reprograma os fuses com bases nesse daqui:
    http://www.raijuu.net/make/random/fuses.jpg

    Repare que ele diz “Ext. Crystal” e tal no clock blz?

    Provavelmente era so isso mesmo, agora provavelmente funciona.

  13. Macgaiver Says:

    Obrigado Amigo, inacreditávelmente o problema era mesmo o meu Prot-Board, o danado estava com maus contatos hehehe por isto não funcionava nem a pau, agora usando os parâmetros corretos montei em uma placa matriz e foi blz. Gravei os fuses na boa e funcionaram de Prima..

    Obrigado Amigo.
    Agora vou na caçada do HEX para o Atmega16 e tentar ver porque não consigo compilar o source deste atmega8 :(

Leave a Reply