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

    Sokol1 Member

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

    MMASailor20 New Member

    Joined:
    Feb 8, 2010
    Messages:
    8
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Thank you very much Sokol1...you've been a great help!
  3. MMASailor20

    MMASailor20 New Member

    Joined:
    Feb 8, 2010
    Messages:
    8
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    sorry one more question...I'm thinking of building Frakk's all-in-one which is different than the all in one on the sister page of the encoders. How would I go about attaching the MJOY-Encoders to Frakk's MJoy16-C1 All-In-One board since there are 48 pins per group...and there are 32 on the encoder board? Would I just attach it to Row 1/2?
  4. Sokol1

    Sokol1 Member

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

    As I understood, Mjoy-Encoders send key press to Mjoy16 (or another controller card).

    The 32 pin plug To Mjoy handle outputs from 8 encoders:
    one button if turn encoder clockwise, other button if turn anti-clockwise, or 2 buttons for encoder. These 16 buttons need two wires for each button, so you need 32 pins.

    Mjoy-Encoders need to be connect into Mjoy Keymatrix, not into Mjoy16 Row and Columns.

    So, use - for example - pins 48 to 64 in Mjoy16 Keymatrix to connect cable from Mjoy-Encoders.

    Sokol1
  5. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    If you need the PCB, I have them for sale in the Marketplace section. High quality FR4/70um copper, immersion tinned contacts, soldermask + silk.
  6. tirta

    tirta Member

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

    IT WORKS! :yippiee:
    Finally, my mjoy16 works.

    After one week in confusion and not sure what to do,
    and after examining all the components and I find nothing wrong with all of them,
    finally, today I find the culprit:
    I made a very silly mistake when programming mjoy16 using ponyprog.
    I did everything right except the last step: :blush:
    Security and Configuration bits
    On this window after selecting everything according to the instructions: BOOTSZ1, BOOTSZ0 and SUT0.
    Then I pressed OK. :brows:
    This was wrong.
    I should press Write :lol:

    So, now my computer can detect mjoy16 with no trouble at all. :D

    Thanks to all of you. :thbup:
    This is a very satisfying project to do. :cheers:

    Now I am going to do the next step: connecting all the wires to my old hotas.
    Wish me luck. :hi:
  7. Sokol1

    Sokol1 Member

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

    Good news! Congratulations.
    :cheers:

    Wiring is easy, make some scheme first do avoid mistakes.
    Wire few butons and test, if is OK, continue.

    If have any doubt in this part post in SimHQ.

    Good luck.

    Sokol1
  8. tirta

    tirta Member

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

    What is the best program to program the buttons for mjoy16?
    Could you give me the link?
  9. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Glad to hear you got it working. 95% of the time errors are very small, something you just overlook and never think about them as being a problem.
    I use the Mjoy Mapper but I'm sure Sokol will suggest better programs for you.
  10. Sokol1

    Sokol1 Member

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

    SVmapper is good and easy to use option - in spite of his very simple GUI - is improved version of Mjoy Mapper, with new features like Mapped Key on Press and Mapped Key on release, so if you use one toggle switch for landing gear (for example), when move switch lever up, SVMapper send G, and when you move switch lever down, SVMapper send G again. Other improvements are repeat, delay and continuous functions. Note: work only with buttons (all 112), not axis.

    Anothers: JoyToKey limited to 32 buttons (Windows limitation), allow to use axis as buttons.

    To program axis, buttons... AutoHotkey, but a bit hard to understand and make scripts.

    If you play IL-2 see the nice work of MikkOwl with Autohotkey: functional multi-throttle support.
    http://forum.1cpublishing.eu/showthread.php?t=12668

    SVMapper= http://www.thommos.com/downloads/contro ... 0.0.59.rar
    JoyTokey= http://www.electracode.com/4/joy2key/Jo ... ersion.htm
    Autohotkey= http://www.autohotkey.com/

    Sokol1
  11. tirta

    tirta Member

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

    Thanks for the reply and links.
    I am going to check those links now. :D :D
  12. willynovi

    willynovi Member

    Joined:
    Feb 13, 2009
    Messages:
    64
    Location:
    Argentina
    Balance:
    354Coins
    Ratings:
    +2 / 0 / -0
    SV Mapper is the best I know, and it works fine.
    Try it,
    regards
  13. tirta

    tirta Member

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

    Some of the old CH potentiometers are not smooth and have spikes.
    Can you tell me how to clean them?
  14. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    You can try contact spray, but it will be hard to get on the resistor/wiper part. You can buy these in audio stores (commonly used for connector cleaning) or other electronic shops. Other way to fix it is to solder a 0.1uF capacitor across the ADC input and GND.
  15. Sokol1

    Sokol1 Member

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

    Disassemble entire pot and careful wash, using a brush, with isopropyl alcohol, or use some contact spray. CH pot is easy to disassemble, just lift the loops of pot case.

    [​IMG]

    And don't forget use shield cables to plug pots into Mjoy16, and ground (Signal+GND) unused axis.
    And make Windows calibration process, after this spikes decrease.

    Sokol1
  16. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
    Frakk, this Mjoy16 layout - from AviaForum - have additional 1000uF capacitor in +5VAVCC and 0,1uF capacitors between Signal and GND.

    [​IMG]

    Sokol1
  17. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Then a good cleaning will do the trick. You can even replace the pots too.
  18. tirta

    tirta Member

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

    Thanks for the reply and the tip. :thbup:
    How about cleaning the 4 way hat switch?
    I find some of the switch does not work properly,
    sometimes when I push the switch, I have contact, sometimes I do not.

    Is it dirty?
    Is it possible to clean this?
  19. Sokol1

    Sokol1 Member

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

    Probable the plastic pole that press micro-switch tactil in POV HAT wear a bit.
    Put some thin plastic sheet under switch, to raise this a bit, sometimes help.
    Or replace the micro-switch. Is like this:

    [​IMG]

    You probable need to make this small MOD: round hole to turn 4 way HAT in 8 way. Easy.

    http://snomhf.exofire.net/8-WayHat.html

    Edit - Dnt use power drill like in article - unless you are very skillful with this - the chance
    the chance to mess things is high. Adjust hole for HAT manually, is easy.

    Sokol1
  20. tirta

    tirta Member

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

    Thanks for the suggestion. :thbup:
    I will try to put the thin plastic.

    This is a very good idea.
    But I find it a litttle unclear, does he only make the hole bigger?
    or you alter the shape by rotating it 45 degrees?

    Can I convert every 4-way hat into 8-way including the HAT switches on the pro throttle?
    Can mjoy use the 8-way HAT?