Ethernet Shield / MCP23017

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
eros
 
Posts: 31
Joined: Wed Jun 04, 2014 1:58 am

Ethernet Shield / MCP23017

Post by eros »

Hi All,

I'm getting my feet wet with an Arduino project and had a few questions.

I currently have an Arduino Uno and would like to connect an Ethernet shield to it. However I understand that it will utilize a few digital i/o ports and I need 19. I understand the Analog ports can be treated as digital, so my question is, how many pins does the Ethernet Shield subtract from production? Can I use the MCP23017 or would it be less messy to go with a Mega? I have a sketch that I already created on the Uno, if it's recommended I go to the Mega route, can I use the sketch I created on the Mega or any other Arduino product?

Thanks in advance,

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: Ethernet Shield / MCP23017

Post by adafruit_support_bill »

Ethernet shield pin usage is detailed in the Ethernet Shield documentation: http://arduino.cc/en/Main/ArduinoEthernetShield
It uses the 4 pins of the SPI bus, plus pins 2 and 4.

Both the Mega and the MCP23017 are viable options. However, since the Ethernet library consumes a fair amount of SRAM and the MCP23017 requires its own library overhead; if your program gets very large, you may find that you need the extra SRAM of the Mega.

eros
 
Posts: 31
Joined: Wed Jun 04, 2014 1:58 am

Re: Ethernet Shield / MCP23017

Post by eros »

Will I still be able to use my Uno sketch on the Mega?

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: Ethernet Shield / MCP23017

Post by adafruit_support_bill »

That depends on what your sketch does. The Mega is for the most part compatible with the UNO and 99% of UNO software will run with no changes. There are some differences in port mappings, interrupts and timers. Most of these are handled in the relevant libraries. But if you are doing any low-level work with these, you may need to make changes.

eros
 
Posts: 31
Joined: Wed Jun 04, 2014 1:58 am

Re: Ethernet Shield / MCP23017

Post by eros »

adafruit_support_bill wrote:That depends on what your sketch does. The Mega is for the most part compatible with the UNO and 99% of UNO software will run with no changes. There are some differences in port mappings, interrupts and timers. Most of these are handled in the relevant libraries. But if you are doing any low-level work with these, you may need to make changes.
All I'm doing is turning on and turning off I/O digital pins. I originally had it where I toggled pins 2 - 19, but with an Ethernet Shield that wouldn't apply anymore. The pin numbers will change on the Mega I think, I haven't had the chance to familiarize myself with that board.

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: Ethernet Shield / MCP23017

Post by adafruit_support_bill »

Other than changing your pin numbers, you should have no problems.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”