June 19, 2025

Many engineers have a headache when choosing the baud rate. I read how to quickly solve the special baud rate calculation.

The stability of the CAN bus is influenced by numerous factors, among which the baud rate is a critical one. Many engineers often find themselves puzzled when choosing the appropriate baud rate. Today, we’ll discuss a quick way to solve the problem of calculating a specific baud rate. The CAN bus operates using asynchronous serial communication, meaning there’s no dedicated clock line to ensure synchronization between transceivers. Each transceiver determines the bus level based on the preset baud rate. Therefore, setting the correct baud rate is crucial for maintaining stable communication within the CAN bus. In the CAN bus, we can adjust the bit timing registers in CAN nodes to achieve communication at different baud rates. According to the CAN protocol, a bit time is divided into four segments: the synchronization segment, the propagation segment, and two phase buffer segments. The length of each segment can be expressed as an integer number of basic time units, which are derived from dividing the system's clock oscillator. The synchronization segment is positioned at the start of a bit, and CAN bus specifications state that the edge of the transition serves as the synchronization signal. However, there is a network propagation delay between the transmitting node sending a bit and the receiving node detecting it. The propagation segment compensates for this delay. Since the sampling point lies between the two phase buffer segments, adjusting these segments allows us to position the sampling point accurately, ensuring consistency across all bits. The adjustable range of the buffer segments is determined by the Sync Jump Width (SJW). After gaining a basic understanding of the CAN bus bit time segmentation, let’s explore how the baud rate of a node is set. Figure 2 below illustrates the bit timing characteristics register (CAN_BTR) of an ARM core. [Insert Image: CAN bit timing characteristic register structure] SILM (silent mode) and LBKM (loopback mode) are primarily used for debugging purposes. - **SJW (Sync Jump Width):** This affects the adjustable range of the phase buffer segment during resynchronization. - **TS2/TS1:** These define the allocation of two time periods within a bit time. - **BRP (Baud Rate Prescaler):** Determines the length of the basic time unit. For instance, a well-known car manufacturer's CAN communication standard states that when the communication rate is 125 kbps, single sampling should be used, with the sampling point positioned between 70% and 77%. The corresponding bit timing parameters can be found in Tables 1 and 2. [Insert Table 1: Communication rate and sampling point parameters] [Insert Table 2: Time division and Sync Jump Width options] The sampling point cannot be too early or too late. If it falls exactly on the rising or falling edge of a bit, it may lead to incorrect recognition. Thus, according to the CIA105 specification, the sampling point should ideally be around 87.5%. However, in practice, we typically choose between 75% and 85%. The Sync Jump Width (SJW) directly impacts the range of the phase buffer segment during resynchronization. Its value can be chosen between 1 and 4. Selecting 3 or 4 broadens the baud rate tolerance of the bus. The number of samplings can be either single or triple. Although triple sampling was initially designed to filter out noise on the bus, it often interferes with the SJW jump. As a result, single sampling is generally preferred in practical applications. Understanding the principles behind baud rate settings, we utilized ZLG Zhiyuan's baud rate calculation software to determine the bit timing parameters for a 25kbps baud rate. The results are illustrated in Figure 3. [Insert Image: 25kbps baud rate calculation parameters] Based on the principles discussed, we chose a set of parameters with a sampling point of 75%, SJW of 4, and a time share of 14, then verified them using ZLG's CAN card. - **Automatic baud rate identification:** Using CANScope to automatically detect the baud rate, the recognized baud rate was 25kbps. [Insert Image: Automatically detecting the baud rate] - **Sampling point testing:** Using CANScope to test the sampling point at the current baud rate, the result showed 75%. [Insert Image: Sampling point testing] - **Bit width tolerance testing:** Using CANScope to test the bit width tolerance at the current baud rate, the tolerance ranged from 24kbps to 26kbps, indicating excellent tolerance. [Insert Image: Bit width tolerance testing] - **Bit time testing:** Using CANScope’s eye diagram function to test the bit time at the current baud rate, the result was 40us, matching the expected bit time for a 25kbps baud rate. [Insert Image: Eye diagram testing] By verifying the baud rate register settings calculated by the baud rate calculator, the test results matched our expectations. Thus, when dealing with specific baud rates, we can swiftly compute the bit timing register parameter values using the baud rate calculator. Here are some additional parameters for reference: [Insert Table: Additional baud rate parameters] This approach not only simplifies the process but also ensures reliable communication across the CAN bus, making it easier for engineers to optimize their designs.

PV Connector

Pv Connector,Mc4 Connector,Solar Panel Connectors,Solar Connector

Sowell Electric CO., LTD. , https://www.sowellsolar.com