Multiple serial communication

Hi!

I want to plug my arduino 2009 with an RTC shield (http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=270729898023&ssPageName=ADME:L:OC:US:1123#ht_3194wt_1185) and with a Telit GM862 GSM/GPRS/GPS module (http://www.sparkfun.com/products/7917).
To comunicate with both, I´ve read the following two tutorials:

http://tinkerlog.com/2009/05/15/interfacing-arduino-with-a-telit-gm862/ ← here, the autor is using an arduino mega.
DS1307 RTC tutorial

How can I instantiate two serial comunications beetween both shields (with arduino 2009) to retrieve data?
I´ll need to begin a Serial, collect the data that I need, end this serial and start another serial with other baud rate and so on? :roll_eyes:

e.g.:

Serial.begin(9600)
.
.
.
Serial.end
Serial.begin(19200)
.
.
.
Serial.end

I've never seen an RTC that used serial to communicate, certainly the DS1307 doesn't. That Ladyada tute seems to use i2c.

Apart form that your problem is that it's not really possible to have three devices (the FTDI chip is on Serial as well)) on a single serial connection, at least not with a lot of frigging around and/or extra hardware.

So I would suggest using New Soft Serial. As I understand it NSS can have multiple instances on different pins, but you can't use them at the same time.


Rob

I’ve never seen an RTC that used serial to communicate, certainly the DS1307 doesn’t. That Ladyada tute seems to use i2c.

Yes, you are right. That RTC shield uses I2C.
I’m sorry, but when I read the below code, I was thinking that the communication between Arduino and DS1307 would via serial, instead of i2c. The library RTCLib, referred on that post, uses the “Wire Class” (http://arduino.cc/en/Reference/Wire), that allows Arduino’s communication with I2C / TWI devices.

void setup () {
   Serial.begin(57600);
   Wire.begin();
   RTC.begin();
   if (! RTC.isrunning()) {
     Serial.println("RTC is NOT running!");
     // following line sets the RTC to the date & time this sketch was compiled
     //RTC.adjust(DateTime(__DATE__, __TIME__));
  }
}

void loop () {
    DateTime now = RTC.now();
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    ...
    ...
}

:grin: