Comments: Arduino Shields

Pages

Comments 1 comment

  • ——————– Tech Support Tips and Troubleshooting ——————–

    Using an Arduino Shield on an Arduino Mega

    It’s hard to say what Arduino shield will work with other development boards outside of the Arduino Uno with Atmega328P. There maybe compatibility issues compiling code (a library has not been ported for a certain microcontroller) or there are differences in pin locations:

    software serial - https://www.arduino.cc/en/Reference/SoftwareSerial

    interrupts - https://www.arduino.cc/en/Reference/AttachInterrupt

    SPI - https://www.arduino.cc/en/Reference/SPI

    I2C - https://www.arduino.cc/en/Reference/Wire

    If you are using a different microcontroller (like an Arduino Mega) where the pinouts are different, you would need to make sure that the pins that the shield are connected to the corresponding pins. An example is if you are using SPI. The SPI pinouts are different on an Arduino Uno compared to the Arduino Mega. You can try to bend the pins out of place and reroute them using jumper wires similar to this tutorial => http://mcukits.com/2009/04/06/arduino-ethernet-shield-mega-hack/ . You do not need to modify the core Arduino library as explained in the NKC Electronics tutorial.

    If you compared the pinouts of the software serial pins on the Arduino Mega, they are also not the same compared to the Arduino Uno. This is just a limitation of the pins that are broken out on the Arduino Mega.

    Stacking Multiple Shields together

    If you are stacking multiple shields together as stated in the first section of this tutorial, you might need to rewire and redefine the pins. For example, if one shield is using pin 2 already and you stack second shield that requires using pin 2 at the same time, you would need to use a different pin for the second shield and redefine the pin in Arduino.

    You could use the Go-Between Shield [ https://www.sparkfun.com/products/11002 ] to stack multiple shields more easily.


If you've found a bug or have other constructive feedback for our tutorial authors, please send us your feedback!