Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to connect two Ethernet shields to arduino? And if yes, how can I distinguish them in the code?

share|improve this question

migrated from electronics.stackexchange.com Jan 7 '15 at 22:34

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

1  
You need to move the SS pin for one of the shields (Arduino pin 10). That way you can select which shield you want to talk to. – Gerben Jan 8 '15 at 19:11
    
I don't think you can do this because the Ethernet.begin statement isn't an instance of Ethernet so I don't think you can do this. – unknowndomain Feb 2 '15 at 23:37
3  
Technically it is possible. Maybe you will have to write your own library. But... Why? Why do you need two ethernet shields? I'm pretty sure the main problem is another one... Please tell us what you really want to achieve, so smarter solutions can be suggested (see The XY Problem). I'm telling you this because even if you have two shields you won't be able to do much work with them... – frarugi87 Jan 25 at 10:16

The ENC28J60 Shields have a Chip-Select-Pin (CS) so you could select between the two shields with this.

https://upload.wikimedia.org/wikipedia/commons/f/fc/SPI_three_slaves.svg

I'm using the EN28j60 with the Ethercard library and I'm not sure if this could handle two Ethernet shields because you have to set the CS pin at init on the first call in the function, and can't change it at runtime.

share|improve this answer
1  
As I know you can High or Low any pin at runtime. – Mae Jan 25 at 6:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.