1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Tutorial Mjoy16 USB AVR Joystick

Discussion in 'DIY peripherals' started by tronicgr, Jan 3, 2008.

  1. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Hello Dominik,

    What voltage did you use for your external source? Did you connect it in reverse polarity? It started smoking so something was shorted out. Always make sure to connect (+) to (+) and (-) to (-).

    Did you configure the fuse bits exactly as in the manual? I am 90% sure that you configured the wrong Clock Select fuse bits and set the controller for External Oscillator. If that is the case try to connect a 1MHz or more external clock signal to XTAL1 (Pin13).

    If you don't have any other ways to generate a clock signal, a simple oscillator circuit using a 74HC04 buffer inverter can be found here:
    http://www.elecfree.com/electronic/crys ... al-74hc04/
    you can use your 12MHz crystal with 15-18pF capacitors, everything else the same. Also use a 0.1uF decoupling capacitor between Vcc and Gnd of the 74hc04. Connect Clock to XTAL1 and power on.

    I hope you didn't fry your IC with the external supply when things were smoking. Try this and see if you have any luck with it.
  2. ZXika

    ZXika New Member

    Joined:
    Jan 31, 2010
    Messages:
    7
    Balance:
    - 10Coins
    Ratings:
    +0 / 0 / -0
    Ok. Thank you. I'll try that, I just need to buy those. To make sure, I'll buy another IC. BTW external source voltage was 5.2V or so.
  3. ZXika

    ZXika New Member

    Joined:
    Jan 31, 2010
    Messages:
    7
    Balance:
    - 10Coins
    Ratings:
    +0 / 0 / -0
    Hi. I bought new components, spare ones and ones for oscillator. I managed to connect it, and it works, I can programm it. But, there is one problem, Windows can't recognize it. What should I do next? I use Windows 7, maybe that's the problem. And, Frakk, thank you very much for your help, if nothing else, I'm able to programm.
    And for answer to this question, thank you in forward.
  4. willynovi

    willynovi Member

    Joined:
    Feb 13, 2009
    Messages:
    64
    Location:
    Argentina
    Balance:
    354Coins
    Ratings:
    +2 / 0 / -0
    Does anyone could use this board under Windows 7?
  5. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Hi guys,

    Dominik, can you please post your detailed questions here in the topic instead of pm/mail? That way other people might find the information, problem/solution useful too.

    I'm pretty sure there is only one firmware for the device and if you can program the Atmega16 successfully, the problem will be between the IC and Windows. This could be not enough power for the IC to operate, wrong USB connection on your circuit, driver or windows issues.

    I am waiting for my USB A-B cables because I left the ones I had in Hungary. I tested the circuit with XP and it worked as it should have. I just built a new PC with Win7 on it and once I get my cables I can give you more info on it's compatibility. I cannot see any reason why it wouldn't work, but you never know.
  6. ZXika

    ZXika New Member

    Joined:
    Jan 31, 2010
    Messages:
    7
    Balance:
    - 10Coins
    Ratings:
    +0 / 0 / -0
    OK. Thanks. I'll see what I can do. And sorry I e-mailed.
  7. ZXika

    ZXika New Member

    Joined:
    Jan 31, 2010
    Messages:
    7
    Balance:
    - 10Coins
    Ratings:
    +0 / 0 / -0
    Hi guys, the e-mail I sent to Frakk goes like this:

    Hi Frakk.
    I'm sorry to bother you again. I managed to do everything as you advised me
    and I'm able to programm the chip. However, PC doesn't recognize the
    device. I'm on Windows 7 so I tried to connect to other PC that has Windows
    XP SP1. I doesn't work either. I want to know is it normal that writing
    status goes: 5%, 10%, 15%, 20%, 25%, 30%, 35%, 40%, 45%, 100%?
    And then verifying is normal, and message says: Write successful. I am
    really out of ideas, I had even put another chip, but Windows shows the
    same thing. I have double checked all the connections, so I don't think
    that problem is in hardware. In PonyProg I have checked: BOOTSZ1, BOOTSZ0
    and SUT0 for configuration. I found that configuration on some site, and I
    found other configuration on this forum (only SUT0 checked). Neither of
    them work. Maybe it's a problem with hex file, I tried lots of them. Again,
    neither of them works. I was wondering if maybe you have a hex file that's
    not on the site? I don't think problem should be with eep file, since I
    have discovered that one of versions (one on the flightsim site) doesn't
    use: Write Data Memory (EEPROM). What do You think?
  8. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    I just got my USB cables and I confirm that the Mjoy works with Windows 7. It is recognized just like in XP, 8 axis, 32 buttons plus HAT. I don't know about the mapper softwares but running them in XP compatible mode should do the trick.
  9. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
    Like Frakk, I test Mjoy (ATMEGA8) and MJoy16(ATMEGA16) under Windows 7/64 bits, and confirm too that work.

    Zxika,

    As you describe, your problem is not in firmware, that write OK (1) and fuses OK (you can program fuse in both modes), is in hardware: some component is wrong, or have bad solder, short circuit.
    Cheap USB cable is common cause of USB device not recognize).

    To program ATMEGA you need only the connectors in PINS 6,7,8,9, GND and + 5V. So fault in another component don't interfere.

    Sokol1
  10. tirta

    tirta Member

    Joined:
    Feb 4, 2010
    Messages:
    56
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hello Guys,

    I am Tirta from Indonesia, nice to meet everybody here! :D

    I plan to convert my old gameport hotas into usb version using mjoy or mjoy16.

    Reading this thread from page 1, I find so many variants and layouts.
    Now I get confused. :?
    Which one is the best? and which one is easiest to make?
    Since I have zero experience in making pcb, but I know how to solder a little bit.
    Please let me know your opinion.
    Thank you.

    My old gameport hotas: CH Flightstick (1 hat + 4 buttons} + Pro Throttle (4 hat + 4 buttons) + Pro Pedals (3 axis),
    so the total is: 6 axis and 28 buttons.
  11. tirta

    tirta Member

    Joined:
    Feb 4, 2010
    Messages:
    56
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
  12. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
    Hi Tirta,

    Mercury version is a revision of Mindaugas/Lazy Camel,
    he didn't change the name of the firmware - if you look
    at assembly file you find Mercury name.

    In the file of these link:

    http://mercury13.tut.su/files/mjoy/MJoy ... are_new.7z

    You have five different firmwares, accord this table:

    [​IMG]

    For fast scaning look at Operational Frequency column = minus axis, more fast.

    But for flight sim controllers low values is no problem.

    Mercury is racing sim fan, and for these fractions of seconds count, so a 3/4 axis at 120 mhz is desirable.

    For your propose - convert old HOTAS - Universal! firmware is fine.
    The 8 bits axis in throttle, rudder and left/right brakes is not inconvenient.

    BTW_I don't know how fast is scanning in Mjoy16, but as have more buttons and axis, probably is equivalent.

    To fit inside Flightstick base you need a 35 mm width PCB.

    Sample of PCB for Mjoy 8_Mercury, for any of five Mercury firmware versions:

    [​IMG]

    Layout http://drop.io/hidden/n65epzbwjbecu5/as ... 1yYXI%253D

    To view/print use: http://www.abacom-online.de/uk/html/bod ... out-Viewer

    Note - the above PCB is only for Mercury firmware revisions, due change in rows and columns pins.

    But, if you choice is Mjoy16 - the different in cost is about U$ 5,00 more, in ATMEGA16-16PU. In spite ATMEGA16-16PU (40 pin) to be larger than ATMEGA8-16 PU 928pin), your electric circuit is more simple, so you can obtain a
    35mm width PCB too:

    [​IMG]

    PCB: http://drop.io/hidden/n65epzbwjbecu5/as ... M2LXJhci0y

    Note these PCB's are for fit inside stick base, so I dont place pins for USB B conncector, solder USB cable directly into PCB.

    Use MJoy16-C1_SW_v1.3 firmware: http://www.joysticks.ru/download/files/ ... W_v1.3.zip
    For above or for any Mjoy16 layout that you find.

    Sokol1
  13. ZXika

    ZXika New Member

    Joined:
    Jan 31, 2010
    Messages:
    7
    Balance:
    - 10Coins
    Ratings:
    +0 / 0 / -0
    Hi Frakk.
    I'm glad you got your cabel, and I'm glad it works. I don't know where my problem is. When I get the chance, I'll go make myself a PCB, that should be more solid than the wires on testboard. Even though I have soldered the whole thing on raster board the thing doesn't work. When I'm done, I'll keep you posted.
  14. ZXika

    ZXika New Member

    Joined:
    Jan 31, 2010
    Messages:
    7
    Balance:
    - 10Coins
    Ratings:
    +0 / 0 / -0
    Hi Sokol.
    By what you told be, the problem could be in programming, right? So I should remove USB from connector, i suppose, so RXD and TXD don't mess with programmer. Maybe that's it. I use USB an the source, so I should find another solution, or I should place the switches ond RXD and TXD.
    I'll do that when I find a time. Thanks, that should help
  15. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Sokol is saying your programming is fine. If you get Programmed Successfully or Programing is OK, then you are done. The USB connector does not effect programming, you need it for power. I would double check your soldering, make sure you connect the right pins to the right components. It is very easy to mix up the USB connector pins. In a drawing you might be looking at the connector from the bottom, on an other drawing they might show you this mirrored because thats how it goes on the PCB. Simple things like this will throw you off.

    Double Check!
  16. tirta

    tirta Member

    Joined:
    Feb 4, 2010
    Messages:
    56
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hi Sokol1,

    Have you made TronikGr version?
    How is it compared to Mercury?
    Which one is better for my purpose?

    And how about autocalibration?
    A friend tells me that I need it for fllight sim.
    All mercury versions do not have autocalibration.

    Does Mjoy16 (ATMEGA16) have autocalibration?
    Please advise. :?
  17. willynovi

    willynovi Member

    Joined:
    Feb 13, 2009
    Messages:
    64
    Location:
    Argentina
    Balance:
    354Coins
    Ratings:
    +2 / 0 / -0
    hi tirta, I am not user of Mjoy16, I have built for my own a Microchip version and it´s very similar.
    I don´t use Autocalibration, so you can use DXTweak that do the same thing.
    With DXTweak you can set minimun and maximun values.
    http://www.wingmanteam.com/latest_software/gadgets.htm

    regards, Willy
  18. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
    TronicGr is only a PCB variation for original Mindaugas/LazyCamel firmware, that have autocalibration - good for X and Y axis, but not for throttle.
    My first Mjoys are based in this firmware.

    I use you don't note differences.
    My vote is for Mercury firmwares, that is revision of Mindaugas/LazyCamel and don't have Autocalibration.

    Autocalibration means that every time that you power on you computer, or plug Mjoy in USB, the axis are centered, but you need remember that physically center axis, that is annoy for throttle, trims...

    Using DView or DXTweak2 you made calibration and fine tune your axis.

    Yes, Mjoy16 have autocalibration, and a jumper that allow you disable/enable this feature - Mjoy8 no. Mjoy16 layout that I post above have these jumper.

    I draw another PCB for Mjoy8_Mercury, this time with USB-B connector, angled to fit inside Flighstick base:

    [​IMG]

    Layout: http://drop.io/hidden/n65epzbwjbecu5/as ... 1yYXI%253D

    And, Willynovi Joy.01 USB board is another good option, same features of Mjoy8 and use more modern and fast PIC:

    wn-controller-6-axis-10-bits-36-buttons-with-pic18f2455-t2059.html

    PIC cost little more than ATMEGA (in our local shops), but use another components easy to find.

    Willy, you have tested Joy.01 under Windows 7/64 bits?

    Sokol1
  19. tirta

    tirta Member

    Joined:
    Feb 4, 2010
    Messages:
    56
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hi Sokol1,

    Thanks a lot for all your reply and drawings.
    I really appreciate all of them very much. :thbup:

    I have gone to my local electronic shop today.
    I can not find the PI version of ATMEGA8/16, there is only PU version.
    Is this the same thing?
    I find that ATMEGA16-16PU is around US$3.5, ATMEGA8-16PU US$2.5.
    Since the difference is only one dollar, I think I'd better choose ATMEGA16-16PU,
    just in case I will upgrade my hotas with more buttons in the future. :happy:
    So I am going to use your layout: mjoy16_55x36.lay

    I have questions about the other parts in mindaugas parts list:

    Q1 - Crystal Oscillator
    The store guy does not understand about it, he only has crystal 12MHz H.ELE
    Is this the same thing?

    R1-R8 - Resistor
    They have 1, 1/2., 1/4, 1/8 watts etc
    Which one should I choose?

    Potentiometer
    Do I have to change the original CH pots with 10k pots?

    C1-C6 - Capacitor
    For C1, he has elko, is this polar capacitor?
    For C2 and C3, he has ceramic and monocab and non polar, can I use these? which one?
    Dor C4 and C6, he has ceramic, can I use this?

    L1 - Inductor
    He does not have 10uH, only 5.1, 6.8 and 150uH,
    can I use one of these?
    Do you use it? I can not find it on your layout.

    And after comparing the mindaugas parts to your layout, I find these differences in yours:
    - yours has 8 more resistors: R1-R8=10k
    - yours has no 330 Ohm
    - yours has one 1N4733 in the upper right corner
    - yours has 3 capacitors 15pF
    Are these correct?

    Where is the jumper for autocalibration?

    And what is the red octagonal outline represent?
    Please advise.


    Hi willynovi,

    I am also interested in your Joy.01 USB board,
    please post the english version, if you have translated it.
  20. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Hello tirta,

    Have you looked at the PCB I designed?It is an all-in-one solution that has all the connections on it. If it fits your needs, I have a couple ready to ship out to you in the Marketplace. Also have a fully populated working controller. On the PCB you will find jumpers for Init, Auto Center (CNTR) and Matrix layout (Mode). These are all tested and work fine.

    A 12Mhz crystal is what you need.

    R1-R8 can be 1/4W, I don't think the 1/8W is that much cheaper, so get the 1/4W.

    Pots: the CH pots are probably 10K as well, but you can check. You are ok to use anywhere from 4.7K - 100K. Higher the value, less power it consumes, but picks up noise more, lower the value the cleaner the signal, but they will consume more power.

    C1-C6: You need an electrolytic polarized for the power line (10uF) and ceramic (non polarized) for the 0.1uF filter caps and the 15-20pF for the crystal are also ceramic.

    L1 - you can use the 6.8uH, it is only for noise filtering

    Finally, you are just fine using the original parts Mindaugas has on the board. Thats what my board has, except for the layout and the connectors, and I haven't had any issues.

    The red octagonal outlines are the connections for the matrix keypad, rows and columns. The auto center button is going to be a button on it.