UART's not working with my MEGA

So I got a Eelegoo Mega (clone on Arduino Mega) of Amazon. This is the link https://www.amazon.com/Elegoo-Board-ATmega2560-ATMEGA16U2-Arduino/dp/B01H4ZLZLQ/ref=sr_1_sc_3?ie=UTF8&qid=1506749197&sr=8-3-spell&keywords=eelegoo+mega And as soon as I got it right out of the box none of the serial ports are working. I hooked up a LCD display and did not do anything. I used the same kind of wiring and code for my Uno and Arduino 101(Intel) it worked just fine. I did change the board from the board manager. Can anyone tell me what is wrong with my board. This question is not related but help would be great, I am building a Smart car with 3 Ultrasonic senors, a GPS, a texas instruments motor driver, and a Compass. I wanted to know if a Arduino Mega or Raspberry Pi is better for my project.

As you have not posted the program you tried on your Mega I have no idea what you were trying to do.

A clear diagram showing how you had everything connected would also be a great help. A photo of a simple pencil drawing is probably the best thing. Please do NOT use Fritzing.

...R

Which UART? All of them or the one that provides the USB connectivity.

Is your board recognised by the OS (which OS)? Did you try the loopback test? What's the result? If the board used the CH340 chip for USB communication, you probably need to install a driver for that.

How does your LCD relate to UARTs? You will have to be able to load code to test the LCD. And if the UART that is connected to the USB through the USB chip does not work, you will not be able to do so,

Hi.

tib0n3: So I got a Eelegoo Mega (clone on Arduino Mega) of Amazon.

This is the link https://www.amazon.com/Elegoo-Board-ATmega2560-ATMEGA16U2-Arduino/dp/B01H4ZLZLQ/ref=sr_1_sc_3?ie=UTF8&qid=1506749197&sr=8-3-spell&keywords=eelegoo+mega

And as soon as I got it right out of the box none of the serial ports are working.

I hooked up a LCD display and did not do anything. I used the same kind of wiring and code for my Uno and Arduino 101(Intel) it worked just fine. I did change the board from the board manager. Can anyone tell me what is wrong with my board.

This question is not related but help would be great, am building a Smart car with 3 Ultrasonic senors, a GPS, a texas instruments motor driver, and a Compass. I wanted to know if a Arduino Mega or Raspberry Pi is better for my project.

Sorry, but had to spread it to point form to see what you were getting at.

The smart car, what size?

Tom.. :)

So if this example is not working then I have another one. I connect my Neo-6m GPS module to Pins 18(rx) and 19(tx). And I used this sample code

void setup() {
 Serial.begin(9600);
 Serial1.begin(9600);
}

void loop() {
  if(Serial1.available())
  Serial.write(Serial1.read());
}

And I have not got printed anything to the Serial monitor. Any help would be appreciated

So you can upload. Which means that the uart connected to the usb chip works.

Start simpler. Connect 18 and 19; nothing else connected except for the PC.

void setup()
{
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop()
{
  // if something available from the PC
  if(Serial.available() > 0)
  {
    // send it to serial 1
    Serial1.write(Serial.read());
  }

  // if something available on serial 1
  if(Serial1.available() > 0)
  {
    // send it to PC
    Serial.write(Serial1.read());
  }
}

The above should echo what you enter in serial monitor.

Not compiled, not tested.
Compiled and tested on a Leonardo; should behave the same on a Mega.

Dear sterretje,

Thx for you help. But I still have the same result from before, nothing printed on the serial monitor. I am think that since this is a clone it might not work. And also should I lean towards a Pi than a Arduino for my project? Or just buy the real Mega. Again any help would be appreciated.

Hi, Have you got the speed on the monitor the same as the speed in the code?

Tom.. :)

If you did connect pins 18 and 19 together, I don't know what is wrong. Maybe incorrect baudrate on serial monitor? Should be 9600.

Does a simple echo work? If you can upload, it should.

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  // if something available from the PC
  if(Serial.available() > 0)
  {
    // send it back to PC
    Serial.write(Serial.read());
  }
}

And else I really don't know.

Yes I have. 9600 baud right?

I will dig more into this and tell if I had any success

sterretje: If you did connect pins 18 and 19 together,

I don't think you meant "together"

@tib0n3, do you have a GND connection between the Arduino and the GPS?

Do you have the GPS Tx connected to the Arduino Rx and vice versa?

...R Serial Input Basics

Robin2: I don't think you meant "together"

I did mean together. This was for the echo exercise in reply #5.No gps involved.

sterretje: I did mean together. This was for the echo exercise in reply #5.No gps involved.

Apologies. I had missed Reply #5

...R