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. Fransky

    Fransky New Member

    Joined:
    Sep 30, 2010
    Messages:
    11
    Occupation:
    Stay-At-Home Parent / Plumber / Sith Lord
    Location:
    Toronto
    Balance:
    320Coins
    Ratings:
    +0 / 0 / -0
    Sokol, could you please upload the .lay file for the Tirta board? Drop.io took a sh!t and dragged all the uploads with it. Thanks
  2. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
    Since I dont have this .LAY anymore, I draw another similar.
    Tirta need a .LAY with small height possible, to fit inside CH Flightstick base.
    This one is a bit more height (+5mm) = 40mm. If need something different, let my know.
    Remove ground pin near to Reset pin - to fit 0,1uF ceramic capacitor more close to
    ATMEGA pin 11. To program use one ground pin for axis.

    [​IMG]
    Since Inductor is placed under ATMEGA only cylindrical type is suitable. Dont fit to square types.

    Files (LAY, PDF, JPEG): https://www.yousendit.com/download/UnlE ... NVZFQlE9PQ
    (Link expire Jun 23, 2011).

    Tip from Russian guys: If possible use SMD for ceramic capacitor (PCB allow both type).

    Sokol1
  3. GeorgeBoles

    GeorgeBoles Member

    Joined:
    Apr 27, 2009
    Messages:
    66
    Balance:
    4Coins
    Ratings:
    +2 / 1 / -2
    And just as importantly for me, JoyJoy (MJoy's joystick mixer and renaming tool) ALSO works with Win7/64 - so says Deon who wrote it all. (I cannot remember whether I have checked this completely, but I think I did.) So Red Baron continues to fly.

    Regards,
    George
  4. Fransky

    Fransky New Member

    Joined:
    Sep 30, 2010
    Messages:
    11
    Occupation:
    Stay-At-Home Parent / Plumber / Sith Lord
    Location:
    Toronto
    Balance:
    320Coins
    Ratings:
    +0 / 0 / -0
  5. flagoss

    flagoss New Member

    Joined:
    Jul 4, 2011
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hello everyone ! I have a small problem...I can't get my mjoy interface to work on Windows 7 64bits !!
    I have build 3 different boards and they all work well on windows XP and windows 7 32bits. I try the original version 1 mindaugas version, the mercury wheel+2pedals and another one I don't remember the version.

    The only thing I cauld say is that the Mindaugas V1.2 firmware with autocalibration will work but the game controller disapear from windows after around 30seconds ! I have no problem with version 1.1.

    So is Mjoy interface compatible with win 7 64bits ??
  6. Sokol1

    Sokol1 Member

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

    For my Mjoy's work fine under Win7/64 bits:

    [​IMG]

    At moment I have two Mjoys of the plugged in my computer.

    MRUS inside a old CH (ex-gameport) Combatstick + HALL sensor in X, Y axis.
    MFly inside a Hitec Laser 4 R/C transmiter (remove defective original FM circuit).

    First with Mindaguas/LazyCamel firmware (.1 I think), without autocalibration.
    Second with Mercury firmware, without autocalibration.

    Another two Mjoy16 work fine, too.

    Sokol1
  7. flagoss

    flagoss New Member

    Joined:
    Jul 4, 2011
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Well thanks for the input ! Do you know what could probably cause my mjoy to work on anything exept win 7 64bits ?

    I just finished building another mjoy but on a proto board this time and same problem happen !

    Do you think that the zenner diode could cause it not to be detected by win 7 ?? I might not have the same model !
  8. tirta

    tirta Member

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

    Sokol1 Member

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

    What Servio did with Mjoy8 is investigate the cause of trembles in axis when
    using HALL sensor. (With Mjoy8 Mindaugas/Lazy Camel firmware I confirm this effect, noticeable in DView or DXTweeak2, but no negative effect in game - IL-2).

    Looking in ATMEL books his found that power source for analog (axis) and digital (buttons) inputs need different sources to minimize this tremble effect in axis.

    [​IMG]

    So he adapt the Mjoy8 electrical scheme according, and report a good results. Basically:

    - Use voltage regulators to supply +5V to axis and buttons and additional capacitors.
    - Use SMD ceramic capacitors - legs in conventional ones can pick noise - fit the closed possible of ATMEGA pins.
    - Use a double layer PCB whit some area (the blue in layout) grounded to pin AGND of ATMEGA. Notice that pins 26-30 and axis pins pass trough this area without contact.
    - Use 10k pull-up resistor in rows and reset pin (similar to Mercury version).

    Components for Mjoy8 and Mjoy16 are the same, so I think these modifications are valid for the last version too.

    Since Mjoy16 is a abandoned project by Mindaguas (no longer support this) with no source code available, no improvements are made in this since 2004.

    But still valid, is simple, easy to build, and use cheaps components.

    Actually the Russian guys have project of new controller based in ATMEGA (88 and 90USB) the JoyCtrl F2/L2 that combine some boards with IN and OUT (ie. display) functions.

    http://www.sukhoi.ru/forum/attachment.p ... 1283694094

    Based in ATMEGA88, use USB 2.0 bus (Mjoy8/16 use USB 1.1)
    Capable of handle up to ~41 axis and up to ~440 buttons - if used add cards.

    Actually English documentation is available - maybe in future, but layouts for PCB, firmwares and part list is available here:

    http://www.sukhoi.ru/forum/showthread.php?t=64206

    Another know DIY option is Controladora Joy.01 (see topic in this board) based in Microchip PIC, too USB 2.0.

    Sokol1
  10. tirta

    tirta Member

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

    Thanks for the reply. 8)

    Wow, however your explanation is too complex for noob like me.
    please let me know the type and specs for these components:
    - voltage regulators, what kind?
    - SMD ceramic capacitors, what is SMD? :eek:

    if you have picture of the components, that would be great.
    Also. pictures of the finished PCB.
    I am confused about this double layer PCB, how do you do it? :?
  11. chandran

    chandran New Member

    Joined:
    Jul 18, 2009
    Messages:
    4
    Balance:
    364Coins
    Ratings:
    +0 / 0 / -0
    Can someone help me with this picture and if possibles the files

    Hi Sokol1 you are he light at end of tunnel

    Attached Files:

    • 11.gif
      11.gif
      File size:
      236.2 KB
      Views:
      1,778
  12. Fransky

    Fransky New Member

    Joined:
    Sep 30, 2010
    Messages:
    11
    Occupation:
    Stay-At-Home Parent / Plumber / Sith Lord
    Location:
    Toronto
    Balance:
    320Coins
    Ratings:
    +0 / 0 / -0
    [​IMG]

    Hey Sokol1

    This is a clock generator. It simply sends a square wave to whatever target you want. I built the LED one right now using R1=100 Ohms R2=470 Ohms and C1=.1uF. That SHOULD give me 1Mhz. (Close enough apparently) I'll take it to an oscilloscope tomorrow to check it. Anyway, I gather that if I replace the LED with XTal1, it should reset my AVR. I'll let you know how it goes.

    Tirta: SMD = surface mount device. They are the tiny parts (smaller than rice) that you see on motherboards etc.
  13. Sokol1

    Sokol1 Member

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

    Look in Servio Mjoy8 tread here:

    [​IMG]
    http://avia-sim.ru/forum/viewtopic.php?t=606&start=105

    Notice under axis pins a cooper foil - this is the second layer of PCB -m a dual layer board.

    Get this files:
    http://avia-sim.ru/forum/download.php?id=3019
    In these you find the electric scheme for Mjoy8-Servio and part list.
    He use one these voltage regulator: LM2931AD2T-5.0G, LP2950ACDT-5.0G, LP2950AC2-5.0G, LM3480-5.0.

    But, instead build a new Mjoy why not try build a PIC based controller like Joy.01, since they have native USB 2.0 support and work at higher frequency?
    If you find PIC for good price (in my local marked PIC cost less than 2 U$ more than ATMEGA), his PCB require less components than Mjoy.

    Chandran

    This anti-K.I.S.S PCB is a integrated version of Mjoy16 + Mjoy Encoders - a board that allow add more 8 encoders in Mjoy16. Besides this picture of PCB layout I dont see more files for this version.

    Encoders board for Mjoy16 was developed by Polish guys, they provide files to build Encoders controller in ad-on form, look here:
    http://sites.google.com/site/mjoy16/root/

    Sokol1
  14. tirta

    tirta Member

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

    thanks for all the links. :thbup:
    I guess now I have to read and learn more about it.
    However, I still do not get it, how about the lay file of the second layer?
    I do not see the pattern, is it blank?

    I have just checked today about the price of PIC18F2550.
    At my local store, it cost more than twice of ATMEGA16.
    And PIC based Joy.01 has less buttons and still the same 10bit.
    Why do think it is better than mjoy16?

    You wrote:
    How this matter in the game? :?
    Please explain.
  15. Sokol1

    Sokol1 Member

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

    Look at this Joy.01 (Noalone version):

    [​IMG]

    Notice that component side of board have cooper areas, and see the resistor near
    LED welded in this cooper. Why?

    Because this board use dual (double) side PCB - these have cooper in both sides.

    In this case upper side (components) are all GND. Under side is all +5V.
    This turn the board more resistant do parasite noise (the tremble in axis).

    Mjoy8-Servio is build in the same principle, with cooper area in component side
    under axis connections.

    The downside of this that is a bit more harder to DIY make this board type.

    About ATMEGA8/16 (1) versus PIC:

    PIC have native hardware support to USB 2.0 ATMEGA 8 or 16 dont have native support to USB at all. Back in 2002/3 a guy called Igor Cesko implement software support for USB 1.1 in these micro controller, this allow Mindaugas develop Mjoy's (~2004).

    This software solution limit the response time of Mjoys - more axis and buttons you use, more slow they work. Sometimes 30 MHZ, when PIC work at 200 MHZ.

    Notice that every with this limitation Mjoys are better than some controller used in cheap joysticks.

    See Servio explanation about this here:

    http://translate.google.com.br/translat ... start%3D75

    In some uses, like button box, trim devices... this is not important.
    But if you control axis for racing steering wheel or joystick used in combat sim (IL-2, RoF...) its turn more noticeable.

    The case is, actually are a freeware DIY PIC projects (like Joy.01) and PIC prices drop -in my case almost the same of ATMEGA - and PIC boards dont use components difficult to find (for me) like 10uH inductor, and use few others.

    (1) Others ATMEGA microcontroller have USB 2.0 support.

    If get PIC is not cost effective, still with Mjoys - and if possible implement Servio modifications.

    Sokol1
  16. Fransky

    Fransky New Member

    Joined:
    Sep 30, 2010
    Messages:
    11
    Occupation:
    Stay-At-Home Parent / Plumber / Sith Lord
    Location:
    Toronto
    Balance:
    320Coins
    Ratings:
    +0 / 0 / -0
    Don't the DIY PICs require a hardware programmer to burn the bootloader? In Circuit Programming only works after that is done.
  17. tirta

    tirta Member

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

    I think you miss the picture here:
    so if you connect a component through it, will it burn the IC since the +5V is connected to GND?

    in other words, PIC based Joy.01 responds faster than mjoy?


    And Sokol1 how do you rename mjoy to mrus?
    I tried like in the manual:
    -edit the hex at 0400
    -then write (flash)
    however, I can not change the name,

    And when I plug in under win7/64, I got this:
    8 axis controller
    in xp, it is: MJ16

    what is wrong here?
  18. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
  19. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
    Oops! Is this picture: http://s2.postimage.org/me5qdn8b/DSCN5346.jpg

    No, when use double face PCB only correctly pins is connect with ground or +5V side - accord need.
    Other pins pass thought, without contact.

    Yes. :yes:

    In Mjoy16 is easy, open firmware with PonyProg, and in bit 04000 enter the new name (observe 4 characters limit), but in hexadecimal values.

    Originally MJ16 is - in hexadecimal:

    4D = M
    4A = J
    31 = 1
    36 = 6

    [​IMG]

    Pic characters for new name here:
    http://www.ascii.cl/htmlcodes.htm

    In Mjoy8 is a bit more complicated, you need change in .ASM file - just type the new name, ie. MRUD - and then recompile new .HEX file whit AVR Studio - if I remember correctly.

    I dont know how (write) programs or hexadecimal language, but with help of Google I am able to do these changes.

    Accord this guy - dont remember name - is possible overcome the 4 characters limit for name - for Mjoy8:

    Sometimes this happen, but dont have adverse effect.

    Open Regedit, find 8 axis name and change for MJ16:

    HKEY_LOCAL_MACHINE \ SYSTEM \ ControlSet001 \ Control \ MediaProperties \ PrivateProperties \ Joystick \ OEM

    Sokol1
  20. flagoss

    flagoss New Member

    Joined:
    Jul 4, 2011
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hey I worked on one of my mjoy yesterday. Since I don't have any zenner diode, I redid the usb part of my board with a shematic from v-usb that use two 1n4148 diodes in series on the 5volt...on D- it use a 1.5k omh and on d+ 1M omh. The funny part is that now it stopped working on my windows xp but it now worked on all my windows 7 64bits.

    It's weird !!