I use Arduino DUE on Arduino IDE 2.3.3. I am facing that Serial1 and Serial2 can't comunicate. I confirmed RX and TX on each Serial is connected to pin on Atmel CPU. when RX1 is received datas, read one and display it. But Data is displayed once after Reset, 2times is not displayed and freezing. Please give me a advise.
---------------------------Source -----------------------------
u_char tx_3b_on[13]= { 0x5A,0x0D,0x3B,0x01,0xC8,0x00,0x0A,0x00,0x0A,0x00,0x0A,0x00,0x00 };
u_char buf[20];
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
while (!Serial); // wait until Serial port (default) open
Serial1.begin(115200); /
while (!Serial1); //wait until Sreial Port (Serial1) open
delay(100);
Serial1.write(tx_3b_on, 13);
}
void loop() {
while (num = Serial1.available()) { // if data xist or not
Serial1.readBytes(buf,num); // read data
Serial.println(buf);
}
delay(100);
}