Pages: [1]   Go Down
Author Topic: Serial.Begin statements  (Read 353 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi...

         I have a question regarding the use of multiple serial.begin () statements in one program? I have a program that requires it to begin a (9600
and the other to begin at (19200). What I want to do is have a serial.begin(19200) to make a phone call. The second serial.begin(9600) will "speak" something saved from an SD card, and I will send the audio via a cable from one shield to the other.

My question is: Can I have multiple serial.begins activated at the same time? And how can I have them interact with each other?

Thanks
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 63
Posts: 6055
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How will the actual devices know when the incoming data isn't for them?
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Westbrook, CT
Offline Offline
Full Member
***
Karma: 2
Posts: 139
"Why should I bother with made-up games when there are so many real ones going on." (c) Kurt Vonnegut
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There are four functions in the Arduino IDE:

Code:
Serial.begin();
Serial1.begin();
Serial2.begin();
Serial3.begin();

(Serial4.begin(); and on doesn't exist)

This will permit you two establish several RX & TX lines. However this only works on the Arduino Due and Mega because they have more than on pair of RX TX pins.()

Here are the pins n the Due for example:
Serial: 0 (RX) and 1 (TX)
Serial 1: 19 (RX) and 18 (TX)
Serial 2: 17 (RX) and 16 (TX)
Serial 3: 15 (RX) and 14 (TX)


Multiple RX and TX communication is not supported on other Arduino Boards, sorry. smiley
« Last Edit: March 19, 2013, 01:00:49 pm by mixania » Logged

Arduino Uno R3
Mac OSX Lion


Austin, TX
Offline Offline
Faraday Member
**
Karma: 63
Posts: 6055
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Multiple RX and TX communication is not supported on other Arduino Boards, sorry. smiley
Not in hardware. 

There is still SoftwareSerial available.  Depending on the device, this may be sufficient.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
There is still SoftwareSerial available.  Depending on the device, this may be sufficient.

So how would I go about using the SofwareSerial?
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 63
Posts: 6055
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://arduino.cc/en/Reference/SoftwareSerial
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Westbrook, CT
Offline Offline
Full Member
***
Karma: 2
Posts: 139
"Why should I bother with made-up games when there are so many real ones going on." (c) Kurt Vonnegut
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Not in hardware.  

There is still SoftwareSerial available.  Depending on the device, this may be sufficient.

Didn't know that it is possible through software, but here is what the Library also says:

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

It talks about the Mega and the Leonardo but not about Arduino UNO for example. So is it actually not compatible with all models?
Logged

Arduino Uno R3
Mac OSX Lion


Austin, TX
Offline Offline
Faraday Member
**
Karma: 63
Posts: 6055
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It was created for the Uno.  Many, many projects use it.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Pages: [1]   Go Up
Jump to: