Baud Rate Calculator
Calculate UART bit timing and baud rate error for any crystal.
| Baud | Bit time | Frame (8N1) |
|---|---|---|
| 110 | 9.091 ms | 90.909 ms |
| 300 | 3.333 ms | 33.333 ms |
| 600 | 1.667 ms | 16.667 ms |
| 1,200 | 833.333 µs | 8.333 ms |
| 2,400 | 416.667 µs | 4.167 ms |
| 4,800 | 208.333 µs | 2.083 ms |
| 9,600 | 104.167 µs | 1.042 ms |
| 14,400 | 69.444 µs | 694.444 µs |
| 19,200 | 52.083 µs | 520.833 µs |
| 38,400 | 26.042 µs | 260.417 µs |
| 57,600 | 17.361 µs | 173.611 µs |
| 115,200 | 8.681 µs | 86.806 µs |
| 230,400 | 4.340 µs | 43.403 µs |
| 460,800 | 2.170 µs | 21.701 µs |
| 921,600 | 1.085 µs | 10.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.
เครื่องมือที่เกี่ยวข้อง
- Resistor Color Code Calculator
Decode resistor color bands. Supports 4-band and 5-band.
- Ohm's Law Calculator
Calculate voltage, current, resistance, or power using Ohm's Law.
- Voltage Divider Calculator
Calculate output voltage for a resistor voltage divider.
- 555 Timer Calculator
Calculate frequency, duty cycle, and timing for 555 timer circuits.
- CRC Calculator
Calculate CRC checksums — CRC-8, CRC-16, CRC-32, and custom polynomials.