supdate: I think Serial1 *might* be working with this mega serial test sketch, although the behavior is still odd..It can send data just fine, but receiving data isn't working. (Serial1 read data shows up in Serial main read, same for Serial2, etc.) sketch here:
https://www.arduino.cc/en/Tutorial/MultiSerialMega
Again, the same sketch works just fine with my Arduino Due. Seems like these ports don't really behave like a mega. anyone care to run this sketch and let me know if you get it working?
-----------------------------------------------------------------------------------
Has anyone found any solution to this topic?
I've been trying all sorts of test sketches and couldn't find any connection to those onboard pins - except I found the default Serial (RX0, TX0) are the pins second to the left. I am using a FTDI 232R reader.
I tried the same sketches on Arduiono Due (I don't have another Mega) and all the serial ports are sending data successfully with Serial1, Serial2, Serial3. But the same sketch doesn't work for the Rambo serial pins, no matter which pair I tried.
Here's Rambo schematic:
http://reprap.org/wiki/File:Rambo1-1-schematic.png
Here's pin assignment documentation:
http://reprap.org/wiki/Rambo_development
The Arduino Mega has three additional serial ports: Serial1 on pins 19 (RX) and 18 (TX), Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX).
I'm not very good at reading schematics, but looking at Rambo's Serial Extension on the schematics, I figure Serial, Serial1, Serial2, Serial3 all seems to be straight forward to onboard Serial pins. Am I right? In my tests, only Serial (RX0, TX0) works.
My sketches are pretty simple, just writing numbers to all four Serial ports. In fact, I even tried a software serial on pin 12, 13 and I couldn't get any data on any of the onboard serial ports, either.
Any help would be appreciated. The purpose here is to send some monitoring data to alternative displays.
Code: Select all
//Software Serial doesn't work
//#include <SoftwareSerial.h>
//SoftwareSerial softSerial(12, 13);
void setup(){
Serial.begin(9600);
Serial1.begin(9600); // set up Serial library at 9600 bps
Serial2.begin(9600); // set up Serial library at 9600 bps
Serial3.begin(9600); // set up Serial library at 9600 bps
// softSerial.begin(9600);
// softSerial.println("soft serial started at 12,13 RX2, TX2");
}
void loop() {
int output = 300;
Serial.println("start");
Serial1.println(500); // I tried strings here doesn't work either
delay(500);
Serial2.println(500);
delay(500);
Serial3.println(500);
delay(500);
// softSerial.println(330);
// softSerial.println("found RX2 TX2");
Serial.println("end");
}