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
    :?
    Try with another mapper, like JoyToKey, Xpadder

    http://xpadder.com/

    Sokol1
  2. GeorgeBoles

    GeorgeBoles Member

    Joined:
    Apr 27, 2009
    Messages:
    66
    Balance:
    4Coins
    Ratings:
    +2 / 1 / -2
    Hello Sokol,

    My goodness, you know a lot of things about software for games!!!! 8)

    Does Xpadder work in Vista or 7?

    I will try those, and if that doesn't work
    I will move a wire or two in my Mjoy to change the buttons assigned to the hats so that the ones I want to repeat keystrokes can be accessed from within the games, i.e. the 32 Windows buttons.

    Regards,
    George.
  3. dnlk21

    dnlk21 New Member

    Joined:
    Dec 7, 2009
    Messages:
    8
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Anyone happen to know of any keymappers that allow for condition statements. For example, if button 10 is pressed, button 11 sends X, else button 11 sends Z.

    I am thinking of wirting a simple Visual Basic program to this, but I don't want to re-invent the wheel if something already exists.
  4. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
    Probable Autohotkey or GlovePie.

    George,

    JoytoKey and Xpadder do what you need whit ZOOM FOV (test in FS9 - SVMapper dont do in this sim too), but I forget to check if both see more than 32 buttons... :blush:

    Edit - Check again, both see only 32 buttons... :thbd:

    Sokol1
  5. erichans

    erichans New Member

    Joined:
    Jan 20, 2008
    Messages:
    55
    Balance:
    6Coins
    Ratings:
    +0 / 0 / -0
    Hello,
    I've been following this post with great interest and have been wondering why no one has used the Mjoy Mapper included with the original publishing of the Mjoy. This is easy to use and displays 112 buttons.

    Here it is along with some Notes:-

    Attached Files:

  6. Sokol1

    Sokol1 Member

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

    SVMapper is a improved version of MjoyMapper, whit support to mapped key on press and release, ie toggle switchs, and add repeat and delay...
    See 112 buttons plus HAT, but fail in certain games function, like George say.

    http://translate.google.com.br/translat ... l=ru&tl=en

    Sokol1
  7. GeorgeBoles

    GeorgeBoles Member

    Joined:
    Apr 27, 2009
    Messages:
    66
    Balance:
    4Coins
    Ratings:
    +2 / 1 / -2
    Condition statements - try Autohotkey

    Dear Dnlk21,
    You will need Autohotkey for something like that. It will work wondefully, but I can't help you with the code. I imagine you will need something like the GetJoyState function.

    Regards,
    George.

    P.S. Thanks for trying to help, Sokol and erichans.
  8. willynovi

    willynovi Member

    Joined:
    Feb 13, 2009
    Messages:
    64
    Location:
    Argentina
    Balance:
    354Coins
    Ratings:
    +2 / 0 / -0
    Hi, I have used SV Mapper for my controller board based on PIC18F2455, not Mjoy16, it is only a button matrix of 81 buttons, and it works fine.

    Regards
  9. NuMcA_[.gr]

    NuMcA_[.gr] New Member

    Joined:
    Jul 12, 2009
    Messages:
    66
    Balance:
    3Coins
    Ratings:
    +0 / 0 / -0
    Is it possible that you can provide us with the source and/or code of the PIC18F2455 controller board?
    Thank you in advance!
  10. crobol

    crobol New Member

    Joined:
    Nov 8, 2009
    Messages:
    10
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    You can find all information of Willynovi controller on this DIY peripherals section, some topics below. :crazy:
  11. NuMcA_[.gr]

    NuMcA_[.gr] New Member

    Joined:
    Jul 12, 2009
    Messages:
    66
    Balance:
    3Coins
    Ratings:
    +0 / 0 / -0
    Thank you!! NOOB me :blush:
  12. GeorgeBoles

    GeorgeBoles Member

    Joined:
    Apr 27, 2009
    Messages:
    66
    Balance:
    4Coins
    Ratings:
    +2 / 1 / -2
    Some Instability Triggered by Unused axes?

    Hello Chaps, again.

    I have a little problem with my Mjoy16.

    Recently I have noticed that my throttle (Z-axis) is suddenly getting reduced to 50% while playing combat flight sims.

    The first 5 axes on my Mjoy are used and appear to work smoothly when looking at the Game Controller applet in Windows XP, as I have indicated earlier in my letters to you all. However, the three unused axes (Z-Ro, Dial and Slider) have a frequent spike to zero (approximately once each 1 - 5 seconds). I have these inputs shorted to ground and they usually site nice and quietly at the 50% mark. I THINK that this spiking on the three unused axes is new.


    What could be the cause? Could it be that when my computer is working really hard (playing a combat flight sim), it doesn't read the axes properly, or that this spiking to zero is tricking the MJoy 16 into sending out incorrect data? I am going to check that the connection of the unused axes to ground is solid, but it should be ... I am using machined IC sockets piggy backed onto one another.

    Any thoughts? Sokol, Frakk, Tronic?

    Regards,
    George
  13. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    That is very strange. Have you noticed this before? If the axis are sitting at 50%, your inputs are not shorted to ground. They should be 0V, which is either 100% or 0% in windows. You said the Z axis is getting reduced to 50%. Is this for the duration of the spike only or is it permanent? Do you have the auto center jumper set?

    If these contacts are properly grounded to the USB and circuit ground, the spikes can come from the USB port, or there is a glitch in the firmware. Do you notice the spikes only when the computer is under heavy load?

    BTW I have some boards and an assembled circuit for sale in the Market Place section if anyone is interested.
  14. NuMcA_[.gr]

    NuMcA_[.gr] New Member

    Joined:
    Jul 12, 2009
    Messages:
    66
    Balance:
    3Coins
    Ratings:
    +0 / 0 / -0
    As Frakk said,
    if you have a shorted-contacts to GND, then you should see either 100% or 0%. To stick in the middle you have to have them shorted with something close to 2.5V, which is kind of..difficult!

    I don't know THAT much about MJOY, but could it be a problem with the calibration done through Windows? Could you check using DIView, and using both RAW DATA and CALIBRATED DATA?
  15. GeorgeBoles

    GeorgeBoles Member

    Joined:
    Apr 27, 2009
    Messages:
    66
    Balance:
    4Coins
    Ratings:
    +2 / 1 / -2
    Hello Frakk and Numca,

    Some excellent information you have given me.

    No, I haven't noticed this unusual behaviour before.

    The unused, shorted axes have sat at 50% from the day I plugged them in. I am pretty certain that the connection is to Gnd though but I will check that. There is a 2.5V reference nearby ... from Aref. See attached picture.

    (The jump in the Z-axis is only a spike, but in my game (CFS3) the throttle stays set at 50% until I move the throttle again: so that is a function of the game only, not my controller.)

    My auto-centre jumper is set, and it apears to keep the rudders nicely centred.

    I thought that the computer load might have been a problem, but I suspect NOW that it relates to time: for the first 15 minutes or so the jumps occur, but after an hour or so, there are no jumps - so perhaps an electrolysis process has happened at the shorting jumpers I have placed. Our environment is Hot and Wet and Salty here in Townsville. My money is on this one.

    I shall also check the raw data with DIView, but if I recall correctly, DIView does not recognize my rudder axis at all - I think it gets tricked by the +512/- 512 data it is fed rather than a 0 - 1024 signal. (This is just out of interest because that axis is not the trouble.)

    Thanks for your help. I will get back to you on my findings.

    Sincerely,
    George

    Attached Files:

  16. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Thats where your problem might be. Try to use 5V reference. The firmware didn't react to changing the reference voltage for me and it is strange to see working with yours. Anyways, set that to 5V, and maybe take the pot out all together.
  17. willynovi

    willynovi Member

    Joined:
    Feb 13, 2009
    Messages:
    64
    Location:
    Argentina
    Balance:
    354Coins
    Ratings:
    +2 / 0 / -0
    another interesting tool to check axis calibration, death zones and limits is DXTweak, I use it but when you have more than 6 axis it doesnt work.

    Check the funtion of the board using DXTweak during several minutes and see if the problems is tha same. If it is the same, so the problem is in the board, if it isnot, the probles is in the game.

    regards
  18. GeorgeBoles

    GeorgeBoles Member

    Joined:
    Apr 27, 2009
    Messages:
    66
    Balance:
    4Coins
    Ratings:
    +2 / 1 / -2
    Thanks Willynovi, but DXTweak ALSO does not recognize the rudder pedal axis, just out of interest ... same problem I think.

    Anyway, just as mysteriously as the problem started, it disappeared. No diagnosis. Everything appears to be stable again.

    Frakk, another reason why the unused axes might have gone to 50% is that the internal voltage reference is 2.56V, so given that is very close to 2.5V, the 50% might just be a coincidence. I agree that the Aref is likely being ignored by the firmware. If I were going to change Aref, I would use the diagram from Mjoy16 and Mjoy(8) and just join the Aref pin to ground via a capacitor. Mindaugas seems to have put a huge amount of effort and care into this wonderful software for us gamers.

    So I will continue in my ignorance and enjoy my MJoy16.

    Regards,
    George.
  19. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Happy to hear George! The internal voltage reference is set at Vcc 5V. If the reference would be 2.56V, you would max out the axis in the middle of the pot turn, meaning: at roughly 50% input you would have 100% output from the controller. Vref signifies tha maximum voltage, the reference for the ADC calculations. An other thing to note that the ADC doesn't calculate negative voltages. The raw data is a number between 0 and 1023 for 10bit resolution, 255 and 511 for 8 and 9bits. What you see in windows is a number already processed and shifted 50% down to give you negative values.

    I agree, this is a very nice little device! I could think of many ways to improve it, but for it's intended use it works flawlessly.
  20. ZXika

    ZXika New Member

    Joined:
    Jan 31, 2010
    Messages:
    7
    Balance:
    - 10Coins
    Ratings:
    +0 / 0 / -0
    Hi guys! I'm Dominik, I'm new on the forum. I have looked at all your schemes and pcb-s. I decided to build mjoy two years ago, and it failed. I built it with atmega8. Now, when I found this forum, I decided to build it again. So I did, but on a testboard. It failed, again. This time I built it with atmega16. My problem is that I PonyProg sends me a message: Device missing or unknown device (-24). It happened after I decided to change Configuration and Security bits. It had normally Read and Wrote before that. Now that message appears all the time. I have read all the post on this topic and I found that that can happen after changing Configuration and Security bits, but I haven't seen an answer, not one that could help me. dnlk21 had the problem with capacitors, but I don't. I bought exactly the ones on Mindaugas' scheme. I use parallel programmer, so I tried to connect Parallel port pin 1 (it's always in 1). It worked with it (until I changed Comnfiguration and security bits). So now I tried to bring power source from USB. Doesn't work either. I even tried the external source (the one that powers hard discs, but 5V one), but I saw a smoke on my testboard. It was on the side where only 2k2 and 4k7 resistors, electrolitic capacitor and zener diodes were. So I replaced zeners and electrolite. I don't know what next. Ponyprog still sends the same message. Please, help me. I need it.
    Thank you in forward.
    Dominik