当前位置:网站首页>Bit synchronization process of CAN controller
Bit synchronization process of CAN controller
2022-07-23 13:18:00 【DingUXiu】
CAN The bit synchronization process of the controller
Last one : CAN Introduction to physical layer
Bit synchronization
CAN It belongs to asynchronous communication , There is no clock signal line , All nodes connected in the same bus network will be like serial communication , Use the agreed baud rate for communication , besides ,CAN The controller will also use “ Bit synchronization ” The way to resist interference 、 Absorption error , To realize the correct sampling of bus level , Make sure the communication is normal
For bit synchronization ,CAN The protocol decomposes the timing of each data bit into SS paragraph 、PTS paragraph 、PBS1 paragraph 、PBS2 paragraph , The length of these four paragraphs adds up to one CAN Length of data bits , The smallest unit of time after decomposition is Tq(Time Quantum), And a complete bit by 8~25 individual Tq form

This figure shows CAN The length of each data bit of communication is 19Tq, among SS Duan Zhan 1Tq,PTS Duan Zhan 6Tq,PBS1 Duan Zhan 5Tq,PBS2 Duan Zhan 7Tq, The signal The sampling point is located at PBS1 Segment and PBS2 Between paragraphs , By controlling the length of each segment , The position of the sampling point can be offset , In order to sample accurately
SS paragraph (SynchronizationSegment)
Synchronization segment , If the communication node detects that the jumping edge of the signal on the bus is included in SS Within segment , It means that the timing of nodes and buses is synchronous , When the node is synchronized with the bus , The bus level collected at the sampling point can be determined as the level of this bit ,SS The size of the segment is fixed to 1Tq
PTS paragraph (Propagate Time Segment)
Propagation time period , Segment used to absorb physical delays on the network , Is the delay of the input comparator on the bus 、 Output driver delay 、 Twice the sum of bus signal propagation delays ,PTS The size of the segment can be 1~8Tq
PBS1 paragraph (Phase Buffer Segment1)
Phase buffer section 1, It is mainly used to compensate the edge stage error , Its length of time can be extended during resynchronization , The initial size is 1~8Tq
PBS2 paragraph (Phase Buffer Segment2)
Phase buffer section 2, It is mainly used to compensate the edge stage error , Its length of time can be shortened when resynchronizing , The initial size is 2~8Tq
Baud rate
All communication nodes on the bus should be agreed 1 individual Tq The length of time and how many bits of data each occupy Tq, You can be sure CAN Baud rate of communication
for example , Suppose the 1Tq=1us, And each data bit is made up of 19 individual Tq form , It takes time to transmit one bit of data T1bit=19us, So the number of data bits that can be transmitted per second is :
1 ∗ 1 0 6 / 19 = 52631 ( b p s ) 1*10^6/19 = 52631(bps) 1∗106/19=52631(bps)
The number of data bits that can be transmitted per second is the baud rate in communication
Synchronization process
CAN Data synchronization is divided into Hard sync and To resynchronize , Hard synchronization only exists “ Frame start signal ” It works , It is impossible to ensure that the subsequent bit timing is synchronized , The resynchronization method can solve the subsequent synchronization problem
Hard sync
CAN When the node sends data through the bus , First, it will send a signal indicating the beginning of communication ( Frame start signal ), The signal is a falling edge from high to low ,CAN When the communication node on the bus does not send data , Will always detect the signal on the bus
When a frame start signal appears on the bus , The communication node detects that the frame start signal of the bus is not in the internal timing of the node SS Paragraph scope , It is considered that the internal timing is not synchronized with the bus , The data collected at the sampling point is incorrect , So the nodes are adjusted in the way of hard synchronization , Put your bit sequence in SS Segment translation to the part of bus with falling edge , Get synced , After synchronization, the sampling point can collect the correct data

To resynchronize
Hard synchronization only works when there is a frame start signal , If it's in a long frame of data , When there is an offset between the node signal and the bus signal , There's nothing you can do with this synchronization
Resynchronization mode , Use the high to low level jump edge of ordinary data bits to synchronize ( The frame start signal is a special jump edge ), Resynchronization is similar to hard synchronization in that they both use SS Segment to test , The purpose of synchronization is to make SS Section contains the jump edge
The resynchronization method can be divided into two situations: leading and lagging , Jump along the bus with SS The relative positions of segments are distinguished
The first case of phase advance , The node jumps from the edge of the bus , It is detected that its internal timing is relatively ahead of the bus timing 2Tq, At this time, the controller is in the next bit sequence PBS1 Paragraph added 2Tq Length of time , Resynchronize the node and bus timing .

The second case of phase lag , The node jumps from the edge of the bus , It is detected that its timing is relatively lagging behind that of the bus 2Tq, At this time, the segment of the controller in the previous bit sequence decreases 2Tq Length of time , Get synced .

When resynchronizing ,PBS1 and PBS2 The length of time increased or decreased in is defined as “ Resynchronize compensation width SJW(ReSynchronization Jump Width)”
Generally speaking CAN The controller will limit SJW The maximum of , If the maximum is limited SJW=3Tq when , You cannot increase or decrease more than... In a single synchronization adjustment 3Tq Length of time , If there is need to , The controller can achieve synchronization through several small adjustments , When the controller is set SJW When the limit value is large , The error that can be absorbed increases , But the speed of communication will drop
边栏推荐
- Image processing image feature extraction and description
- Opencv image processing (Part 1): geometric transformation + morphological operation
- Beifu and C transmit real type through ads communication
- Opencv image processing (medium) image smoothing + histogram
- What is the reason for the failure of video playback and RTMP repeated streaming on easygbs platform?
- 国信证券软件开户是安全吗?信息会不会泄露?
- 太空射击 Part 2-3: 子弹与敌人碰撞处理
- Talk about study and work -- Qian Xuesen
- Beifu PLC and C transmit int type variables through ads communication
- Beifu PLC and C transmit string array type variables through ads communication
猜你喜欢

成功 万象奥科与CODESYS技术联合调测

虚拟内存技术的来龙去脉(上)

EasyGBS平台出现录像无法播放并存在RTMP重复推流现象,是什么原因?

OpenCV图像处理(下) 边缘检测+模板匹配+霍夫变换

Record a reptile question bank

时间复杂度总结(Ο是渐进上界,Ω是渐进下界,p,np,np-hard,NPC问题)

com.mysql.cj.jdbc.exceptions. MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value:

Unity 模型显示到UI前面,后面的UI抖动

高压MOS管KNX42150 1500V/3A 应用于变频器电源-逆变器等

Complex networks - common drawing software and libraries
随机推荐
迷茫、工作没动力? 职业发展没希望? 看这篇文章就够了
我为大厂怒刷的《100道Android面试题》
Shooting games lesson 1-2: using sprites
com.mysql.cj.jdbc.exceptions. MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value:
Signal integrity (SI) power integrity (PI) learning notes (XXXI) power distribution network (III)
第九天笔记
高压MOS管KNX42150 1500V/3A 应用于变频器电源-逆变器等
方法区、永久代、元空间的关系
Es common operations
PostgreSQL k8s deployment template
力扣 729. 我的日程安排表 I
Opencv image processing (Part 1): geometric transformation + morphological operation
设计思维的“布道者”
倍福PLC和C#通过ADS通信传输bool类型变量
Why build a local Yum warehouse?
Introduction to JVM memory model
第七天笔记
Beifu PLC and C transmit int array type variables through ads communication
OpenCV图像处理(中) 图像平滑+直方图
北汇信息12岁啦|Happy Birthday