# Serial communication Error

**URL:** <https://forum.arduino.cc/t/serial-communication-error/1325544>\
**Category:** Due\
**Created:** [November 25, 2024, 8:00am UTC](https://forum.arduino.cc/t/serial-communication-error/1325544 "2024-11-25T08:00:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![inakamono196401](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/inakamono196401/32/1116138_2.png) [@inakamono196401](https://forum.arduino.cc/u/inakamono196401)\
**Post date:** [November 25, 2024, 8:00am UTC](https://forum.arduino.cc/t/serial-communication-error/1325544/1 "2024-11-25T08:00:30Z")

</div>

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);  
}

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [November 25, 2024, 8:01am UTC](https://forum.arduino.cc/t/serial-communication-error/1325544/2 "2024-11-25T08:01:22Z")

</div>

Welcome to the forum

> [@inakamono196401](#):
>
> ---------------------------Source -----------------------------

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'  
  
Use **code tags** (the \< CODE/ \> icon above the compose window)&nbsp;to make it easier to read and copy for examination   
  
[https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum)

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [November 25, 2024, 8:25am UTC](https://forum.arduino.cc/t/serial-communication-error/1325544/3 "2024-11-25T08:25:10Z")

</div>

Your code does not compile. After fixing the obvious errors, it fails on the _Serial.println()_ with

```plaintext
Compilation error: call of overloaded 'println(u_char [20])' is ambiguous

```

You can't print an array of unsigned characters like that.

The compiler is also not too happy with `while (num = Serial1.available())`. I suggest that you set the _Compiler warnings_ under file / preferences to _All_ and check the results.

---

<div class="post-metadata">

**Author:** ![inakamono196401](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/inakamono196401/32/1116138_2.png) [@inakamono196401](https://forum.arduino.cc/u/inakamono196401)\
**Post date:** [January 21, 2025, 1:20am UTC](https://forum.arduino.cc/t/serial-communication-error/1325544/4 "2025-01-21T01:20:37Z")

</div>

I was tried to execute using another PC. It is correctly operated.  
I think that USB port is broken or the USB diriver is bad. My PC is recently introduced. I re-install Arduino IDE. It can operate.

Thanks a lot,

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 20, 2025, 1:21am UTC](https://forum.arduino.cc/t/serial-communication-error/1325544/5 "2025-07-20T01:21:35Z")

</div>

Closed on July 20, 2025, 1:21am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
