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,
Ethernet Shield / MCP23017
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: Ethernet Shield / MCP23017
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.
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.
-
- Posts: 31
- Joined: Wed Jun 04, 2014 1:58 am
Re: Ethernet Shield / MCP23017
Will I still be able to use my Uno sketch on the Mega?
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: Ethernet Shield / MCP23017
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.
-
- Posts: 31
- Joined: Wed Jun 04, 2014 1:58 am
Re: Ethernet Shield / MCP23017
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.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.
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: Ethernet Shield / MCP23017
Other than changing your pin numbers, you should have no problems.
Please be positive and constructive with your questions and comments.