Hi!
Can the following pins on the Arduino Mega be safely re-assigned in a sketch as Digital Input or Digital Output pins?
Arduino Mega AREF
Arduino Mega SDA
Arduino Mega SLC
Arduino Mega IORF/5V
The pin on my Mega that the schematic footprint identifies as IORF is actually labeled "5v" on all of my boards, so does that mean this is just another 5v input or output?
Also, there is a "Blank Pin" right next to the IORF/5V pin that is both on the schematic footprint and on my Mega boards, but it is unmarked in both places. Is this just a "dummy pin"?
Hi, the board is open-source, you can find the schematic and pinout on its page: https://docs.arduino.cc/hardware/mega-2560/ That should be enough to answer your questions.
The Atmel chips from the AVR family, such as the ATmega2560, can not re-route pins.
AREF: This can be used as a reference for the ADC to measure a signal between 0V and the voltage applied to AREF. It can never be used as a digital pin. When using an internal reference, the AREF pin is connected to that internal reference. You can damage the chip with this pin.
SDA and SCL: These pins are hardwired to pin 20 and 21. Pin SDA is connected to pin 20 and pin SCL is connected to pin 21. The I2C bus is always on these pins. If you don't use the I2C bus, then they can be used as digital pins for other things.
IOREF: This is made by Arduino. It is connected to 5V for a 5V board and to 3.3V for a 3.3V board. When a shield is attached to an Arduino board, the shield knows if it is connected to a 3.3V or 5V board by checking this pin. It is not a digital pin.
Please don't use it as a 5V pin. Use the 5V pin to power sensors. If you do something weird, then you will regret it later.
I don't mind if you use it as a 5V pin during testing.
The blank pin is for future use, or maybe it will never be used. It is indeed a "dummy" pin. It is not connected to something. You should not connect something to that, to be compatible for any future use of that pin.
This was a long answer. A short answer is: No, no, no, no and yes.