Go Down

Topic: Multiple Software Serial (Read 1 time) previous topic - next topic

mattcf

May 31, 2011, 07:12 am Last Edit: May 31, 2011, 07:18 am by mattcf Reason: 1
I am trying to like 3 arduino boards (1 main board and to breadboarded arduinos I built)  Is it possible to use multiple software serials to link the 2 breadboards to the Arduino Main board.


The 2 breadboards are collecting data that I want the mainboard to handle.

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

mattcf

How would I go about doing it then (just the basics)

CrossRoads

Similar to regular serial:

Serial.begin(speed);
Softserial1.beging(speed);  or along those lines - search the forum for NewSoftSerial, you will find examples, need to define the pins used, etc.
Softserial2.begin(speed);
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


PaulS

Only one instance of NewSoftSerial can be active (buffering incoming data) at one time. So, it will only be possible to do what you want if you have handshaking implemented. That is, the master activates one instance of NewSoftSerial and tells the slave to send data. Then, the master activates the other instance of NewSoftSerial and tells the other slave to send data.

Slaves store data between uploads, and send everything they have buffered when called.
The art of getting good answers lies in asking good questions.

mattcf

Thank you for helping, I think I got it working now.  There was not alot of information I could find about using multiple Software Serials.

Go Up