Go Down

Topic: USB state blocks on "Wait SOF" (Read 417 times) previous topic - next topic

slecorne

Hello,

I try to make working a Sparkfun USB Shield with an Arduino Mega. I have modified "USB_desc" sample sketch in order to show the current USB state with time in milliseconds (following http://www.circuitsathome.com/). I can see state changing from "Reset device" to "Wait SOF", but after nothing hapens. I have tried different USB devices connected to the USB host shield, but the behavior is always the same.

This is what is displayed :

Code: [Select]

Start
202 - 0x20: Settle
403 - 0x30: Reset device
404 - 0x40: Wait reset complete
405 - 0x50: Wait SOF


Thanks for suggestions.

St├ęphane.

slecorne

Hello,

I eventually have my joystick working !
The problem was that the MAX3421e was never set to "host" state. I modified Usb.cpp, line 465 :

Code: [Select]

        case USB_ATTACHED_SUBSTATE_SETTLE:              //setlle time for just attached device
            if( delay < millis() ) {
                // Host mode
                tmpdata = regRd(rMODE) |= 0x01;
                regWr( rMODE, tmpdata );
               
                usb_task_state = USB_ATTACHED_SUBSTATE_RESET_DEVICE;
                }
            break;


Regards.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy