Pages: [1]   Go Down
Author Topic: USB state blocks on "Wait SOF"  (Read 364 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
Start
202 - 0x20: Settle
403 - 0x30: Reset device
404 - 0x40: Wait reset complete
405 - 0x50: Wait SOF

Thanks for suggestions.

Stéphane.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
        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.
Logged

Pages: [1]   Go Up
Jump to: