Arduino Mega suggestion

I would really like to get my hands on one of the new Mega2560 boards, but i have one hangup:

Would it be at all possible to rearrange the pins, both physicaly and in software, to be truly pin compatible with Duemilanove shields? I have a couple of shields that rely on the SPI pins being on D11-13. I cant even rig the shield to use different pins because the SPI is way over in the big header on the far end of the board.

Theoretically then I'd say yeah. Not sure why they have configured the Mega like this....

Mowcius

It wouldn't be hard to implement either, merely a matter of physically swapping 4 pins and changing the pin aliases in the IDE/Compiler. On top of that there are practically no shields specificly for the mega (Protoshields from sparkfun and the like are about the only ones), this change would have little to no impact on existing mega users and would add some much needed functionality for those wanting to use the Mega with existing Duemilanove shields.

I say that being able to plug a shield onto the Mega, load your Duemilanove code and have it just work would be a major improvement.

@danvm:

I cant even rig the shield to use different pins because the SPI is way over in the big header on the far end of the board

One possible workaround for Adruino Mega boards using existing shields that dedicate pins 11, 12, and 13 to SPI signals:

Bend pins D11, D12, and D13 slightly away from the shield so that they do not make contact with the Arduino Mega board when they are plugged together.

Connect short male-to-male jumpers (or 24-guage solid hookup wire) from the Arduino Mega connection header to the shield header as follows:


MEGA header pin 50 (MISO) to Shield header pin 12
MEGA header pin 51 (MOSI) to Shield header pin 11
MEGA header pin 52 (SCK)  to Shield header pin 13

Not as "neat" as I would like but it works for me. (And has the advantage of not cutting traces and making jumpers on the Mega board itself.)

Regards,

Dave
Footnote: (Especially to designers of SPI device Shields for Arduino and Arduino Mega boards)

How about following the lead of NKC Electronics? Their protoshield has a header that plugs into the ICSP connector on an Arduino or Arduino Mega board. The MISO, MOSI and SCK signals on the shield are routed to this connector and, therefore, aren't dedicated to pins 11, 12, and 13. I have tested this with a "regular" NKC protoshield plugged into a Duemilanove and also plugged into a Mega1280. No pin-bending and no jumpers (and no source-code software changes for arduino-0021) required to access SPI device(s) on the protoshield. Works a treat.

My last words on the subject:
The new Arduino Ethernet shield follows this scheme. I don't have one to test (and I probably won't buy one---for a couple of reasons), but it appears that they did the "Right Thing" regarding the SPI pin interface.

Though i cant say i like the "bend the pins" idea as repeated jiggery will totally wreck the headers after 2 or 3 sessions (not to mention how horribly the shields will sit with an 1/8th inch of pin bent over and binding up) and do i want to be able to easily put it on my Duemilanove again at some point, i do like the ICSP header idea though, it's tidy and works.

Unfortunately my uSD shield doesn't have the ICSP header. I suppose i can always try Bit-Banging SPI out of 11-13 on the mega until someone convinces sparkfun to put an ICSP on their uSD shield and pull the SPI from there instead.

Would it be at all possible to rearrange the pins, both physicaly and in software, to be truly pin compatible with Duemilanove shields? I have a couple of shields that rely on the SPI pins being on D11-13. I cant even rig the shield to use different pins because the SPI is way over in the big header on the far end of the board.

I used a protoshield and some 30ga wire to make an adapter shield so that the MEGA I2C pins were re-routed to the correct place. I accomplished this by cutting off the long pins on the shield header for A4 and A5, then routing 30ga wire from there to the MEGA's I2C (D20 - D21). As a result my I2C RTC/flash shield works just fine. The cost is giving up 2 analog inputs, or tapping them on a shield below the adapter shield.

One could do the same thing for SPI.

-j

I cant even rig the shield to use different pins because the SPI is way over in the big header on the far end of the board.

What I did to solve this is get a mega proto board and stick it in between the mega and the sheild. I used it to re-route the pins I needed. It worked very well when I hooked up an Adafruit GPS to one of the other serial ports.

Mark

Maybe someone could design the ultimate Mega2Duemilanova shield based upon all the wisdom above?

What boards isn't it compatible with? (I just got one with a new V.2 Ethernet Shield and was assured it'd work, so I'm a little worried to read this)

What boards isn't it compatible with? (I just got one with a new V.2 Ethernet Shield and was assured it'd work, so I'm a little worried to read this)

The version 2 uses the ICSP header so you should be fine.

I think it would be nice to have the larger Arduino boards be pin compatible to each other.

1