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

    Senetor Member

    Joined:
    Oct 23, 2008
    Messages:
    90
    Location:
    Australia
    Balance:
    594Coins
    Ratings:
    +1 / 0 / -0
    UPDATED 29 July
    I have added , INIT , Mode and Centre jumpers to the PCB, I have updated the following files.


    Here is a Basic version of the MJoy16-16, it measures 54.5mm X 55mm.
    MJoy16-16 Basic revised.pdf
    Pcb.pdf
    silk.pdf
    both.pdf
    MJoy 16 basic revised.rar
    And the AMC Serial Programmer to program it. Measures 44mm X 31mm.
    AMC.pdf
    Pcb.pdf
    AMC.rar

    Attached Files:

    • Pcb.pdf
      File size:
      11.1 KB
      Views:
      1,520
  2. erecek

    erecek New Member

    Joined:
    Jun 1, 2009
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hello,

    I have built the Mjoy16. PCB and my soldering looks fıne. Also had no errors with the programming (Ponyprog).

    The version I built is the latest one that Senetor posted. (53x54mm basic)

    However problem, under device manager Xp shows 2 USB human interface devices. One of them seems fine. The error message under the other is : Windows has stopped this device because it has reported problems. (Code 43)

    Cannot find a solution yet, any ideas.

    If anyone wishes I can post the photo of my problematic Mjoy16

    Thanks.
  3. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
    After transfer the .HEX, the Security and configuration bit was done correctly?

    http://www.powernet.pl/~krzysiek/elektr ... 20Bits.jpg

    The majority of cases in failure after programming, refer to Security and configuration bit or bad solder/tracks in short. Put special attention in solders of crystal and associated capacitors.

    If you have a good cam, take a photo of PCB from solder side.

    You can try reset the ATMEGA and program again.

    Important - If using LPT1 cable after programing:

    1- Disconnect USB cable (acting as power source)
    2- Disconnect LPT1 cable
    Reverse order has the risk of lock ATMEGA clock in 1 MHZ
    3- Remove LPT1 plug and connect only USB plug an see if
    recognized as MJ16.

    Sokol1
  4. erecek

    erecek New Member

    Joined:
    Jun 1, 2009
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hello Sokol1 and rest of the forum,

    Thank you for your advice. However I believe the problem is not with the hard ware or the fuses. Fuses are correct as it is mentioned in the manual.

    The problem is not recognition. Windows recognizes the device actually. But for a second or two. Then passes to code 43 error state.

    I have used some usb diagnosis tools it is recognised as MJ16. A couple of seconds later yellow mark appears next to it.

    Then I opened game controllers setting windows from control panel, kept it open and plugged the device in. It lists the MJ16 with status OK. 2 seconds later disappears.

    Before it disappears I see the 32 buttons and 8 axes then there is the message says :

    your game controller is not connected correctly. Please verify it is connected to your computer.

    I dont understand. The Mjoy 16 gets recognised, installed, shown under game controllers. I see the axes wiggling, 32 buttons, the hot switch, then disappears.

    Any ideas why ?

    Thanks.
  5. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
    I suggest that you test this Mjoy16 in another computer, to see if really work OK, sometime Windows did strange things with USB ports...

    Try go to Regedit, search for Mjoy key and delete this, an plug Mjoy16 again.

    Another cause of problems, bad quality USB cable, I try reuse some mouse and
    keyboard USB cables :roll: and get not recognize...

    Sokol1
  6. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Could you post a picture of the pcb, components, and soldering? It is most likely a communication error. Did you use a 12MHz crystal? Are you placing the board on an insulating surface when you plug it in?
  7. erecek

    erecek New Member

    Joined:
    Jun 1, 2009
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hello Forumers,

    I got it working at last, but not sure why it did not work in the beginning.

    Installed libusb32 then disappearance stopped.

    Funny thing it is still working after rebooting my deepfreeze protected laptop? Never changed the cable or fixed any soldering.

    Do you think that the problem was ungrounded pot ports which were not in use? If so can this be fixed by some additional component(s) to the board?

    I have tested all the pot ports. And a few buttons by shorting some colums and rows. They are working fine.

    One thing I did not quite undertand is the rotary swich. Suppliers here ( Istanbul TR ) did not understand what I meant.

    Can anyone post a photo of a rotary switch we should use with Mjoy 16 please?

    I have noticed that 10 bit resolution was not possible with a 5K and 10K pot. 100 K goes from -512 to +512. Senses even a touch.

    Now should begin building the matrix board.

    Thanks.

    Attached Files:

  8. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
    You need a Rotary Encoder - Mjoy16 support four, in two mode each.

    http://cgi.ebay.com/12mm-Rotary-Encoder ... 1|294%3A50

    To test, if you have a defective mouse, take this scroll wheel, this is a mechanical encoder (incremental type, I think, another type is absolute).

    [​IMG]
    http://img518.imageshack.us/img518/5771 ... r11ku9.gif
    Plug in Column1 and 2 and in Row K

    Don't forget SVMapper to see buttons upper than 32, since its Mjoy16 dont't have MODE jumper.

    Sokol1

    Attached Files:

  9. Senetor

    Senetor Member

    Joined:
    Oct 23, 2008
    Messages:
    90
    Location:
    Australia
    Balance:
    594Coins
    Ratings:
    +1 / 0 / -0
    I have Updated the previous post of the Basic MJoy16-16 PCB with a version that has INIT, Mode and Centre jumpers on the PCB board.

    Senetor.
  10. jeffreymstrong

    jeffreymstrong New Member

    Joined:
    Jul 20, 2009
    Messages:
    4
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    OK, I can be considered a hobbiest at best when it comes to electronics. But looking at the updated Basic MJoy16 the INIT button and Mode button pads appear to be open. Is it wrong or am I?
  11. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Those pads should be connected to row L.
  12. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
    In some revision of PCB, has a diode (1N4148 type) between these jumpers and row L (anode toward row L).
    In fact the are in original Mindaugas Key Matrix scheme:

    [​IMG]
    http://www.powernet.pl/~krzysiek/elektr ... rix_v1.pdf

    Using Key Matrix put the jumpers in J1 connector 1-2, 3-4, 5-6.

    Note the 10k resistor bridge between Columns and VCC. (LOL - I never note this detail before in Mindaugas scheme). :?

    See in this topic (in Russian), user swed say that although it is using all the required diodes in buttons - without the key matrix card - ghost buttons appeared.

    http://www.protu-154.com/forum/viewtopi ... &start=360

    Sokol1
  13. Senetor

    Senetor Member

    Joined:
    Oct 23, 2008
    Messages:
    90
    Location:
    Australia
    Balance:
    594Coins
    Ratings:
    +1 / 0 / -0
    Sorry for the mistakes in the previous post on the MJoy16-16
    http://www.x-simulator.de/forum/post17546.html#p17546
    I was having trouble with Adobe Acrobat, ( Print Spooler ) and could not get things to print and was running out of time and that's when you make mistakes. I have updated the files and they should be right this time. ( Measure twice, cut once.) so to speak.
    Mindaugas had two projects over the years, which were both called MJoy16. The first one used the ATmega8-16 and the second used the ATmega16-16 AVR which he called the MJoy16-C1. Hope this will save some of the confusion with some of the Schematics that people are finding on the internet.


    Senetor.
  14. Sokol1

    Sokol1 Member

    Joined:
    Jul 6, 2009
    Messages:
    126
    Balance:
    14Coins
    Ratings:
    +1 / 1 / -1
    Sorry for obvious question:

    With AVC programmer, the +5V VCC in PCB is not used, correctly?

    [​IMG]
    Picture loaned from Erecek. :)

    In this case power for Mjoy is get from USB cable, like with LPT1 cable?

    Imagine that this VCC pin is useful for those that have professional programmers, but don't offer risk for one first time builder, if make mistake in plug cable?

    I think in build these AVC programmer, I have used successfully a LPT1 cable from Mindaugas scheme, but some times I got -24 int error and in 5 Mjoy no one was .HEX transferred in first try... :?

    And suggest the use of this programmer for a local DIY forum.
    http://forum.clubedohardware.com.br/mjoy-atmega8/472888

    Sokol1
  15. Senetor

    Senetor Member

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

    mohsenk New Member

    Joined:
    Aug 1, 2009
    Messages:
    14
    Balance:
    21Coins
    Ratings:
    +0 / 0 / -0
    Hi guys ! I have a question about the potetiometers !
    I've bought some 10K potentiometers but I have a problem in my mind.
    Here it is : If the potentiometer knob is in the lowest position ! the resistance between the VCC and the output is 0.0 ohm. I read this on my ohm meter. So is this going to hurt the chip or not ?! cause this is short circuiting actually.
    If so, what should I do ? place an additional resistor in serie with the potentiometer ?
  17. Mambo

    Mambo New Member

    Joined:
    Aug 5, 2008
    Messages:
    168
    Location:
    Czech Republic
    Balance:
    288Coins
    Ratings:
    +1 / 0 / -0
    Nothing, it wont harm chip.
  18. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    As Mambo said it won't harm the chip because the ADC has a very high input resistance. It is however a good practice to place a current limiting resistor in series with any input, just in case.
  19. mohsenk

    mohsenk New Member

    Joined:
    Aug 1, 2009
    Messages:
    14
    Balance:
    21Coins
    Ratings:
    +0 / 0 / -0
    Thanks for your replies. If it doesn't harm the chip is it going to harm the pc or not ? Since it's a bus powered device and pc can only provide 500mA. If the resistance get to 0 between the Vcc and GND what will happen ? Where it can get the current from ? Sorry if my question are basic, I'm really new in the electronics.




    I really like the Frakk's latest design ( The All in One Solution ). I think it's really great. However I have built the MJoy16 board based on the pcb layout which mindaugas had provided in his website. But the pc does not recognize it but I have managed to program the chip using the ISP terminal on the board which means both chip and board are working. I programmed the chip myself with a testing program ( test if all the pins are working by means of a multimeter ) which I wrote with WinAvr. I don't know what's wrong with the board. The only items which I couldn't provide as described in the manual were the 3.3V zener diodes which I have used the BZX85C instead.

    ( Here it is, sorry about the bad quality )
    [​IMG]

    So I want to build another board again, and I found these two layouts ( Frakk's all in one & Senator's layout ). I liked the Frakk's design but I don't know which one to build. Please recommend me one of these. I really need this MJoy16 on my project.

    One more thing, the supplier told me that the BZX85Cs are 1 watt ( and 3.3V as it's written on the diode ) so is it ok to use this or I should look for the 1N4728 ? I don't think if I can find the 1N4728 here easy so please tell me some other part numbers which I can use instead.

    Keep the good job going guys !
  20. Mambo

    Mambo New Member

    Joined:
    Aug 5, 2008
    Messages:
    168
    Location:
    Czech Republic
    Balance:
    288Coins
    Ratings:
    +1 / 0 / -0
    Nothing bad happen to the chip or PC . There is no short circuit the chip has own resistance.