Arduino Mega Atmega2560 unused pins

Hello,

This is my first post here! I am builiding a custom Arduino board, and I based my design on the Arduino Mega ADK. The microcontroller used is Atmega2560.

The question is: I've seen there are a few pins from the Atmega2560 which are unused in Arduino (they are not wired to any external pin). I am interested in using these pins as outputs. I've done some research and I've seen things about Port Manipulation, etc. but I can't really figure how to do it.

Do I have to modify the bootloader? Is there a file where pins are defined?

Thank you!

http://arduino.cc/en/Hacking/PinMapping2560

Any pins not mapped in the Arduino core mapping would require (you) to modify the core. This is not a trivial exercise. Look like https://roboticsclub.org/redmine/projects/quadrotor/repository/revisions/58d82c77908eee0e1c222f7b38691e6532deb77b/entry/arduino-1.0/hardware/arduino/variants/standard/pins_arduino.h

mrburnette: http://arduino.cc/en/Hacking/PinMapping2560

Any pins not mapped in the Arduino core mapping would require (you) to modify the core. This is not a trivial exercise. Look like https://roboticsclub.org/redmine/projects/quadrotor/repository/revisions/58d82c77908eee0e1c222f7b38691e6532deb77b/entry/arduino-1.0/hardware/arduino/variants/standard/pins_arduino.h

You can access the unused pins on a 2560 chip without modifying the arduino core by using direct port addressing functions to read or write to those pins. You just can't utilize the arduino pin name abstraction as they are not defined in the core's pin mapping.

Lefty

pins_arduino.h updated to allow access to all pins has been posted in the forum before.

These files might be a discussion and that file even.

pins_arduino.h (13 KB)

Pins_arduino_discussion.rtf (470 Bytes)

Thank you for your answers. I am more in place now. Is there a complete tutorial to do this? From compiling the source code to uploading it to the board? Thank you!

Not that I am aware of. You do need to create a new boards.txt file, put that and the pins_arduino.h in a new variants folder as described in the .rtf file above, if you browse the IDE folders you can see how it's set up. Copy an existing '2560 block of entries from the standard boards.txt to start. Hard to describe it better without having the stuff in front of me.