Hello,
I’m using the arduino mega 2560 and I want to use the additional serial ports (serial pin 18 Tx) to output several characters.
I’m using an additional com Port (USB2Serial device) to verify the incoming data.
Unfortunately the receiving characters are not the same as the characters that were sent, although the baudrate is exactly the same (38400 baud).
See receiving data in the attachments please (com3 incoming data.png).
The code:
#include <SoftwareSerial.h>
#define rxPin 19
#define txPin 18
SoftwareSerial mySerial(rxPin, txPin); // RX, TX
void setup() {
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
mySerial.begin(38400);
}
void loop() {
mySerial.println("test Tx on pin18");
}
I connected pin 18 (arduino serial) to the Rx pin 2 (USB2Serial device), pin 19 (arduino serial) to the Tx pin 3 (USB2Serial device) and GND (arduino) to pin 5 (USB2Serial device). So that seems fine I think…
Regards,
JCO