Serial Link from Arduino nano to Arduino mega 2560

Hi All,

I would like to test that I'm doing the right thing but failing at the first hurdle.

I want to send a Serial message from an Arduino Nano to a Arduino Mega 2560.

I have joined the the ground pin on both units together and I have joined the TX pin of the Nano to the RX pin of the Mega.

If I use a Serial.write command on the nano and then open up the serial monitor on the mega (still connected to my PC) should I be able to read it or do i need to do something else?

Cheers Steve

The Mega RX pin is an input, not an output. So the serial monitor will never see anything. Currently your connecting two outputs (the nano and the Mega's on board stuff) to one input. Never do that as you might blow an output when one output is sending a 1 and the other one is sending a 0.

You need to do something else :wink:

The Mega has 4 serial ports. Connect TX/RX of the nano to RX/TX of one of Serial1/2/3 of the mega. Write a small program for the Mega to read Serial1/2/3 and send received data to the serial monitor using Serial.

Thanks Sterretje,

I now know that I can communicate over serial to an Arduino and see the results on a PC which is exactly what I wanted but the reason I was doing this is because I'm attempting to understand a PIC microcontroller.

I've tried the exact same thing with a PIC connected to the Mega and it doesn't work. I've connected a scope to the TX pin of the PIC so I can tell I'm outputting signals so I was wondering do I need to match the packet structure of the Arduino serial communications and if so do you know what they are? I'm currently outputting Start bit, LSB Data MSB Stop bit with the PIC.

As far as I know that is the standard. And from the 2560 datasheet

22.4 Frame Formats
A serial frame is defined to be one character of data bits with synchronization bits (start and stop bits), and optionally
a parity bit for error checking. The USART accepts all 30 combinations of the following as valid frame formats:
• 1 start bit
• 5, 6, 7, 8, or 9 data bits
• no, even or odd parity bit
• 1 or 2 stop bits

A frame starts with the start bit followed by the least significant data bit. Then the next data bits, up to a total of
nine, are succeeding, ending with the most significant bit. If enabled, the parity bit is inserted after the data bits,
before the stop bits. When a complete frame is transmitted, it can be directly followed by a new frame, or the communication
line can be set to an idle (high) state. Figure 22-4 illustrates the possible combinations of the frame
formats. Bits inside brackets are optional.