1. 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!
  2. 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
  3. 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. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi everyone,

    I wanted to present you an older project I was playing with.

    An AVR USB Joystick! It has 6 axis that you can add potetiometers and 24 buttons, enouph to create a small aircraft panel. Its axis assignments are as follow: X, Y, Rudder, Throttle, Z, Rx

    AVR_USB_Joystick_photo.gif
    AVR_USB_Joystick_button_matrix_photo.gif

    Mjoy_AVR_USB_Joystick.pdf

    Although its designed to work with flight sim vehicles, you can attach those axis to a car sim controls to have a complete set: Wheel, full set of pedals, including clutch, even an analog handbrake if you like! And if you already have a force feedback wheel you can just make the rest of the controls custom.

    I designed the PCB layout for this joystick along with a second smaller PCB that has the button matrix connections for the 24 buttons. The button matrix PCB can be mounted on top of the main PCB for saving space. You can use simple wires to connect the two boards as their ports are numbered!

    I was made prototype PCB based on it last year that I was intended to use to add custom flight simulator controls to my Joyrider but lack of time let me add it only on the rudders.

    Mjoy_top.jpg

    Mjoy_bottom1.jpg

    Thrust_controls.jpg

    Rudders1.jpg

    Rudders2.jpg


    I didin't programmed it, its programmed by Mindaugas Milasauskas, before some years now but he seems to be dissappeared along with his site.

    Another variation of this (SMT compoments) exists here:
    http://www.mictronics.de/?page=avr_usb_joystick


    Here is the Firmware for the ATMega8 chip that you can program it with PonyProg using the ISP serial port of my AVR Motion controller! To power it while programming, just plug it on a USB port!

    mjoy1_2.zip

    Atmega8_ponyprog_configuration_bits.gif

    If you like to have the source code in assembly to see how it works or modify it, contact me PM.


    Regards, Thanos
  2. Ads Master

    Ads Master

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
  3. RaceRay

    RaceRay Administrator Staff Member SimAxe Beta Tester

    Joined:
    Nov 8, 2006
    Messages:
    4,651
    Occupation:
    Self-employed | Web and application development
    Location:
    Hamburg, Germany
    Balance:
    24,954Coins
    Ratings:
    +1,642 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Hi Thanos,

    thank you very much for publishing another great project.
    I appreciate it that you publish the url of our community on the pcb´s :bia:

    Now, with 24 buttons every switch of a real car can be integrate in our simulators, e.g whippers, lights, engine start and so on...

    It´s only missing support for some driver to control real aircores ;-)

    regards
    René
  4. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Thank you,

    A more advanced is to come soon, with 8axis 64buttons rotary encoders and double-throw switches!! This is going directly to a full working 747 cockpit panel!! :)

    The downside is that its PCB will be three times bigger! ;-)

    The Aircores desides the current driver need interface out of the computer simular to the AVR motion controller to work!

    Regards, Thanos
  5. RobiD

    RobiD New Member

    Joined:
    May 13, 2008
    Messages:
    18
    Location:
    Australia
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hi Thanos,

    I keep finding your posts all over the place and they are always things I am interested in.

    Do you still use this MJoy controller?
    Have you advanced it any further?

    I'm considering building it so any feedback would be appreciated.
    (I haven't started building the motion boards yet and I noticed that you are about to update it soon so I will hold off on that a little longer).

    Regards
    David
  6. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi RobiD,

    Yes, I still use this Mjoy16 controller! Its awesome device to have analog an digital inputs from it and you can use it to create your own custom made joystick controller device! I used it on my pedals (shown above) but it can be used also to make wheel and stick yoke and any other kind of controller yourself! Or to make a cockpit panel with buttons and radio controls!

    Anyway, imagination is the limit to the uses of it. I'd recommend you, to use this, as it's more that enough for most applications!

    I intent to present here a more sophisticated version of it that has even larger number of analog inputs / buttons / rotary encoders / dual throw switches etc. But I have to draw a PCB board for it first and develop it for a quick test.

    I hate when I have so many projects to make an no free time to proceed on them... I wish I had a little help on the PCB design / PCB assembly area and have only to work with the firmware of my electronics... :(


    Regards, Thanos
  7. RobiD

    RobiD New Member

    Joined:
    May 13, 2008
    Messages:
    18
    Location:
    Australia
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hi Thanos,

    I'd love to be able to offer help in pcb design, but my previous attempts have been quite futile.

    Thanks again for your great contributions to the flight sim community.

    Oh, I am using FSBus NG for most of my switches but was interested in the MJoy for the yoke and pedals and maybe the throttle quadrant, speed brake etc. But of course the extra buttons will be handy.

    Regards
    David
  8. RobiD

    RobiD New Member

    Joined:
    May 13, 2008
    Messages:
    18
    Location:
    Australia
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hi Thanos,

    How is the new design going?

    Regards
    David
  9. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi David,

    Here is the schematic of the new advanced Mjoy16 (C-1 application):

    MJoy16c1.pdf

    As you can see its very complicate one to design into a single sided PCB... So be patience!

    Best Regards, Thanos
  10. RobiD

    RobiD New Member

    Joined:
    May 13, 2008
    Messages:
    18
    Location:
    Australia
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Thanks Thanos.

    I have to build the rudder pedals yet so it's no mad hurry for the MJoy interface. As soon as it's ready though, I'll be building it.

    Regards
    David
  11. Mambo

    Mambo New Member

    Joined:
    Aug 5, 2008
    Messages:
    168
    Location:
    Czech Republic
    Balance:
    250Coins
    Ratings:
    +1 / 0 / -0
    Hi
    I build two pieces of yours Mjoy but i cant program them :( . I use guide from here http://www.powernet.pl/~krzysiek/elektr ... mjoy16.htm (i try setup Atmega8 and 16) but i get same message if i try read flash : device missing or not found (-24) (on both). I check all routes to atmega and lpt cable.LPT port working (i have 7seg. and speedometer on it and they react). I not sure only with crystal i used http://www.gme.cz/cz/index.php?page=pro ... il=131-074 . Have you any idea what could be wrong ?
    Thanks
  12. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi Mambo,

    LPT cable is not very reliable way. Never worked for me!

    You have to plug the device in a USB port to feed it with +5v power before using the onboard ISP port!!! Then you can use a simple serial programmer circuit from ponyprog or something like this:

    http://cgi.ebay.co.uk/Mini-ATMEL-AVR-AV ... .m14.l1318

    It can be also programmed by using the onboard ISP programmer circuit from my AMC1.5!!!! ;)

    Regards, Thanos
  13. Mambo

    Mambo New Member

    Joined:
    Aug 5, 2008
    Messages:
    168
    Location:
    Czech Republic
    Balance:
    250Coins
    Ratings:
    +1 / 0 / -0
    So I need bulid this from AMC1.5

    Attached Files:

  14. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi Mambo

    Yes, this one! Its easy to even make it on a protoboard...

    Regards, Thanos
  15. Mambo

    Mambo New Member

    Joined:
    Aug 5, 2008
    Messages:
    168
    Location:
    Czech Republic
    Balance:
    250Coins
    Ratings:
    +1 / 0 / -0
    Well now i know why it dont work with LPT :yes: , you have switch MOSI and MISO on page 8. Now i program it but after i plugin to USB it found unknown device :( Shout be potenciometrs connect ?
  16. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    No potentiometers are needed for the first connection... But it seems to me that you haven't programmed the Fusebits in order to work with the 12Mhz clock that is needed for the USB communication.

    Thanos
  17. Mambo

    Mambo New Member

    Joined:
    Aug 5, 2008
    Messages:
    168
    Location:
    Czech Republic
    Balance:
    250Coins
    Ratings:
    +1 / 0 / -0
    So some progress, i found that on my old pc it works, on new one unknown device
    old pc: xp SP2 without updates, never connect another USB device, USB 1
    new pc: xp sp2 with updates, before mjoy there was conncet DFP and log. force 3D, USB 2
    Fusebits are programed well.
    EDIT: looks like that i use zen. diodes 1N4733A witch are 5,1V
    one friend notice that diode on D- line shout be before resistor 88R
  18. RobiD

    RobiD New Member

    Joined:
    May 13, 2008
    Messages:
    18
    Location:
    Australia
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hi Thanos,

    It's David again in Australia.

    I built the Mjoy some time ago, flashed it, and installed in the cockpit. I have only now got around to connecting everything up to it. A couple of odd things.

    When using the Windows - Game Controllers window, the Mjoy is listed (which is good) when testing it using this windows based utility, no matter what connector I plug a pot into, it moves all the axis ie: x, y, throttle etc.
    Also, when bench testing, I used a B100K pot. Somehow the magic smoke came out of the pot. Tested the voltage at the connectors and it is +5vdc. I've never seen a pot smoke like that.

    On the keyboard matrix, the HAT connectors are on the opposite end of the row that is marked at the hat connectors.

    I have checked the board for shorts and bad solders and there is nothing that I can find using a multimeter.

    Any suggestions.

    Thanks
    David
  19. Mambo

    Mambo New Member

    Joined:
    Aug 5, 2008
    Messages:
    168
    Location:
    Czech Republic
    Balance:
    250Coins
    Ratings:
    +1 / 0 / -0
    I had same behavior (when testing it using this windows based utility, no matter what connector I plug a pot into, it moves all the axis ie: x, y, throttle etc.
    ). when i connect all imputs its gone (for example try connect nonused imput to ground)
  20. RobiD

    RobiD New Member

    Joined:
    May 13, 2008
    Messages:
    18
    Location:
    Australia
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Any thoughts on why smoke came out of the pot?
  21. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0

    If you connect the wiper of the pot in wrong pin you might end up having a variable resistance between +5v and the Ground, that means if you turn the pot and the resistance lowers too much, more current will pass through the pot making it hot and eventually burnout...

    It was happened to me too, once when I connected wrong a pot of my joyrider... The little pot almost took off in flames!!!! :lol:


    Regards, Thanos