Hardware serial not working, SoftwareSerial is On my Uno-equivalent Arduino, a SoftwareSerial connection (on RX, TX = 8, 9) is working*, while a hardware serial connection to the same device, set up in the same way (but on pins RX, TX = 0, 1) is not working. Why is the hardware serial setup not working?

*By working I mean receiving a byte from the external device

Edit: as a simple example:

void setup() {
  Serial.begin(38000);
  pinMode(7, OUTPUT);
}

void draw() {
  if (Serial.available() &gt; 0) {
    Serial.read();
    tone(7, 440, 1000);
  }
}


The above, using Serial, doesn't work, whereas

#include &lt;SoftwareSerial.h&gt;

SoftwareSerial serial(8, 9);

void setup() {
  serial.begin(38000);
  pinMode(7, OUTPUT);
}

void draw() {
  if (serial.available() &gt; 0) {
    serial.read();
    tone(7, 440, 1000);
  }
}


does work.



I don't know if this helps, but connecting RX/TX through an LED to ground gave me the following, using Serial on (0, 1) and SoftwareSerial on (8, 9):

Serial
RX: bright
TX: bright
SoftwareSerial
RX: dim (but still lit)
TX: bright  

Is the fact that RX is dim using SoftwareSerial significant?
There may be several reasons


Be sure uC pin connect pin header
In setup part, you write Serial.begin(xxxx);
After serial begin, don't change this pins IO features(Input, output)


Please check that after if not solve, please share code