GSM + Mega2560

Hi,

I am using the original GSM Shield from Arduino and the Arduino Mega 2560. Is there any possibility to connect them, without using a jumper and pulling the head on pin 2 aside? So is it possible to change something in the code or is this introduction (http://arduino.cc/en/Guide/GSMShieldLeonardoMega) the only way?

You have to change the '#define' called RXPIN in GSM3SoftSerial.cpp file in GSM Library.

Ex: #define RXPIN 10

Can anyone clarify what RXPIN should be changed to for the ATmega 2560? The following code from the latest version of GSM3SoftSerial.cpp (included with 1.0.5-r2) seems to suggest that it is re-defined depending on the type of AT is connected, but all of my GSM sketches fail when I run them on the 2560 without changes.

#if defined(__AVR_ATmega328P__) 
#define __TXPIN__ 3
#define __RXPIN__ 2
#define __RXINT__ 3
#elif defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__)
#define __TXPIN__ 3
#define __RXPIN__ 10
#define __RXINT__ 4
#elif defined(__AVR_ATmega32U4__)
#define __TXPIN__ 3
#define __RXPIN__ 8
#define __RXINT__ 3
#endif

Do you also have to run a jumper wire somewhere after implementing the change?

Are you using the official Arduino board?

Yes. Official GSM shield and ATmega 2560.

Caveat - I don't actually have one of these boards.

Is there any particular reason that you want to use a different pin? If you just plug it into the Mega and jumper pins 10 & 2 and bend pin 2 out of the way then there is no reason it shouldn't work. Do you have an Uno to test it on without the need to bend and jumper it?

I'm not the OP, but in my case I'm going to be deploying what I'm putting together in a remote location and I'd rather not depend on the jumper wire.

I can successfully run GSM applications on both an UNO and the MEGA (using the jumper wire method). Just looking for a software solution instead of the hardware one.

It's not a good match with the Mega. Bending pins and using jumpers? At the risk of being ostracised I would give some serious thought to an alternative gsm shield.

Thanks for the input. Any specific suggestions?

There's a SIM900 based one around which allows you to configure which pins to use for Rx & Tx, useful when using a Mega. The cheap Seeedstudio one requires the use of pins 0 & 1 which messes up communicating with the board.

You may need to use SoftwareSerial, so check that it can be used on the pins the shield offers you. See The SoftwareSerial reference for further details.

What's wrong with bending the pin away a bit, and using a jumper?

You're working with prototype boards and all the electronics are exposed!

Hello everyone :slight_smile:
I am asking the same question, as Eduardo3rd. Code posted by Eduardo3rd to me looks good (when MEGA is used, RXPIN is 10) but still there is a problem! Probably there is a place, where this setting is overrided, but where? It is much more elegant to make code change than bending pin.
Hope someone can help :slight_smile:

Eduardo3rd:
Can anyone clarify what RXPIN should be changed to for the ATmega 2560? The following code from the latest version of GSM3SoftSerial.cpp (included with 1.0.5-r2) seems to suggest that it is re-defined depending on the type of AT is connected, but all of my GSM sketches fail when I run them on the 2560 without changes.

#if defined(__AVR_ATmega328P__) 

#define TXPIN 3
#define RXPIN 2
#define RXINT 3
#elif defined(AVR_ATmega2560) || defined(AVR_ATmega1280)
#define TXPIN 3
#define RXPIN 10
#define RXINT 4
#elif defined(AVR_ATmega32U4)
#define TXPIN 3
#define RXPIN 8
#define RXINT 3
#endif




Do you also have to run a jumper wire somewhere after implementing the change?