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
    Yes, I'm aware of that. That is one of the reasons I paired up the columns. This way it is easy to make 2x2 or 1x4 sockets to connect adjacent inputs.

    Adam
  2. Senetor

    Senetor Member

    Joined:
    Oct 23, 2008
    Messages:
    90
    Location:
    Australia
    Balance:
    594Coins
    Ratings:
    +1 / 0 / -0
  3. GeorgeBoles

    GeorgeBoles Member

    Joined:
    Apr 27, 2009
    Messages:
    66
    Balance:
    4Coins
    Ratings:
    +2 / 1 / -2
    Good Evening Folks,

    I have just started drawing Frakk's and Senetor's board onto Circad 98 (the program I use to draw and print circuit boards). I have been going to make the MJoy16 for a long time and I only just starting drawing it as Mindaugas did in the original work.

    Some questions:

    1. What trace width do you recommend for the connections between the 26 pin jumper and the Atmega chip? I use Toner Transfer to burn my circuit boards and Mindaugas looks like he used 0.5mm traces which do not turn out too well with that process.

    2. Have you drawn up a table of button presses for the Matrix board yet?

    3. I hope that an Atmega16-16PU will work, even though the original code was for Atmega16-16PI which I cannot find.

    4. Is there anything new in the .hex file which I saw earlier, or is it there to help someone else out?
    5. Don't you also need a .eex file too, like Mindaugas originally published?

    Please continue this good work. The MJoy 16 looks really useful.

    Regards,
    George.
    (Australia)
  4. Senetor

    Senetor Member

    Joined:
    Oct 23, 2008
    Messages:
    90
    Location:
    Australia
    Balance:
    594Coins
    Ratings:
    +1 / 0 / -0
  5. GeorgeBoles

    GeorgeBoles Member

    Joined:
    Apr 27, 2009
    Messages:
    66
    Balance:
    4Coins
    Ratings:
    +2 / 1 / -2
    An error in the parts list

    Evening All, and to Aussie Senetor.

    One little thing I have noticed: in the original schematic diagram the zeners are listed as 3.3V, but in the Parts List, they are listed as 1N4733, which the Fairchild document states is a 5.1V Zener. The listed operating voltage for the Atmel is 2.7 to 5.5 volts.

    Which should I use? Does a higher voltage improve noise rejection? Does the higher voltage strain my USB ports?

    I might get time to do a little more circuit board drawing tomorrow.

    Regards,
    George.
  6. Senetor

    Senetor Member

    Joined:
    Oct 23, 2008
    Messages:
    90
    Location:
    Australia
    Balance:
    594Coins
    Ratings:
    +1 / 0 / -0
    Hi GeorgeBoles,
    In the Parts list the description is listed as IN4733A but he lists the value as 3.3 volts.
    In the Circuit diagram they are marked as 3.3 volts, so I think he wrote the wrong part number,( IN4733 ).

    Regards Senetor.
  7. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Great job Senator. Now my only concern with the layout is the supply pins on the matrix board. My recommendation is to make the two boards the same size, make room on the smaller for the Vcc and Gnd pins to be utilized comfortably.
  8. Senetor

    Senetor Member

    Joined:
    Oct 23, 2008
    Messages:
    90
    Location:
    Australia
    Balance:
    594Coins
    Ratings:
    +1 / 0 / -0
    Hi Frakk,
    I don't see the need for Vcc and Gnd pins if using this layout.

    MJoy16c1.pdf


    Regards Senetor.
  9. GeorgeBoles

    GeorgeBoles Member

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

    Could you please explain the purpose of the variable resistor and what is the AMC that you are all referring to please?

    I am a compulsive checker and have just completed a mapping of Mindaugas original boards and the one suggested by Senetor and Frakk. Guess what? The one from you blokes makes more sense!

    I am going to build this soon. I have to work out physically how to fit it into or adjacent to my old CH joystick and pro throttle (the non USB versions which I have to modify to USB... hence my fiddling around.)

    I cannot understand why this little device isn't the talk of the simulation community! (If it works, that is.)

    Has anyone got the MJoy 16 up and going anywhere?
    Where did Mindaugas go?


    Regards,
    George.

    Edit 20 Aug 2009: I have put in my most recent mapping spreadsheet, the first page is the one which applies to the Ch F16 FighterStick. You will see some other options and thoughts on other pages, all of which are completely unchecked. The most useful would be for the CH Janes Combat Stick which has two fewer hats ... but even that is not finalized.

    Mapping attached

    Attached Files:

  10. Senetor

    Senetor Member

    Joined:
    Oct 23, 2008
    Messages:
    90
    Location:
    Australia
    Balance:
    594Coins
    Ratings:
    +1 / 0 / -0
    Hi GeorgeBoles,

    The AMC is Tronic's AVR Motion Controller
    tronic-s-amc-motor-motion-controller-with-pwm-servo-output-t559.html

    There are two MJoy Projects, One which uses the ATMega8-16PU and the other the ATMega16-16PU Microcontrollers.
    They have both been named the MJoy16 , which is not correct as one uses the ATMega8 , and I think this is confusing some people.

    Regards Senetor.
  11. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Senator, if we're using the original layout we dont need the supply pins. I just thought it would be a nice feature for additional things like switches with leds or additional parts on a dashboard.

    George, the variable pot besides the analog inputs is for the analog reference voltage adjustment. In the original design Vcc or 5V is the only reference which limits the inputs. With this adjustment you can turn a 270deg pot into 90deg or whatever you need, without loosing resolution.
  12. Senetor

    Senetor Member

    Joined:
    Oct 23, 2008
    Messages:
    90
    Location:
    Australia
    Balance:
    594Coins
    Ratings:
    +1 / 0 / -0
    Frakk,
    the MJoy16 gets it's power from the USB port on the computer, and can only supply between 100 to 500 milliamps, depending on the port, so it is not a good idea to power LED's and extra switches from it. You are better to supply your extra devices from another power source that can handle the extra load.

    Regards Senetor.
  13. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    500mA is still enough for a lot of applications. I agree that a lot of ppl wont really need it and an external supply is a better choice. Time and testing in simulators will tell if it is really needed or not. Others please add your opinion too.
  14. Senetor

    Senetor Member

    Joined:
    Oct 23, 2008
    Messages:
    90
    Location:
    Australia
    Balance:
    594Coins
    Ratings:
    +1 / 0 / -0
    All in One, measures 143mm x 86mm.

    All in One.GIF

    Regards Senetor.
  15. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Looking good! Now its time to build and test it! I will be getting the parts soon to hook it up on a protoboard, hopefully I can make the board too.
  16. GeorgeBoles

    GeorgeBoles Member

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

    I have not quite got my head around the diodes and matrix thing. I am just trusting everyone's advice.

    I have been busy designing my version of the project. I am going to have to use mainly hard-wiring of the switches in my old CH Joystick and throttle (otherwise there will be too many wires between the joystick and the throttle), but I will have the option of a smaller matrix for later additions.

    My question:

    On the matrix diagram it appears that the diodes only go on the columns, with the anode of the

    diode facing the column and cathode facing the switch. In other words the diode comes on the postive

    side of the switch, like this:

    Column --- (+Diode-) ------- Switch ------ Row (As in Mindaugas' original diagram)


    Does it matter if I put the diode on the negative side of the switch does it, as long as the diodes

    are still anode to Column and Cathode to Row? Or like this:

    Column --- Switch------- (+Diode-) ------ Row


    Would this option work, or would I get phantom button presses coming up?

    All advice greatfully appreciated,

    Regards,
    George
  17. Frakk

    Frakk Active Member

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

    The position of the diodes doesn't matter, only the polarity. The matrix key system is basically a scanning operation. The IC progressively outputs a voltage (high) on the columns, and scans on the row's for any high input. If a voltage input is detected, it records the column that the output was high on, and the row that the input came in at that particular moment. These two numbers define the exact switch that was pressed and this data will be sent to the pc. The diodes will prevent any reversed voltage and current, and also introduce a .7V forward drop to block any noise and interference under this voltage.
  18. Senetor

    Senetor Member

    Joined:
    Oct 23, 2008
    Messages:
    90
    Location:
    Australia
    Balance:
    594Coins
    Ratings:
    +1 / 0 / -0
    Here's a couple of diagrams,
    Pins.jpg
    Matrix Switches.jpg

    Regards Senetor.
  19. Senetor

    Senetor Member

    Joined:
    Oct 23, 2008
    Messages:
    90
    Location:
    Australia
    Balance:
    594Coins
    Ratings:
    +1 / 0 / -0
  20. GeorgeBoles

    GeorgeBoles Member

    Joined:
    Apr 27, 2009
    Messages:
    66
    Balance:
    4Coins
    Ratings:
    +2 / 1 / -2
    A PCB design to put MJoy in CH ProThrottle

    Hi Folks,

    This is my project as attached. The board sits within my CH Pro Throttle base. The top 15 pin Dsub takes information from my CH F-16 Fighterstick, the lower one takes information from my rudder pedals and up to 25 other buttons (none of which I have) and the other connectors take the information from the Throttle itself. I think the wiring is correct, but if anyone would like to check it I would appreciate it. (I have yet to join the Ground wire to the USB pins. I also have to put in jumpers to cope with Centre, Mode, and and On/Off button - the last one so that I do not have to connect/disconnect the USB port to work the initialize and re-centre functions.)

    I am going to have little flying jumpers (made from ribbon cable) for many of the connections from the 15 pin Dsub connections, especially if I stay with a single sided board.

    As for the diodes, you are saying that they are just to help eliminate little spikes as buttons are pressed and released? That would make sense, because otherwise I could see no logical reason that we should need them. (Edit: see later posts. The diodes and some hidden 10k resistors are very important)

    Regards,
    George.

    Attached Files: