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 Download Package Now!
  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 here. Do not following these rules will lead to permanent exclusion from this website: Read the forum rules.

Tutorial Mjoy16 USB AVR Joystick

Discussion in 'DIY peripherals' started by tronicgr, Jan 3, 2008.

  1. nfko

    nfko New Member

    Joined:
    May 28, 2013
    Messages:
    7
    Balance:
    1Coins
    Ratings:
    +3 / 1 / -6
    Hi,
    thank you for your reply. I decline problem with soldering. I dont see 100k resistor in schematic. AVR i programing just few weeks but my avr burner (eXtreme Burner - AVR) wrote that all is allright.
    Here is next image upload
    [img600px]http://s23.postimg.org/gmt3dimy1/dps.png[/img600px]
    [img600px]http://s23.postimg.org/ptbe0ss6h/side_of_component.png[/img600px]
    Description of components :
    C1-C2 are 15pF ceramic capacitor
    C3 is 10uF elektrolyt capacitor
    C4-C6 are 100nF ceramic capacitor
    SV1 SV2 are matrix keyboard connector + connector for my usb asp programer [link]http://www.ebay.com/itm/USBASP-USB-AVR-Programmer-for-Atmel-USB-ASP-USBISP-ISP-Arduino-Bootloader-USA-/150739530304?pt=LH_DefaultDomain_0&hash=item2318c6b240[/link]
    JUM2 is not jumper but +5 and GND connector for programer
    Jum1 is reset conector for programer
    Q1 is 12mhz xtal
    R1 is 2k2
    R2 is 4k7
    R3-R4 are 80R
    And D1 - D2 are 3v3 zener diode
    Pad1-6 are potenciometers connectors
    • Dumb Dumb x 1
  2. nfko

    nfko New Member

    Joined:
    May 28, 2013
    Messages:
    7
    Balance:
    1Coins
    Ratings:
    +3 / 1 / -6
    Can you help me ?
    • Dumb Dumb x 1
  3. GeorgeBoles

    GeorgeBoles Member

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

    1. The resistors are 10k (my mistake) between Vcc and PC0 to PC7 as seen on:

    http://www.x-simulator.de/forum/mjoy16-usb-avr-joystick-t726-130.html
    and
    http://imageshack.us/f/104/keymatrix.jpg/

    Yes, I know they logically should be on the schematic for the main board but Mindaugas put them on his matrix board and most people say we need them. (Oh well.)

    2. There is set of 330R resistors between MOSI MISO SCK and RESET and the micochip pins (R3 R4 R5 R6 R7 on the MJoy schematic from Mindaugas). Some programmers have them as well. You do not need both.

    3. The commonest problem people have is not setting the switches in the AVR programming software correctly. Their correct settings are in the Mindaugas' original documentation

    I built the board exactly using Mindaugas schematic (but not the Matrix board) and programmed it exactly using his instructions. I have nearly NO electronics knowledge and it worked just perfectly first up.

    (Unfortunately your images or the links did not upload.)

    Good luck,
    George.
    • Dumb Dumb x 1
  4. nfko

    nfko New Member

    Joined:
    May 28, 2013
    Messages:
    7
    Balance:
    1Coins
    Ratings:
    +3 / 1 / -6
    Good day

    I reply on yours points in your text.

    Point 1.: I think that 10k resistor are use on keyboard metrix for mjoy16 C1 aren´t ? I build mjoy 16 with atmega 8-16 no with atmega 16-16. And I think that this resistor no condition for recognized device.

    Point 2.: I dont need 330R resistor on mosi miso sck (R5 R6 R7) connector for programing because i have porfesional programer kit. And what do you think about R3 and R4 ? This resistor haven´t value 330 but 80 or I am wrong ?

    Point 3.: I use other software for burn AVR because PonyProg not support usb ISP avr programmer.

    Thank you for your reply
    • Dumb Dumb x 1
  5. Sokol1

    Sokol1 Member

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

    NFKO

    I'm away from Mjoy assembly a few years - but from my past experience (~ 8 assembly):

    Unknow device are related with:

    1 - Incorrect/incomplete firmware write procedure, major issues with fuses.

    Recently a guy from another forum try write Mjoy16 firmware with USB programmer/software and get this unknow device error message.
    In sukhoi.ry forum they told my that USB programmer probable are not compatible with Mjoy8 or 16 due voltage issues.

    2 - Wrong components (or bad soldered one, short circuits) in PCB assembly, that cause Mjoy USB connection dont work properly.

    Well, my experience with Mjoy's show that a Mjoy (8 or 16) that work well in some computer in another is unknow device, but work in a notebook with different Windows version...
    Or a Mjoy16 that work perfectly in one or two computer plugged in another is not even recognized as unknow device, but a Mjoy8 work in this computer...
    At end I tested 3 Mjoy (8 and 16) in 4 different computers (WIn XP, 7), with random results...

    BTW - the assembly in the first page of this thread is wrong named Mjoy16, should by Mjoy or Mjoy8 (Mjoy16 use different ATMEGA, and different PCB scheme and firmware), and since is based in Mindaugas prototype was turned obsolete by Lazzy Camel/Mercury versions, although work.

    If you have a ATMEGA 8-16 microcontroller (that is appropriate to build a Mjoy8 - not Mjoy16) this scheme linked is not applicable to this version:
    http://imageshack.us/photo/my-images/10 ... .jpg/?sa=0
    It is a Button Matrix for Mjoy16 only.

    If you are using a breadboard to assembly, I suggest start again with Mercury scheme and firmware (one the more recently improvements*):

    http://mercury13.tut.su/?q=mjoy

    * There's a new improvement for Mjoy, called MMJoy - with different firmware (but use same MJoy8 or 16 PCB), support for new ATMEGA (32, 168, 328), a software called Configurator that allow to change axis/buttons/HAT configurations, VID/PID numbers and controller name in EEPROM via USB. But I think that this deserve a separated thread (this one are now a bit confuse).

    Sokol1
    • Dumb Dumb x 1
  6. nfko

    nfko New Member

    Joined:
    May 28, 2013
    Messages:
    7
    Balance:
    1Coins
    Ratings:
    +3 / 1 / -6
    Hello

    Than you very much for link. I will try to make constructions on mercury web. I will tell you about compacted or failure.
    Sokol1 Can you tell me, how construction of joystick you use now ?

    Thank
    • Dumb Dumb x 1
  7. nfko

    nfko New Member

    Joined:
    May 28, 2013
    Messages:
    7
    Balance:
    1Coins
    Ratings:
    +3 / 1 / -6
    • Dumb Dumb x 1
  8. nfko

    nfko New Member

    Joined:
    May 28, 2013
    Messages:
    7
    Balance:
    1Coins
    Ratings:
    +3 / 1 / -6
    • Dumb Dumb x 1
  9. Kuba5

    Kuba5 New Member

    Joined:
    Sep 3, 2012
    Messages:
    1
    Balance:
    - 39Coins
    Ratings:
    +1 / 0 / -1
    Hi, i need some working and tested layout for Mjoy16. But for all in one, so bigger PCB with Matrix and diodes.
    Thanks :hi:

    P.S. and please single-sided PCB
    • Dumb Dumb x 1
  10. GeorgeBoles

    GeorgeBoles Member

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

    All that you need is in these posts from earlier in this thread. There is probably some repetition of information, but it should cover it.

    mjoy16-usb-avr-joystick-t726-70.html#p15777
    mjoy16-usb-avr-joystick-t726-100.html#p17329
    mjoy16-usb-avr-joystick-t726-110.html#p17516
    mjoy16-usb-avr-joystick-t726-110.html#p17527
    mjoy16-usb-avr-joystick-t726-180.html#p18832

    Have fun.

    I have made a little MJoy and joystick page which I am working on. There might be some useful information in there for you. Check on the little WWW symbol.

    Regards,
    George.
    • Dumb Dumb x 1
  11. Czary

    Czary New Member

    Joined:
    Aug 11, 2013
    Messages:
    13
    Occupation:
    Duty Officer
    Location:
    Poland
    Balance:
    292Coins
    Ratings:
    +3 / 1 / -2
    Hello, and greetings from Poland. I've read through all the posts but nowhere i could find live link to mjoy with pcb 52x34 mm version. Plese e-mail me one if you have it or please send me a link. Best regards, Czarek.
    • Dumb Dumb x 1
  12. Czary

    Czary New Member

    Joined:
    Aug 11, 2013
    Messages:
    13
    Occupation:
    Duty Officer
    Location:
    Poland
    Balance:
    292Coins
    Ratings:
    +3 / 1 / -2
    Guess I wasn't looking good enough so far ;) Here is a small version of the MJoy16 : http://translate.google.com/translate?s ... D1%258B%2F
    Unfortunately link to modified documentation is inactive - the one has to guess component layout using only one diagram and a photo :/
    • Dumb Dumb x 1
  13. schredder

    schredder New Member

    Joined:
    Aug 6, 2010
    Messages:
    3
    Occupation:
    Practical Engineer
    Location:
    Israel
    Balance:
    211Coins
    Ratings:
    +0 / 2 / -0
    • Bad Spelling Bad Spelling x 1
    Last edited: Sep 17, 2013
  14. draken152

    draken152 New Member

    Joined:
    Aug 28, 2013
    Messages:
    1
    Balance:
    0Coins
    Ratings:
    +1 / 0 / -0
    Hi All,
    I am currently working on my Mjoy 16 joystick. Please it is existing solution how to connect more then 4 rotary switches to Mjoy16???? It is necessary to change program????

    Thx
    • Useful Useful x 1
  15. Sokol1

    Sokol1 Member

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

    steve50 New Member

    Joined:
    Nov 8, 2013
    Messages:
    2
    Balance:
    414Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    DC motor
    Hello to all! I am new here, from Budapest.
    I have a large problem with my new built MJoy16. I have the circuit diagram Version 1, with PCB design. Downloaded the firmware hex file and eep file too. Using the attached ISP adapter circuit, succesfully programmed the ATMega16-16PU. But the MJoy16 does not work absolutely! If I change the USB connection part of the circuit (R1=1k, R2 remove, D1 and D2=3.6V, R7 and R8=68ohm, in that case it is recognised as Human Interface, but staying as Unknown Device. If I try write different VID and PID, the computer reads out thise different dates(in Device Manager /Device propertis), but it stays as unknown device.
    Please write me sombody, who has a working MJoy16-c1.
    Had to make something hardware change?
    I am afraid, the firmware program accesible on the net is fake one... :(
    I have no idea more...The board is precise, made by me, having 20 years practice in electronic circuit building :)
    Help, help , help!!
    Thank You very much!
    Steve
  17. Evais Zar

    Evais Zar New Member

    Joined:
    Apr 11, 2014
    Messages:
    3
    Location:
    Islamabad, Pakistan
    Balance:
    148Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, SimAxe, Arduino, JRK, Joyrider, SimforceGT
    Hi Thanos!

    Did a great work.

    I need a little favor... will you please send me a firmware with replacing names "Rudder" and "Throttle" with Ry and Rz. i want to use it with an own made vb.net application.

    Regards, Owais
  18. tronicgr

    tronicgr

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

    You know... I have no idea what happened to the source code... I'll have to dig it out from my very old backups...

    I made a new version now anyway that has native force-feedback (directx-9 compatible) as well :grin




    Thanos
    • Like Like x 2
    Last edited by a moderator: Jul 26, 2014
  19. Evais Zar

    Evais Zar New Member

    Joined:
    Apr 11, 2014
    Messages:
    3
    Location:
    Islamabad, Pakistan
    Balance:
    148Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, SimAxe, Arduino, JRK, Joyrider, SimforceGT
    Thanx Thanos for reply :)

    I've found one MJoy.asm. I am attaching it here.

    Does this resemble your's??

    Attached Files:

    • MJoy.txt
      File size:
      71.2 KB
      Views:
      617
  20. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    That's it... But you'll have to figure out how to compile it after you change the names. I think I used AVRstudio4 before for this.

    Just a hint of how to do the change: The axis names are not actually names but values that point to the correct assignment in the driver side. So you'll have to find the correct descriptor for the Ry and Rz that you need:

    Code:
    ReportDescriptor:
            .db 0x05,0x01        ;Usage_Page (Generic Desktop)
            .db 0x15,0x00        ;Logical_Minimum (0)
            .db 0x09,0x04        ;Usage (Joystick)
            .db 0xA1,0x01        ;Collection (Application)
            .db 0x05,0x02            ;Usage_Page (Simulation Controls)
            .db 0x85,0x01            ;Report_ID (1)
            .db 0x09,0xBA            ;Usage (Rudder) - OK
            .db 0x09,0xBB            ;Usage (Throttle) - OK
            .db 0x15,0x81            ;Logical_Minimum (-127)
            .db 0x25,0x7F            ;Logical Maximum (127)
            .db 0x75,0x08            ;Report_Size (8)
            .db 0x95,0x02            ;Report_Count (2)
            .db 0x81,0x02            ;Input (Data, Var, Abs)
    
    Maybe here you can find more info... http://www.usb.org/developers/hidpage/


    Thanos
    • Informative Informative x 1