Is it normal for the serial monitor to print garbage when baudrate is greater than 9600? Im using this code to read an incremental encoder and I think it would be better to have optimum communication by increasing the baud rate (correct me if Im wrong).
Gilgamesh90:
Is there really an improvement in communication increasing the baud rate?
I notice that I can (more) easily overflow the serial monitor if the baud rate is too slow.
in your example it is printing every turn of loop()... the timing of getting through that function is milliseconds, not seconds so you end up sending more data than serial can print at that speed... an overflow.
I've never seen the serial buffer overflow. I have seen it slow up the processing by waiting for the serial port to transmit the data. The slower the baud rate, the longer the delay to send the data.
I'm with Coding Badly. I use 115200 most of the time, unless the data is sent so fast you can't read it fast enough.
No, as I had problems with the speed (I'm using interrupts), I just tried a couple of times with the highest one and, as I got just garbage, I gave up.
vffgaston:
No, as I had problems with the speed (I'm using interrupts), I just tried a couple of times with the highest one and, as I got just garbage, I gave up.
Where are you using interrupts? Are you trying to send characters to the serial monitor in the interrupt function?
vffgaston:
No, as I had problems with the speed (I'm using interrupts)
That may be your problem. The hardware serial port also uses interrupts, and the serial interrupt handlers can't run at the same time as your other interrupt handlers. Serial port I/O is timing critical and even quite a small delay might be enough to corrupt the data stream. The higher the serial port speed, the more sensitive it would be to timing errors caused by delays introduced by your other interrupt handlers.
That may be your problem. The hardware serial port also uses interrupts, and the serial interrupt handlers can't run at the same time as your other interrupt handlers. Serial port I/O is timing critical and even quite a small delay might be enough to corrupt the data stream. The higher the serial port speed, the more sensitive it would be to timing errors caused by delays introduced by your other interrupt handlers.
No. that's not the case. I tried it "standalone" (When possible I always try to isolate the code that is failing: This case just the Serial.begin(baud rate) and a single serial.print() instruction. No way)
I got
Serial.begin(115200)
Serial.print("any text")
to show garbage at the PC serial monitor despite the same such as 115200 being selected,
whenever the ambient environment temperature around a nano v.3 went over 35C
Do other arduino hardware types have the same limitation to ambient temperature?
The good news is that this fault was fully fixed by cooling ambient to 25C.