USB host shield (from Arduino website) and CAN bus shield (Seeed)

Hi all,

This is mostly a statement of a problem with the USB host shield found on the Arduino website. I would appreciate confirmation/correction or comments. While I am going to contact the Arduino support, I thought it could be interesting to others to know about this.

I am trying to use a USB host shield from the Arduino website along with a CAN bus shield from SeeedStudio. These with an Arduino Mega 2560, latest revision. Programming is done with the Arduino IDE version 1.0.6.

Both shields seem to be working all right independently.

I have modified the CAN bus shield to get the SS pin on pin 4, which is unused on the USB host shield.

Using the "send" example supplied in the SeeedStudio library , modified to account for the different SS pin and to deselect the USB host shield, I get a disappointing "CAN Init fail" when both shields are connected. When I disconnect the USB host shield, it works fine and the CAN bus gets initialized fine.

When I look at the SPI signals on the scope, it looks like the MISO line is inhibited when the USB host shield is connected. However, pin 4 works as intended and pin 10 remains high, which should free the MISO line on the USB shield side. So, my SS logistics should be fine.

I know there is a lot of documentation on the Circuits@home website and I've looked into it but I can't find anything relevant to this problem. The USB host shield I have is neither a Sparkfun one nor a Circuits@Home one and I wonder if the problem doesn't lie there.

Actually, when I look at the circuit diagrams, I see that:

  • the Sparkfun shield seems to route the MISO output of the MAX3421E directly to Arduino
  • the circuit@home shield seems to convert the MISO output from 3.3V to 5V, and uses SS to enable/disable the driver output or not
  • the Arduino website shield also uses a driver to convert from 3.3V to 5V, but doesn't use SS to enable/disable the output. The OE line is connected to ground, effectively enabling the ouput permanently. I checked the board physically, it is the case.

My conclusion is that the design of this shield is bogus and that, while it is perfectly functional on its own, it won't let any other shield communicate on the SPI bus. So, beware...

Has anyone had any experience with this shield? Is it a known fact that this shield doesn't let other shields communicate on the SPI bus? Am I missing something?

I hope this can be helpful

Update:

I have attempted to disconnect the enable pin of the MISO line driver from ground and re-connect it to SS. This was fiddly and I ended up destroying the driver. After removal of the chip and routing the MAX3421E MISO output directly to Arduino (as done in the Sparkfun USB host shield), it all works magically: both my shields work at the same time with the code I had written initially.

I hope this can save some time to others.

sir can I ask to everyone the block diagram of arduino usb host shield for academic purpose only... :slight_smile:

I'm having the exact same issue. I first tried a Keyes USB host shield and physically rewired the INT pin on Pin 9 to a different pin, then I change the software to match. I was still getting the "CAN Init fail" so I bought the Arduino USB host shield (before I saw this post) and ended up with the same issue. You mentioned the Sparkfun USB host shield might not have this hardware bug. Do you know if this is true? I would really rather get a host shield that works without modification.