fosc = 1000000 MHz | ||||||
Bit Rate (bps) | U2Xn = 0 | U2Xn = 1 | ||||
---|---|---|---|---|---|---|
UBRR (dec) | UBRR (hex) | Error | UBRR (dec) | UBRR (hex) | Error | |
9600 | 6510416 | 0x635750 | 0.0% | 13020832 | 0xC6AEA0 | 0.0% |
Max. | 62500 Mbps | 125000 Mbps |
Legend: |
---|
Error rate is 0.5% or less off |
Error rate is within the recommended maximum error rate |
Error rate is in the lower half, between recommended and absolute max error rates |
Error rate is in the upper half, between recommended and absolute max error rates |
Error rate is outside of the absolute maximum error rate. |
Error rate is more than twice the absolute maximum error rate |
Recommended Maximum Receiver Bit Rate Error for Normal Speed Mode (U2X=0) | ||||
---|---|---|---|---|
D # (Data+Parity Bit) | Rslow(%) | Rfast(%) | Max. total error (%) | Recommended max. receiver error (%) |
5 | 93.20 | 106.67 | +6.67/-6.8 | ±3.0 |
6 | 94.12 | 105.79 | +5.79/-5.88 | ±2.5 |
7 | 94.81 | 105.11 | +5.11/-5.19 | ±2.0 |
8 | 95.36 | 104.58 | +4.58/-4.54 | ±2.0 |
9 | 95.81 | 104.14 | +4.14/-4.19 | ±1.5 |
10 | 96.17 | 103.78 | +3.78/-3.83 | ±1.5 |
Recommended Maximum Receiver Bit Rate Error for Double Speed Mode (U2X=1) | ||||
---|---|---|---|---|
D # (Data+Parity Bit) | Rslow(%) | Rfast(%) | Max. total error (%) | Recommended max. receiver error (%) |
5 | 94.12 | 105.66 | +5.66/-5.88 | ±2.5 |
6 | 94.92 | 104.92 | +4.92/-5.08 | ±2.0 |
7 | 95.52 | 104.35 | +4.35/-4.48 | ±1.5 |
8 | 96.00 | 103.90 | +3.90/-4.00 | ±1.5 |
9 | 96.39 | 103.53 | +3.53/-3.61 | ±1.5 |
10 | 96.70 | 103.23 | +3.23/-3.30 | ±1.0 |
I call this a "baud rate calculator", however, "baud rate" is technically an incorrect term. It should be called a "bit rate calculator". Because people misuse the term "baud" so frequently, many do not know there is a difference between "bit rate" and "baud rate". Since Atmel uses the term "baud rate" in their AVR manuals and data sheets, it seems natural to name this a "baud rate calculator", even though I know it's abuse of the word "baud". I use the term "baud rate" on the title, knowing it is wrong, so people would be able to find this page, when searching the web, (even Atmel uses "baud rate") however, all other references are as "bit rate".
NOTE about the UBRR register(s): Some AVRs only have a single UBRR register, while other AVRs have two UBRR registers. If your AVR has only 1 UBRR register, then you can check the box "Consider only 8-bit UBRR values as being valid" to have it show you when the UBRR value is out of range for your AVR. If your AVR handles a 12-bit UBRR value, then the UBRR value in hexadecimal will be helpful to you, because it will make it easier to find the UBRRH and UBRRL values (I'm sure you can figure out what goes where).
NOTE about XMEGA AVRs: The UBRR values generated, can be used as the BSEL value in the XMEGA AVRs, if and only if you set BSCALE to zero. If there is enough interest for this calculator to support the XMEGA series, then I will add BSCALE calculations to the list, but for now, there is no easy way to to calculate BSCALE without already knowing knowing what BSEL value you want to use, so it's computationally expensive to calculate.
How to use this page:
Without entering anything, you can get a list of the UBRR settings for many popular
clock speeds, and serial port bit rates.
What makes this program special, is the fact
that you can tell it what serial port bit rate you want, and it will tell you all the possible
clock speeds that will generate your desired serial port bit rate.
You can also give it a clock speed, and it will tell you all the possible
serial port bit rates that can be producted with that clock speed.
This is very handy when you are searching through your "junk pile", looking for
the right crystal, or oscillator to generate a given serial port bit rate.