Page 1 of 1

PS2USB usb device not recognized

Posted: Sat Mar 03, 2012 11:14 pm
by dakinet
Hi i build hardvare acording to this shematic :
http://vusb.wikidot.com/project:ps2usb ,build circuit on 5v, with two zener 3.6v diodes.
Placed 100nF close to uc, check all conections twice.
I flash the atmega8 succesfuly, set fuse bits acording to makefile instructions:

Code: Select all

################################## ATMega8 ##################################
ATMega8 FUSE_L (Fuse low byte):
 0x9f = 1 0 0 1   1 1 1 1
        ^ ^ \ /   \--+--/
        | |  |       +------- CKSEL 3..0 (external >8M crystal)
        | |  +--------------- SUT 1..0 (crystal osc, BOD enabled)
        | +------------------ BODEN (BrownOut Detector enabled)
        +-------------------- BODLEVEL (2.7V)
ATMega8 FUSE_H (Fuse high byte):
 0xc9 = 1 1 0 0   1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000)
        ^ ^ ^ ^   ^ ^ ^------ BOOTSZ0
        | | | |   | +-------- BOOTSZ1
        | | | |   + --------- EESAVE (don't preserve EEPROM over chip erase)
        | | | +-------------- CKOPT (full output swing)
        | | +---------------- SPIEN (allow serial programming)
        | +------------------ WDTON (WDT not always on)
        +-------------------- RSTDISBL (reset pin is enabled)

############################## ATMega48/88/168 ##############################
 ATMega*8 FUSE_L (Fuse low byte):
# 0xdf = 1 1 0 1   1 1 1 1
        ^ ^ \ /   \--+--/
        | |  |       +------- CKSEL 3..0 (external >8M crystal)
        | |  +--------------- SUT 1..0 (crystal osc, BOD enabled)
        | +------------------ CKOUT (if 0: Clock output enabled)
        +-------------------- CKDIV8 (if 0: divide by 8)
 ATMega*8 FUSE_H (Fuse high byte):
 0xde = 1 1 0 1   1 1 1 0
        ^ ^ ^ ^   ^ \-+-/
        | | | |   |   +------ BODLEVEL 0..2 (110 = 1.8 V)
        | | | |   + --------- EESAVE (preserve EEPROM over chip erase)
        | | | +-------------- WDTON (if 0: watchdog always on)
        | | +---------------- SPIEN (allow serial programming)
        | +------------------ DWEN (debug wire enable)
        +-------------------- RSTDISBL (reset pin is enabled)


Low byte 0x9F
High byte 0xC9
Afterthat plug usb in PC and get pop up USB device not recognised.

Mesuring results on the board:
betwen + and - terminal (on 100uF) capacitor have 4.8V.
betwen pin 2 and gnd have 2.1V
betwen pin 4 and gnd have 12mV

Can i see on pc ps2usb interface connected without playstation yoystick connected on ps2usb interface?
Thanx

Re: PS2USB usb device not recognized

Posted: Sun Mar 04, 2012 1:42 am
by dakinet
problem solved.
i get 3v3 and bingo

Re: PS2USB usb device not recognized

Posted: Sun Mar 04, 2012 12:30 pm
by dakinet
Now i have calibration problem.
On ps2 side i connect dance pad for playstation 2 (no name , made in china).
-Arows up and down on my dance pad, is Y axis in Properties ps2usb tab.
-Arows left and right on my dance pad is X axis in Properties ps2usb tab.

Problem is when i need to pres two at once in same axis (up and down , or left and right) , controls go in just one direction.
If i pres up and down , pc receive only up.
If i pres left and right , pc receive only right.

On dance pad i have four arows and 6 buttons. Buttons can be presed all together, but arows cannot.
I see solution if i can map axis to buttons, then all arrows can be presed together.
Any help please.

Re: PS2USB usb device not recognized

Posted: Thu Mar 08, 2012 8:02 am
by ulao
Ok after looking above it looks like you are using the ps2usb code on the project page, if so you shoudl see this

// Up, Down - Y! Axis
if (temp1 & 0x10){
reportBuffer[1]=0x00;
}
else if (temp1 & 0x40){
reportBuffer[1]=0xF0;
}
else {
reportBuffer[1]=0x80;
}


First off you may need to debug this. The code left no comment for the ifs...Looks to me like
if its (temp1 & 0x10) set to neither up nor down.
else (temp1 & 0x40) set to down maybe?
then he does another else catch instead of checking a bit? Kinda crappy IMO... Though your problem is that he is using else so you dont get both at once ;) So use ifs like so...


if ( temp1 & 0x10) reportBuffer[1] |= 0x04;//up
if ( temp1 & 0x40) reportBuffer[1] |= 0x08;//down
if ( temp1 & 0x80) reportBuffer[1] |= 0x10;//left
if ( temp1 & 0x20) reportBuffer[1] |= 0x20;//right

You can try that and remove both of the if blocks for up down left right that he has. Remember these are only guesses. If it remembers the last arrow then you need to clear first. Add this above those lines.
reportBuffer[1] &= ~0x60;

Re: PS2USB usb device not recognized

Posted: Sun Mar 11, 2012 1:41 am
by dakinet
Thanx, i see.

I try to build original source that i download in avr studio, but unsuccesfuly.
In avr studio i set external Dependencies to "usbdrv" folder.
When click to build, i get 21 errors and build failed.
Image
http://postimage.org/image/56bdl6v71/full/

i need help.
Thanx

Re: PS2USB usb device not recognized

Posted: Sun Mar 11, 2012 11:14 am
by dakinet
I loose all night in trying this to work.
Also install fresh version of avr studio 5 with all add-ons.
Same problem is here, build starts good and when come to line 392 - 513 (usbMsgPtr, usbInit, usbPoll, usbTxStatus1, usbSetInterrupt,) it report a error "undefined reference".
Please help me to solve this problem .
Salutation

Re: PS2USB usb device not recognized

Posted: Tue Mar 13, 2012 7:06 pm
by dakinet
Finaly i success to build hex from source file , with great help frend of mine.
@ulao
Now i wil try this changed code that you tel me to change, and we wil see what wil happen.

Re: PS2USB usb device not recognized

Posted: Tue Mar 13, 2012 11:57 pm
by dakinet
i solve problem, thanx for help.

This code map axis to buttons, and we have four butons in place of two axis.
Thanx to the ulao.

Code: Select all

reportBuffer[1]=0x80;
         if ( temp1 & 0x10) reportBuffer[7] |= 0x04;//up
         if ( temp1 & 0x40) reportBuffer[7] |= 0x08;//down
         if ( temp1 & 0x80) reportBuffer[7] |= 0x10;//left
         if ( temp1 & 0x20) reportBuffer[7] |= 0x20;//right   

Re: PS2USB usb device not recognized

Posted: Thu Mar 15, 2012 12:02 am
by ulao
glad you got it all working.