I got an Ethermega, and learned that Pin 13 already has a LED.
Are there other digital pins with special circuitry or already allocated to a specific function? (like usb,serial,ethernet,sd, etc)
I need about 30 inputs so I can skip some if that would avoid headaches.
-
Have you checked the schematic and datasheet yet?Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams2014年12月04日 04:37:10 +00:00Commented Dec 4, 2014 at 4:37
-
1arduino.cc/en/Main/arduinoBoardMega , also you could try some external IO inputs with tronixstuff.com/2011/08/26/…Martynas– Martynas2014年12月04日 06:03:57 +00:00Commented Dec 4, 2014 at 6:03
2 Answers 2
D4: ChipSelect for the SD card reader (can be used if no SD is present)
D0 and D1 are Serial RX and TX (just like any other arduino)
D10: Ethernet enable line
D13: led. Led is connected via a mosfet, so it doesn't interfer (like on the uno)
D50, D51, D52: SPI for the ethernet chip and SD card
All this was found in the schematic
Don't worry about the led on pin 13, it just sits there but doesn't block anything.
You can still use the pin as a normal IO pin.
You didn't mention whether your 30 inputs are digital or analog, so let's have a look at digital input first.
I have never used the MCP23017 mentioned by Martynas, but the linked article looks very interesting and I'll definitely order one of these amazing chips!
Another option might be using 8 bit PISO (parallel in - serial out shift registers, such as the 74HC165. Consider this as the complement to the 75HC595 for output. These shift registers are dirt cheap (around 0.3 €), are available as DIP (important for breadboarding) and can be run via SPI.
Advantages:
it's fast to read in 8 digital lines into a byte (why would one want to use more than a bit for the state of a digital input?)
the shift registers can be daisychained, subsequent calls of ShiftIn allows to read all (digital) input states into a corresponding data structure (array of bytes, etc.) using just three pins on your Arduino.
-
1Klaus i wanted to mention
74HC165
:) butMCP23017
link was open already so i just copied it to give the main idea:) +1Martynas– Martynas2014年12月04日 08:17:08 +00:00Commented Dec 4, 2014 at 8:17 -
@Martynas I think it was a splendid idea to mention the
MCP23017
! As written by John Boxall in the article that you linked: "...I think the I2C bus is underappreciated".Klaus-Dieter Warzecha– Klaus-Dieter Warzecha2014年12月04日 08:20:54 +00:00Commented Dec 4, 2014 at 8:20