USB Host Shield issues on MEGA 2560

Hi there.

I have an issue with my USB Host Shield on my 2560 Mega Arduino. When I run the board_qc code from the Usb Host Shield Library 2.0, I get this code:

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

I looked up a bit on code 00, and it means that the board has no connection to the SPI pins. I did some research and found out that the SPI pins on the Mega were 50-53, not the ones that the board was receiving. So I jumpered pins 50-53 correctly according to how they were specified by my USB Shield Host description website.
Running the code again gives me the same issue, and this time, I can't find anything relevant to the problem on the internet.

Thank you for your help.

So I jumpered pins 50-53 correctly according to how they were specified by my USB Shield Host description website.

The SPI pins include only pins 50-52. The SS pins is part of that only in slave mode but here the Mega is in master mode. So the CS pins must be connected to D10 on the Mega.

It might be necessary to add this code to the setup() routine:

pinMode(53, OUTPUT);

This is to ensure the SS pin of the SPI hardware is set to output mode as otherwise the master mode might not work correctly.

The SPI pins include only pins 50-52. The SS pins is part of that only in slave mode but here the Mega is in master mode. So the CS pins must be connected to D10 on the Mega.

Okay, I must have misunderstood the website when they were talking about the SPI pins. However I have a question: You're telling me to move the Slave Select pin back to pin #10 on the mega?

My current setup is:
53 -> D10
52 -> D13
51 -> D11
50 -> D12
Where the D numbers are the Shield Host pins.

You're telling me to move the Slave Select pin back to pin #10 on the mega?

Yes, that's not the Slave Select pin in this case but the CS (Chip Select) pin as the Mega 2560 is the master. The library most probably use pin number 10 to control the CS signal so you must have:

10 -> D10

Yes, that's not the Slave Select pin in this case but the CS (Chip Select) pin as the Mega 2560 is the master. The library most probably use pin number 10 to control the CS signal so you must have:

10 -> D10

Alright! That's what I did, everything else I've left the same as before. Now this is the code I get:
The Die revision never gives out a code, it just stays like that.

18:36:29.991 -> Circuits At Home 2011
18:36:30.025 -> USB Host Shield Quality Control Routine
18:36:30.025 -> Reading REVISION register... Die revision

Excuse me, I was wrong. I was able to analyze the code of the USB Host Shield library and it has specific definition for the different boards. You have to connect 53 -> D10 but also 54 -> D9 (that pin seems to be used to enable the USB controller to interrupt the Arduino if anything interesting is happening on the USB bus).

But I'm not sure if the library you're using is compatible with your hardware. According to the linked wiki page D9 is not connected, according to the downloadable schematics INT is connected to D9. Check that yourself.

After rewiring the shield again, I've gotten the same result.
I was reading a thread, and one reply said that they got their USB Shield working when they jumped D7 on the shield to the reset pin on the arduino. Didn't work for me. I tried different versions of what you told me, with and without the D9 pin attached, with the reset pin jumped, and all of them give me a 00 code. At one point I managed to get a 03 and it started the testing, but failed instantly. I'm starting to think I've done wiring mistakes. Would a picture of my current wiring setup help?

Picture 1
Picture 2

Please attach pictures to the forum and don't point to external sites. Such links expire too fast.

I don't see a connection from D54 on the Mega to D9 on the Host Shield. Have you tried that?