Sparkfun USB host shield fails with Mega 2560: SOLVED!

Hi,

I have a newly acquired Sparkfun USB Host Shield 2.0. I am using If I connect it to an Uno or a Sparkfun RedBoard then it passes the self-test with the board_qc script (but only if I connect pin 7 to reset). However, when I connect it to an Arduino Mega 2560 it doesn't pass. For what it's worth, I'm using a Linux machine. Error:

Circuits At Home 2011
USB Host Shield Quality Control Routine
Reading REVISION register... Die revision invalid. Value returned: 00
Unrecoverable error - test halted!!
0x55 pattern is transmitted via SPI
Press RESET to restart test

What I've tried:

  • I have tried both with and without reset jumpered to pin 7: doesn't help.
  • I've tried adding external power: doesn't help.
  • The Mega board is new, but I have verified that it will load run the Blink example.
  • I have checked the continuity of all the connections between the USB shield and the Mega.
  • I have checked that the USB shield is plugged into the correct ports on the Mega.
  • I have Googled.
  • I switched the host shield back and forth between an Uno and the Mega and it always works on the Uno and never on the Mega. I am running the latest version of the USB Host Library (I did: git clone GitHub - felis/USB_Host_Shield_2.0: Revision 2.0 of USB Host Library for Arduino.).

Now what, please?
Thanks!

The Mega has its SPI pins in a different place than the Uno.
You may need to jumper 50-51-52-53 to 10-11-12-13 (check the order) to make the SPI connections, and then make sure 10-11-12-13 are inputs only in your sketch.

Have you checked the Sparkfun website:

I checked the Sparkfun site, but I don't have the MAX3421e_constants.c file nor is there any any MAX_SS constant defined in the library.

I don't know anything about SPI, but I looked at the numbers in the Mega post on Sparkfun and jumpered the pins together accordingly:
52->13
50->12
51->11
53->10

Now it works!

So presumably, if I put the USB board on a separate breadboard (not stacked on top of the Mega) I would free up pins 10 to 13?
Thanks!

Cool.
Yes.

Yep, confirmed that's the case; although 53 and 10 do still need to be jumpered together.

Yep, i had to jumper 10-13 pins, and pin 7 to reset to get mega2560 to work with sparkfun USB host shield. Various examples work with USB mouse, but not with my Logitech extreme 3d Pro joysticks -- to get those to work I had to provide 7.5v to DC power jack on 2560 board. I had two bad joysticks, and I confirmed that some of their analog values were "broken", sigh. I used HID example led3p.ino in the USB host library.