Prob with USB Host Shield with an Ethernet Shield

I'm using a Freetronics 2010 shield, which is essentially a Duemilanove clone. Currently I have attached a USB host shield (rev1.21 from Circuits@Home) and an ethernet shield (Freetronics Ethernet Shield v1.0) to the arduino, and the ethernet shield seems to be unable to connect to anything when the USB host shield is attached. Both these shields are essential to the project I am working with, but at the moment, the USB host shield is not doing anything yet.

When I try the same example code for "client.connect" that connects to Google, it works fine only when the USB host shield is not connected. As soon as I connect the USB host shield and try again, I cannot connect to the server.

The arduino is powered through a USB port on my PC for the moment, which I believe could be one of the suspects to the problem. I'm thinking may be the 2 shields plus the arduino maybe drawing too much current from my USB port? But anyway, I will be getting my hands on a AC-DC adapter soon and powering my arduino via an external source.

However, before I get to test that, does anyone have any ideas as to why I can't use the two shields at the same time and maybe provide me some assistance??

Cheers

I'm thinking may be the 2 shields plus the arduino maybe drawing too much current from my USB port?

Not too likely, I wouldn't think.

Now that you've made your first post, you can post links. Use that new capability and post links to the devices you are using.

The more likely cause of your problem is a pin conflict. Shields use certain pins for certain functions. If two shields use the same pins for different purposes, there can be problems.

The only way to know is to look at the schematics/datasheets for the devices being used.

Hmm, I'll have a look at the schematics and pin layouts I guess. But here's the parts I'm using.

Freetronics 2010 Arduino: http://www.littlebirdelectronics.com/products/Freetronics-TwentyTen.html

Freetronics Ethernet Shield v1.0: Ethernet Shields Australia | Little Bird Australia

USB Host Shield: http://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino/

Just another quick question, if the I/O pins of the two shields conflict, it is possible to select different pins to use of that shield right? And that'd be done through software? Rather than physically rewiring the header ports to a free port of the arduino.

But thanks for the advice anyway.

Both of the boards are SPI devices. Both use pins 11, 12, and 13. The ethernet shield uses pin 10 as the chip select pin. I didn't find what pin the USB shield uses as a chip select pin.

Without seeing your code, I can't tell whether you are selecting the right device to talk to.

USB Host Shield uses pin 10 for SS as well. On of the SSes needs to be reassigned. On USB Host Shield, this can be done rather easily - there is a 0603 jumper to the right of the pad labeled SS which you need to remove and then solder a wire from the pad to an Arduino pin you'd like to use as SS. Then go to Max3421e_constants.h and change MAX_SS #define from 10 to whatever pin you need ( USB_Host_Shield/Max3421e_constants.h at master · felis/USB_Host_Shield · GitHub, line 21). Then recompile and run some tests.

Oleg.

@PaulS and @fells are spot on with their descriptions of the problem and the solution.

As a bit more background so you understand what's going on, SPI is a method for communicating between a master device and one or more slave devices on a shared bus. It uses 4 signal lines, 3 of which (SCK, MISO, MOSI) are common to all the devices. Each slave device then has its own SS (slave select) line so that the master can enable each one in turn to talk to it.

So what's happening in your case is that, as @PaulS pointed out, both shields are using the same SS line so when the TwentyTen asserts the SS line for the Ethernet Shield it also gets a response from the USB Host Shield, and neither of them work.

@fells solution is to change one of the shields to use a different SS line, and then the TwentyTen can address the shields independently and everything will be happy.

As an aside, you may find this site useful in future for finding pin conflicts:

Arduino Shield List: Freetronics Ethernet Shield
Arduino Shield List: Circuits At Home USB Host Shield

Jon
Freetronics: www.freetronics.com

Awesome, thanks a lot for the information. Atm, I'm trying to attach a MSP430 eZ430-RF2500 (http://focus.ti.com/docs/toolsw/folders/print/ez430-rf2500.html) USB device to the USB host shield. Essentially the eZ430 device has a RF capability which allows it to receive temperatures from wireless sensors. The data is sent through the UART of the MSP430 and goes through to the serial port of the computer (when connected to a PC). I am trying to read this using my arduino and its USB host shield, but right now I'm stuck on finding a suitable example to get me started. I was thinking this would be similar to reading from a USB mass storage device possibly or even the existing BT example at Circuits@Home. Does anyone have a good example I could look at to get me started?

This is most likely USB to serial converter. Here is some code for FTDI232 -> http://www.circuitsathome.com/mcu/towards-an-ft232-driver-for-the-usb-host-shield-part-0

With @felis's post about the SS jumper, the 0603 jumper you were referring to is the resistor (with a 0604 foot print??) next to the SS via right? I was wondering, if I was to remove that resistor...... wouldn't I need to solder an equivalent resistor value in between the connection between the SS via and the new selected Arduino pin?

See the attached picture. The jumper is zero ohms, it's like a piece of wire. You don't need to add a resistor, just remove the jumper and run a wire from SS pad to the Arduino pin you'd like to use as SS for USB Host Shield and then change the MAX_SS #define in Max3421e_constants.h

Hey, I'd hate to bother you guys anymore about this. But following on from what you guys have said, I then tried looking for alternative methods for creating other SS pins on other pins. This is because I'm trying to avoid physically modifying the board itself, unless I ultimately have to. So far my understanding of it is a lil fuzzy, due to the various descriptions I've read. But for starters, I found out that pin 10 is stuck as CS, and if I wanted to create an SS pin, say on pin 4 for example, I'd have to initialise Pin 10 to remain as output to leave it in master mode. From there onwards... I'm still unsure of the process to actually generate a SS pin on the other pins.

There's also this paragraph I read:

"One little catch is with Ethernet shields based on the Wiznet W5100 chipset, which includes the official Ethernet shield and many third-party shields. The W5100 has a design flaw that causes it to maintain control of the SPI bus even when another device has been selected, making it very tricky to combine the official Ethernet shield with other shields that use SPI. The Freetronics Ethernet Shield uses the W5100 chipset but includes a fix in hardware so it doesn't have that problem and will happily share the bus with other SPI devices."

from Stacking Arduino Shields | Freetronics, the last sentence makes it seem like my Freetronics version of the ethernet board should be able to share the SPI without needing to physically hack the board?? Or maybe I'm interpretating it wrong.

@AK88: you're interpreting that correctly. I don't know if this problem has been fixed in the latest version of the official Ethernet Shield, but with the Freetronics Ethernet Shield you're definitely set. We specifically tied the Wiznet chip enable pin to SS (via an inverter, IIRC) to solve that problem and avoid the need for hardware hacking.

Jon
Arduino Shield List: http://shieldlist.org/