Table of Contents
What is CAN Bit Timing?
Bit timing in CAN is all about ensuring that every node on the network can correctly interpret the bits being transmitted. This synchronization is crucial for maintaining the integrity and efficiency of data communication.
What is CAN Bit Segmentation?
Each bit in a CAN frame is divided into several segments:
- Synchronization Segment (Sync_Seg): This is the part where the actual synchronization occurs. It’s always one-time quantum (TQ) long and helps align the clocks of all nodes on the network.
- Propagation Segment (Prop_Seg): This segment compensates for the physical delay in signal propagation across the network.
- Phase Segment 1 (Phase_Seg1): This is used to compensate for edge phase errors by lengthening the bit time if necessary.
- Phase Segment 2 (Phase_Seg2): Similar to Phase_Seg1, but it shortens the bit time if necessary.
Each of these segments is made up of a certain number of time quanta (TQ), which are the smallest time units in a CAN network.
What is Sample Point in CAN Protocol?
The sample point is a critical point within the bit where the bus level is read and interpreted as a logical value. Here’s why it’s so important:
- Accurate Bit Reading: The sample point is where the CAN controller reads the bit value. It is crucial to set the sample point accurately to minimize errors due to signal noise or other disturbances on the bus.
- Preferred Value: Typically set at 87.5% of the bit time, this value is preferred by protocols like CANopen and DeviceNet. This means that the bit is sampled after 87.5% of its duration has passed.
- Adjustable Range: The sample point can vary from 50% to 90% of the bit time, allowing flexibility depending on the network requirements and conditions. For example, ARINC 825 uses a default value of 75%.
- Noise Minimization: Setting the sample point correctly helps in minimizing the impact of signal noise. Sampling too early or too late can lead to incorrect bit interpretation, especially in noisy environments.
Understanding Bit Rate and Bit Timing of CAN Technology
Bit Rate
The bit rate in CAN communication refers to the speed at which data is transmitted over the CAN bus, typically measured in bits per second (bps). The bit rate is a crucial parameter because it determines how quickly data can be sent and received between nodes on the network. Common bit rates in CAN systems include 125 kbps, 250 kbps, and 500 kbps, with some systems operating at even higher speeds, such as 1 Mbps.
Bit Timing
Bit timing in CAN communication is the precise control of the duration and positioning of each bit transmitted on the bus. Proper bit timing ensures that all nodes on the network sample the bits at the same point, leading to accurate and synchronized data transmission. Bit timing is divided into several segments within each bit time, which collectively ensure robust and reliable communication.
How Bit Timing Ensures Synchronization
To maintain synchronization, the CAN controller can adjust the length of a bit by an integral number of time quanta (TQ). The maximum value of these adjustments is termed the Synchronization Jump Width (SJW).
- Hard Synchronization: Occurs on the recessive-to-dominant transition of the start bit. The bit time is restarted from this edge.
- Resynchronization: Occurs when a bit edge doesn’t occur within the Sync_Seg in a message. One of the Phase Segments is shortened or lengthened, depending on the phase error, up to the SJW.
Factors Affecting Bit Rate
Four primary factors influence the CAN bit rate:
- Oscillator Tolerance: Variations in the oscillator frequency can affect the timing accuracy. High-precision oscillators are essential for maintaining a stable bit rate.
- Propagation Delay: The physical length and quality of the CAN bus can introduce delays. Prop_Seg is adjusted to compensate for these delays.
- Network Load: Heavy network traffic can lead to delays and timing issues. Proper network design and bit timing configuration help mitigate these problems.
- Bus Length: Longer bus lengths introduce more propagation delay, requiring adjustments in the Prop_Seg to maintain synchronization.
Prescaler Division in CAN Technology
The prescaler is used to divide the clock frequency to generate the required clock frequency for CAN. For example, if the clock frequency is 48 MHz and we need an 8MHz CAN clock, the prescaler value would be 6.
How the Prescaler Division Works
- Clock Frequency: The original clock frequency provided by the oscillator.
- Prescaler Value: The value by which the original clock frequency is divided to achieve the desired CAN Clock Frequency.
IMPORTANT
The CAN system clock is chosen so that the desired CAN bus Nominal Bit Time (NBT) is an integer number of time quanta (CAN system clock periods) from 8 to 25.
What is Time Quanta in CAN Technology
- Definition: The time quantum (tQ) is the basic time unit in CAN bit timing. It is derived from the CAN system clock divided by the prescaler.
- Calculation:
For example, if the CAN system clock is 48 MHz and the prescaler is set to 6, then:
What is Nominal Bit Time (NBT) in CAN Technology?
- Definition: The Nominal Bit Time (NBT) is the total duration of a single CAN bit, measured in time quanta (tQ). It is the sum of the time segments within a bit period: Sync_Seg, Prop_Seg, Phase_Seg1, and Phase_Seg2.
- Components:
- Sync_Seg: The synchronization segment, always 1 tQ.
- Prop_Seg: The propagation delay segment, compensates for the signal propagation delay.
- Phase_Seg1: The first phase segment, can be adjusted to resynchronize the clock.
- Phase_Seg2: The second phase segment, also adjustable for resynchronization.
- Calculation:
Practical Example of Bit Timing Calculation
For calculating Bit Time and Segmentation, some important parameters are taken into account before starting the calculation.
Parameters:
- Bit rate
- MCU Clock/Oscillator Frequency
- Bus length
- Bus propagation delay
- Propagation delay of TxD plus RxD offered by CAN Transceiver
But, usually, values like total propagation delay offered by CAN transceiver, Bus length, and Bus propagation delay, are pre-defined values in their hardware datasheet.
Question:
Conclusion
Understanding CAN bit timing and how the bit rate is adjusted is crucial for ensuring reliable communication in a CAN network. By properly configuring the timing parameters and taking into account factors like oscillator tolerance, propagation delay, network load, and bus length, you can achieve efficient and accurate data transmission. The sample point, synchronization, and prescaler division all play vital roles in maintaining the integrity and efficiency of the CAN communication. If you have any doubt, feel free to ask.
CAN Technology Handson Course
CAN Technology Handson Course
More Blogs to Read
Introduction to CAN Communication
Basics About CAN technology and communication protocol || CAN frame formats || CAN protocol types and architecture
What is E/E Architecture in Automotive
Ever Though how electronics is implemented and arranged in a vehicle???? Explore this blog to get the Answer| ||| What is E/E Architectute || Domain Architecture || Zonal Architecture
What are functional domains in automotive and their different types?
Now in This blog, we are going to dip deeper into different electronics sub-systems in an automotive vehicle.
Author: Rohan Singhal
Author