Baud Rate Pros/Cons

I'm very new to arduino and learning about the serial port. It's been explained that a faster baud rate will refresh faster over the serial port. So obviously, a faster rate is better. Other than computation power, is there any other downsides to having a fast baud rate for your program? Will it effect the longevity of my arduino by having it on the max (2,000,000)?

Thanks. Sorry for the simple question.

Affect longevity? No. The uC core doesn't care what it's running.

Perceived performance? Yes. 115,200 (and perhaps 230,400, with a different serial program on the PC) will get data out fast and still leave processing time to do other stuff. 2,000,000 is not going to leave much processing time for anything else, so the program might seem less responsive depending on the sketch.

I use 1,000,000 quite regularly.

CrossRoads:
2,000,000 is not going to leave much processing time for anything else, so the program might seem less responsive depending on the sketch.

This, I don't understand. Why does doing something faster leave less time?

CrossRoads:
Affect longevity? No. The uC core doesn't care what it's running.

Perceived performance? Yes. 115,200 (and perhaps 230,400, with a different serial program on the PC) will get data out fast and still leave processing time to do other stuff. 2,000,000 is not going to leave much processing time for anything else, so the program might seem less responsive depending on the sketch.

DKWatson:
I use 1,000,000 quite regularly. This, I don't understand. Why does doing something faster leave less time?

If RX/TX happens to be on interrupt at 2000000 Bd, the MCU is repeatedly interrupted at 5 us interval. Is there anything useful that the MCU can do in this 5 us period?

GolamMostafa:
If RX/TX happens to be on interrupt at 2000000 Bd, the MCU is repeatedly interrupted at 5 us interval. Is there anything useful that the MCU can do in this 5 us period?

That would be 0.5us?

The interrupts only occur if there is incoming data. If you were polling, you would need to check. Bottom line is you're only going to check Serial.available() as often as you deem necessary, regardless of baud rate. Transmission is a different beast, set it, forget it, get on with other things. You don't really care about the speed.

DKWatson:
That would be 0.5us?

Considering 10-bit frame length; one frame time comes about (1/2000000)10 = 510-6 s = 5us? RXRDY bit becomes active at the end of a valid frame reception, which in turn interrupts the MCU.

DKWatson:
The interrupts only occur if there is incoming data.

Or outgoing.

Sometimes it is desirable for your over run rate to be limited by the serial speed. And sending 2Mb may have a performance impact on whatever it is connected to. The computer
Labs at school used to limit their online speeds to 2400s, for fear of performance impact of,higher speeds.

[quote author=Coding Badly link=msg=3887607 date=1538113809]
Or outgoing.
[/quote]True, but you don't deal with the outgoing stream. Once you've passed your data off to the transmit buffer, it happens 'behind the green door'.

DKWatson:
but you don't deal with the outgoing stream.

But the cycles needed to handle the transmit interrupts still eat up the total processing time.

With two high frequency interrupt sources there will be not much non-interrupt time left, if any.

Depends on the traffic. Of the user wants to take advantage of high speed by sending reams of data, for sure the processor will be consumed. If we are talking about burst data, big difference.

DKWatson:
… Once you've passed your data off to the transmit buffer, it happens 'behind the green door'.

Uhm - I think you wanna drop that metaphor. Anyone over a certain age is going to wince reading it.

alto777