Go Down

Topic: Preview HID nes pad (Read 4146 times) previous topic - next topic

Osgeld

I just finished this up tonight, it is for the instructables USB contest, which I have not written my entry for yet  ;)

anyway this takes a atmega 168-328 (i am using a 328) and shoves it into a NES controller, in this case it also is using a vusb joystick lib for arduino 16 (giving HID, no driver usb joystick status to the device)  based off of the keyboard lib from rancidbacon, but of course has lots of I/O free and leaves the reset tx and rx pins free

all the dirt on this sometime this week (or else I cant enter the contest)  stay tuned, till then a teaser

http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

irlolcopter

Very nice! i didnt know you could do this without using the specific usb communication chip thats on the arduino board. (ftdi?)

is there any way to include a tiny flashdrive for your 'homebrew' roms?
-this would appear as a seperate storage device.
i recall seeing this on HAD

the only other solution is to buy a readymade "retroport" device, which are bulky and expensive

leppie

Quote
in this case it also is using a vusb joystick lib for arduino 16 (giving HID, no driver usb joystick status to the device)  based off of the keyboard lib from rancidbacon, but of course has lots of I/O free and leaves the reset tx and rx pins free


I have been struggling for probably longer than a month to get VUSB working.

Just no luck at all. Windows just keep telling me 'Device not recognized'.

Did you have a hard time getting it working?

Osgeld

never got vusb working in any form even using other peoples libraries, had no issues getting the rancid bacon keyboard lib working provided its under 16, and after some farting around I got the usb joystick one working (which are arduino mods of vusb)

and ....

finished project

http://www.instructables.com/id/Convert-a-NES-gamepad-to-USB-with-Arduino/
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

leppie

#4
Jun 30, 2010, 06:23 am Last Edit: Jun 30, 2010, 06:24 am by leppie Reason: 1
Quote
had no issues getting the rancid bacon keyboard lib working provided its under 16


That is probably due to 'attachInterrupt'.

I have tried a plain version (non-Arduino) too (hid-mouse example in vusb), but even that wont work for me.  :(

leppie

What do you know?

I finally got it working!   8-)

rextor

leppie,
i also have the device not recognized with UsbJoystick lib. How do you fixed it?

thanks,

klz327

#7
Jan 18, 2011, 03:15 am Last Edit: Jan 27, 2011, 12:29 am by klz327 Reason: 1
Hi,

Very nice instructable, I am so looking forward to play with my old NES controller again; i need to play "Super Meat Boy" with the old feel!! ;)
However i can't seem to get mine to work. I think i followed all the steps correctly upto the 'test it now'-fase.
I uploaded the software you supply on the instructables website on my rbbb with arduino0016 (after deleting that preferences.txt file), but i have the idea the supplied lib maybe isnt in order.

After pluggin in the USB my pc doesnt recognize the board as an usb HID device (I tested on linux and windoes7).

I noticed in usbconfig.h that the VID & PID werent the 'free' HID pair...
I changed it to this:
#define  USB_CFG_VENDOR_ID   0xc0, 0x16
#define  USB_CFG_DEVICE_ID     0xdf, 0x05
After changing this, still no recognition ;(

The only thing i have different on my setup is that I use 1,3W zener diodes (3,6V), instead of the 500mW you list. This surely cannot be the problem??

I first tested this without the 10 cables from the NES-pcb. I assumed the atmega328 with your code on it should surface as an usb HID with just the neccesary element to get the usb-cables sorted. Is this correct?
I also tested it with the 10 cables attached: no difference.

The files i use: http://opmerk.nl/klz_Nespad.tar

Could you please please please help me out / point me in a direction i can try? So far i havent been able to understand the v-usb-lib

----------------
update
----------------
So i got the 500mW zener in, built the breadboard setup with them.

+
1) Attached the +5v of the USB cable to a 5V pin on the RBBB, and attached the Ground of the USB cable, to the Ground of the RBBB
2) I put an 104 capacitor between +5v and Ground
3) made the right-side connections of the picture

upload the software from the instructables website

unfortunately i get device not recognized errors when i plug it in.

Go Up