# possible UART clock freqencies supported by the atmega328p ?

which subset of the following UART clock freqencies is supported by the atmega328p (e.g., Arduino Nano), set by Serial.begin(x)?

230400, 460800, 500000, 576000, 921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000

Again I must say that I am not a technician.

but there nothing is written explicitely about the supported clock rates (I read and searched closely, but found nothing).

From another topic I assume 500,000 and 1,000,000 perhaps could be fine, but I'm not sure about that, and not about either different one.

So which of the above mentioned clock freqencies is supported by the atmega328p (e.g., Arduino Nano) by Serial.begin(x), understandable for non-technicians?

thank you! so:

115.2k,
230.4k,
(250k,)
0.5m,
1m,
2m

(y)

tito-t:
which subset of the following UART clock freqencies is supported by the atmega328p (e.g., Arduino Nano), set by Serial.begin(x)?

The UART on the 328p chip divides the clock by 16 or 8 depending in the U2X bit setting, then further divides it with the UBRR register to derive a baud rate.

For example, if you want 9600 baud and have a 16 MHz. crystal, it works like this:

Crystal: 16 MHz
U2X bit: SET
Divided by 8 = 2 MHz
((2000000 / 9600) - 1) = 207.333 = 207 (integer)

So, if you type "Serial.begin (9600)", your U2X bit gets set and the UBRR (16 bit) register is set to 207, giving you an ACTUAL baud rate of 9615.385 baud (only high by 0.160%).

Now, obviously you can figure out your max baud rate:

Crystal: 16 MHz.
U2X bit: SET
Divided by 8 = 2000000 Hz (2 MHz)
2000000 / 1 = 2 megabits / sec.

But wait, there's more!!!!

If you have an UNO board (or any other board with the 16U2 USB to serial interface), the best you will get reliably is 115200 baud. The 16U2 can't handle any faster.

If, however, you have a GOOD board like a Duemilanove or some other board with a decent USB to serial chip such as the FTDI 232R, then you can go the full 2 MHz serial rate no problem.

Realize though, that SOME "standard" baud rates, because of the oddball 16 MHz clock the Arduino uses, may be off by enough percent to cause data errors. If a crystal such as a 14.7456 or a 22.1184 had been used, then you would get integer perfect baud rates. Sadly though, trying to divide the 16 MHz clock into a baud rate doesn't always come out exact.

Hope this helps.

thank you, so would you confirm these clock rates for the 328p in principle?

115.2k,
230.4k,
(250k,)
0.5m,
1m,
2m

tito-t:
thank you, so would you confirm these clock rates for the 328p in principle?

Why don't you check them for yourself ?

Write the code to send some text to the serial port at a particular baud rate, check the accuracy of transmissions on a scope and the relaibilty of the reception with the device that is the other end of the link.

The wormfood calculator specifically shows 230.4kbps as "questionable to bad."

How do you expect a bunch of random people on the internet "confirming" something to do you any good, anyway?

tito-t:
thank you, so would you confirm these clock rates for the 328p in principle?

What part of my post did you not understand?

@krupski: tbh, your info you provided is far beyond my skills, I understand almost nothing of it at all, especially neither the calcuations nor what U2X and UBRR is. I am a non-technician and just a simple Arduino user. What I needed was just a definitive list as an answer to my top question about Serial.begin() and the set/subset of given/suported frequencies.

westfw:
The wormfood calculator specifically shows 230.4kbps as "questionable to bad."
How do you expect a bunch of random people on the internet "confirming" something to do you any good, anyway?

I do not know which sources or user posts or calculators or datasheets to trust or not - that's why I asked, especially because 230400 once had been suggested by a user whom I considered not to be a newbee.
So acc to your reply that is now expected to be wrong, so then there are just left the following IIUC...

which subset of the following UART clock freqencies is supported by the atmega328p (e.g., Arduino Nano), set by Serial.begin(x)?
230400, 460800, 500000, 576000, 921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000

(115.2k,) // not in the target set
(250k,) // not in the target set
0.5m,
1m,
2m

tito-t:
@krupski: tbh, your info you provided is far beyond my skills, I understand almost nothing of it at all, especially neither the calcuations nor what U2X and UBRR is. I am a non-technician and just a simple Arduino user. What I needed was just a definitive list as an answer to my top question about Serial.begin() and the set/subset of given/suported frequencies.

From my post:

Now, obviously you can figure out your max baud rate:

Crystal: 16 MHz.
U2X bit: SET
Divided by 8 = 2000000 Hz (2 MHz)
2000000 / 1 = 2 megabits / sec.

krupski:
From my post:

yes, thank you, the max is now clear, but eventually my question had been about the entire subset of the mentioned list:

which subset of the following UART clock freqencies is supported by the atmega328p (e.g., Arduino Nano), set by Serial.begin(x)?
230400, 460800, 500000, 576000, 921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000

But IIUC what westfw wrote then this part is also solved now, especially there is no value in between >= 115200 and <= 500000, and then just 1M and 2M.
Thanks @ all!