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