Pages: [1]   Go Down
Author Topic: Arduino Mega suggestion  (Read 2113 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Mowcius
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 12, 2010, 06:05:38 am by danvm » Logged

Left Coast, USA
Offline Offline
Sr. Member
****
Karma: 5
Posts: 499
Sometimes I just can't help myself.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@danvm:
Quote
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.
« Last Edit: October 12, 2010, 11:21:16 am by davekw7x » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 12, 2010, 12:39:38 pm by danvm » Logged

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

USA
Offline Offline
Full Member
***
Karma: 2
Posts: 213
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 211
Posts: 13477
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

+1
Logged

Pages: [1]   Go Up
Jump to: