Stax
Tools

Baud Rate Calculator

Calculate UART bit timing and baud rate error for any crystal.

Bit time
104.167 µs
Frame size
10 bits
Frame time
1.042 ms
Effective throughput
7.68 kbps
BaudBit timeFrame (8N1)
1109.091 ms90.909 ms
3003.333 ms33.333 ms
6001.667 ms16.667 ms
1,200833.333 µs8.333 ms
2,400416.667 µs4.167 ms
4,800208.333 µs2.083 ms
9,600104.167 µs1.042 ms
14,40069.444 µs694.444 µs
19,20052.083 µs520.833 µs
38,40026.042 µs260.417 µs
57,60017.361 µs173.611 µs
115,2008.681 µs86.806 µs
230,4004.340 µs43.403 µs
460,8002.170 µs21.701 µs
921,6001.085 µs10.851 µs

วิธีการทำงานของเครื่องคำนวณ Baud Rate

เครื่องคำนวณ baud rate คำนวณพารามิเตอร์การกำหนดเวลา UART รวมถึงระยะเวลาบิต ระยะเวลาเฟรม ค่าเรจิสเตอร์ prescaler และเปอร์เซ็นต์ข้อผิดพลาด baud rate สำหรับความถี่นาฬิการะบบใดก็ตาม นักพัฒนา embedded ใช้เพื่อกำหนดค่า UART peripherals บน STM32, ESP32, AVR และไมโครคอนโทรลเลอร์อื่นๆ

Baud rate UART ที่พบบ่อยที่สุดคือ 9600, 19200, 38400, 57600, 115200, 230400, 460800 และ 921600 baud ที่ 9600 baud แต่ละบิตกว้าง 104.17 µs ที่ 115200 baud แต่ละบิตกว้าง 8.68 µs โปรโตคอล UART สุ่มตัวอย่างแต่ละบิตที่จุดกึ่งกลาง

เฟรม UART แบบ 8N1 มาตรฐานประกอบด้วย 1 start bit + 8 data bits + 1 stop bit = 10 bits ทั้งหมด ที่ 115200 baud ไบต์เดียวใช้เวลา 86.8 µs ในการส่ง ที่ 9600 baud ด้วย 8N1 ปริมาณงานสูงสุดคือ 960 ไบต์/วินาทีเท่านั้น

STM32 UART BRR = f_clock / baud_rate สำหรับ AVR 16 MHz ที่มี UBRR = (f_osc / (16 × baud)) − 1 baud rate 115200 ให้ UBRR = 7.68 — ปัดเป็น 8 ทำให้ได้อัตราจริง 111,111 baud และข้อผิดพลาด −3.5% ซึ่งเกินเกณฑ์ที่ปลอดภัยพอดี เครื่องคำนวณแสดงข้อผิดพลาดที่แน่นอนเพื่อให้เลือกระหว่าง double-speed mode หรือความถี่นาฬิกาที่เหมาะสมกว่า

คริสตัลทั่วไป 8 MHz, 16 MHz และ 12 MHz ไม่สามารถหารได้ลงตัวเพื่อสร้าง baud rate มาตรฐาน การใช้ 11.0592 MHz — คริสตัลที่ไม่เป็นมาตรฐานที่เลือกมาเพื่อความแม่นยำ UART โดยเฉพาะ — ให้ข้อผิดพลาด 0% ที่ 9600, 19200, 38400, 57600 และ 115200 baud

คำถามที่พบบ่อย

What is baud rate?
Baud rate is the number of symbol changes per second in a communication channel. For binary UART, 1 baud = 1 bit per second, so 9600 baud means 9600 bits per second.
What baud rate error is acceptable?
For UART communication, a baud rate error under 2% is generally acceptable. Above 3–5%, framing errors and data corruption can occur, especially with long frames.
Why do baud rates like 9600 and 115200 exist?
Standard baud rates are derived from UART crystal frequencies (e.g., 1.8432 MHz) that divide evenly to produce common rates. Crystals like 11.0592 MHz were chosen specifically because they produce 0% error at standard baud rates.

เครื่องมือที่เกี่ยวข้อง