I have obtain 2 shield from Itead; GPS Shield & IComSat GSM Shield. I have a requirement to develop an Arduino Uno prototype and used a serial interface to communicate with this two shield. My sketches using SoftwareSerial but it seem not working properly, is there any optimal way to combine these two shield?

Arduino GPS Shield http://imall.iteadstudio.com/im120417017.html

IComSat GSM/GPRS Shield http://imall.iteadstudio.com/im120417009.html

  • \$\begingroup\$ It would be useful to see your schematic and code. \$\endgroup\$ – Oli Glaser Aug 30 '12 at 20:16
  • \$\begingroup\$ You should be able to get by with SoftwareSerial most likely using user30997's answer, but just for your information, when you have a need for multiple serial ports, you can also try the Arduino Mega instead, or if you make your own board, use an Atmega2560 with its 4 Serial ports, all hardware UARTs, so you can use them as Serial1.begin(), Serial2.begin(), Serial3.begin(), etc. \$\endgroup\$ – boardbite Aug 30 '12 at 20:34
  • \$\begingroup\$ Is there a mini or smaller version of Arduino Mega? \$\endgroup\$ – wajatimur Aug 31 '12 at 2:55
  • \$\begingroup\$ @wajatimur Try Mega Pro Mini 3.3V or else the Sanguino. The first one is the same as Mega in a smaller form; The second one is an Arduino with the Atmega644P instead of Atmega328, so you get two UARTs (serial ports). \$\endgroup\$ – boardbite Aug 31 '12 at 10:01

Are you running afoul of any of the restrictions of Software Serial?

  • If using multiple software serial ports, only one can receive data at a time.
  • Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
  • Not all pins on the Leonardo support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

Given that you're using the shields, you'd have trouble with my favorite trick. I've occasionally used relays, analog multiplexers, or transistors to switch the functionality of pins on-the-fly. By using one digital pin to select which serial device you want to talk to, you can have both of your communication pipelines taking place on pins 0 and 1. However, that's not an option with off-the-shelf shields.

  • \$\begingroup\$ This is likely the reason; change your choice of pins for the SoftwareSerial. Also, I don't know if the Arduino default library version has been revised, but otherwise, I recommend you use the NewSoftSerial library (unless apparently you are using Arduino 1.0, in which case it's already integrated as "SoftwareSerial") \$\endgroup\$ – boardbite Aug 30 '12 at 20:31
  • \$\begingroup\$ For completeness of future reference, in your Answer, perhaps you can also add the pins for the Uno that support change interrupts. \$\endgroup\$ – boardbite Aug 30 '12 at 20:32
  • \$\begingroup\$ Theres a change interrupt pin on the GPS shield attached to pin 8 & 9 on arduino. U mean using change interrupt function and to read the serial data? \$\endgroup\$ – wajatimur Aug 31 '12 at 2:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.