CN113688086A - Baud rate matching detection system of high-speed CAN transceiver for local network - Google Patents
Baud rate matching detection system of high-speed CAN transceiver for local network Download PDFInfo
- Publication number
- CN113688086A CN113688086A CN202110968661.3A CN202110968661A CN113688086A CN 113688086 A CN113688086 A CN 113688086A CN 202110968661 A CN202110968661 A CN 202110968661A CN 113688086 A CN113688086 A CN 113688086A
- Authority
- CN
- China
- Prior art keywords
- baud rate
- message
- error
- transceiver
- bit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 24
- 238000005070 sampling Methods 0.000 claims description 16
- 238000012163 sequencing technique Methods 0.000 claims 2
- 238000000034 method Methods 0.000 abstract description 7
- 238000013461 design Methods 0.000 description 5
- 230000001360 synchronised effect Effects 0.000 description 3
- CURLTUGMZLYLDI-UHFFFAOYSA-N Carbon dioxide Chemical compound O=C=O CURLTUGMZLYLDI-UHFFFAOYSA-N 0.000 description 2
- 125000004122 cyclic group Chemical group 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 229910002092 carbon dioxide Inorganic materials 0.000 description 1
- 239000001569 carbon dioxide Substances 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
- G06F13/4291—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a clocked protocol
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Communication Control (AREA)
Abstract
The invention discloses a baud rate matching detection system of a high-speed CAN transceiver for a local network, which belongs to the technical field of digital integrated circuits, and is characterized in that the system detects a wake-up message on a CAN bus, samples the message on the bus according to the baud rate configured in a wake-up frame configuration register, decodes the message, if a message error occurs once, an internal error counter automatically adds 1, when the error counter is accumulated to exceed a preset value, the message error interrupt is output to an external controller, the baud rate of the wake-up message is adjusted, if no message error occurs, the 1 is automatically reduced, the detection that the baud rate of the wake-up message is not matched with the baud rate configured in the wake-up frame configuration register in the transceiver is realized, the condition that the node cannot be woken up for a long time due to the problem of rate unmatched when a CAN network enables the local network function is avoided, and the counting of the error counter is carried out at the same time, the method can have certain tolerance to the error frame sent by the active node or the message error generated on the bus due to EMC.
Description
Technical Field
The invention belongs to the technical field of digital integrated circuit design, and particularly relates to a baud rate matching detection system applied to a high-speed CAN transceiver of a local network.
Background
The CAN bus is a serial data communication bus developed by Bosch company in Germany in the early 80 th 20 th century for solving data exchange among a plurality of control and test instruments in modern automobiles, and is widely applied to the fields of automobiles and industrial control at present due to good performance and unique design. In recent years, the heat of new energy automobiles is increasing continuously, the energy saving problem of automobiles is receiving attention, and especially in the new energy automobiles with 'cun-jin', the method is very effective for reducing the power consumption of the automobiles and reducing unnecessary energy loss. The push-out of a local network in the CAN bus means a significant reduction in power consumption, cost, wiring, and carbon dioxide emissions throughout the vehicle.
The local network in the CAN bus is the ability to allow some nodes to actively communicate, while the rest is in an inactive state or in a low power mode, and CAN monitor the bus "wakeup frame" (WUF). Upon proper reception of the WUF, the transceiver may activate the entire node. The WUF is sent by active nodes in the network to "wake up" other inactive nodes to enable certain functions in the CAN network. Such WUFs may address nodes individually or in groups. This allows the transceiver of the unaddressed node that receives the wake-up frame to ignore it and maintain the entire ECU in a low power state. This function is called "selective wake-up" and is standardized in the industry standard ISO 11898-6.
The wakeup frame is according to ISO 11898-1: the CAN frame of 2015, consisting of an identifier field (ID), a Data Length Code (DLC), a data field and a Cyclic Redundancy Check (CRC) code and delimiters thereof. Compared with the traditional transceiver, the high-speed CAN transceiver applied to the local network needs to decode the received CAN message, identify the frame structure of the CAN message, compare the frame structure with the ID, DATA and CRC check codes in the wake-up frame configuration register, if the frame structure is matched and no message error occurs, the corresponding node is awakened, and if the frame structure is not matched or no message error occurs, the high-speed CAN transceiver continues to sleep. One prerequisite for decoding is to ensure that the rate of the received message is consistent with the rate of the internal sampling module, so that the frame structure of the CAN message CAN be identified.
Disclosure of Invention
The invention aims to provide a baud rate matching detection system of a high-speed CAN transceiver for a local network, which aims to solve the problem that whether the baud rate is matched or not is difficult to detect in the prior art.
The purpose of the invention can be realized by the following technical scheme
The system for matching and detecting the baud rate of the high-speed CAN transceiver for the local network comprises a sampling baud rate configuration register, a baud rate frequency divider, bit time sequence logic, a bit data stream processor, a shift register module, message error management logic and an interrupt configuration register;
the design of the bit sequential logic comprises three parts of bit timing, sampling points and synchronous design;
bit timing, namely dividing frequency according to the CAN standard baud rate configured in the baud rate configuration register to generate the minimum time unit Tq;
the configuration of the sampling points needs to meet the requirements of a local network on the sampling points of the transceiver;
hard synchronization and resynchronization specified in a CAN protocol adopted by the synchronization design;
the high-speed CAN transceiver applied to the local network CAN be applied to a network mixed with CAN and CAN FD nodes, so that the bit data stream processor is additionally provided with CAN FD detection on the basis of a traditional CAN protocol decoder, and a CAN FD state branch is inserted into a bit stream state, so that the decoding requirement of the high-speed CAN transceiver applied to the local network is met, and the CAN FD detection logic is additionally arranged on the traditional CAN protocol decoder;
all selectable CAN standard baud rates are listed in a sampling baud rate configuration register, and the setting of the conventional baud rate CAN be conveniently and quickly carried out outside;
the interrupt configuration register CAN freely configure the interrupt outside, CAN enable and disable the baud rate matching detection interrupt function, CAN clear the interrupt mark through external software, and sets primary interrupt and secondary interrupt for a high-speed CAN transceiver applied to a local network, thereby enhancing the flexibility of the high-speed CAN transceiver;
the message error management logic CAN identify bit filling errors, format errors and CRC (cyclic redundancy check) errors in the CAN message, count the errors, generate an error mark signal when a message error occurs, and an external microcontroller CAN monitor whether the message error exists or not in real time by accessing an error mark state register;
if the number of times of occurrence of the message errors exceeds a certain threshold, an interrupt signal with unmatched baud rate CAN be generated, and the method has certain tolerance to the situation that the message errors occur on the CAN bus due to EMC and other unknown errors;
meanwhile, when the CAN bus enters idle and the bus has no data for a long time, the message error counter is cleared, so that dynamic power consumption is saved, and meanwhile, a gated clock is adopted at an RTL level, so that the power consumption is reduced;
the CAN protocol decoder in the digital module of the high-speed CAN transceiver applied to the local network is a core module, resource sharing is adopted at an RTL level, an additional logic function is added on the basis of CAN protocol decoding to achieve the realization of a baud rate matching detection function, and the area of the transceiver is saved;
compared with the prior art, the invention has the beneficial effects that:
1. the invention CAN realize the detection whether the transmitting-receiving baud rate is matched, and avoid the condition that the node CAN not be awakened for a long time due to the problem of unmatched rate when the CAN network enables the local network function;
2. the method can avoid the situation that the active node wakes up the sleeping node on the bus, continuously sends error frames and always occupies the bus;
3. the invention CAN detect the conditions that abnormal errors occur on the CAN bus system and message errors occur.
Drawings
In order to facilitate understanding for those skilled in the art, the present invention will be further described with reference to the accompanying drawings.
FIG. 1 is a schematic structural diagram of a baud rate matching detection system of a high-speed CAN transceiver for a local network according to the present invention;
FIG. 2 is a flowchart of the operation of the high speed CAN transceiver baud rate match detection system for local networks in accordance with the present invention;
fig. 3 is an RTL simulation waveform diagram of the operation of the baud rate matching detection system of the high-speed CAN transceiver for the local network according to the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments, and it should be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
A baud rate matching detection system for a high-speed CAN transceiver for a local network, as shown in fig. 1, includes a sampling baud rate configuration register, a baud rate frequency divider, bit timing logic, a bit data stream processor, a shift register module, message error management logic, and an interrupt configuration register;
the shift register module comprises a plurality of shift registers and is used for temporarily storing each section of data decoded by the CAN protocol decoder;
a sample baud rate configuration register is configured externally,
the baud rate frequency divider divides the frequency of a system clock into the minimum time Tq corresponding to the CAN standard baud rate according to the value of the configuration register and then sends the minimum time Tq to bit sequential logic;
the bit sequential logic samples the received data according to the corresponding baud rate, and sends sampling points and sampling bits to the bit data stream processor, and meanwhile, the bit data stream processor feeds back a synchronous mode to the bit sequential logic so as to determine which synchronous mode is adopted;
the bit data stream processor skips the state according to the frame structure of the CAN message and transfers the sampled data of different sections of the frame structure to the corresponding shift register for temporary storage;
when the bit data stream processor carries out state jump, the message error management logic can carry out message error check on the value in the shift register, if a message error occurs, the error counter is self-added with '1' and generates a message error state mark, under the condition that the interrupt configuration register enables interrupt, the error counter exceeds a certain threshold value, a baud rate unmatched interrupt signal is generated, and when a frame is at the end and no message occurs, the error counter is self-reduced by '1';
the external part can enable or disable the interrupt signal with the non-matching baud rate through an interrupt configuration register, and clear the interrupt through writing '1' by software;
as shown in fig. 2, the work flow of the high-speed CAN transceiver baud rate matching detection system for the local network is as follows:
s1, setting a sampling baud rate in a sampling baud rate configuration register before the local network and the selective awakening are opened;
s2, opening a local network and a selective awakening function, monitoring the CAN bus, detecting a low level, considering the low level as a start bit, and generating a message on the CAN bus;
s3, decoding all data on the CAN bus, wherein the data comprises an ID field, a data field, a CRC field and a frame end, and the sampled data is temporarily stored in a shift register;
s4, in the analysis process, as long as a message error occurs, the error counter performs self-increment by 1, and sets a flag bit in the message error state register until no message error occurs in the next frame of message, and the message error flag bit is cleared;
the message errors comprise bit filling errors, format errors and CRC errors;
if the counter value exceeds the set threshold, generating unmatched interrupt of the baud rate of the transceiver, reminding an external microcontroller that the baud rate is unmatched and the counter value does not exceed the set threshold, and continuously detecting whether the CAN message has errors or not until the bus enters idle;
s5, in the analysis process, if the whole frame of message has no message error, the error counter is reduced by 1, and when the next frame of message has no message error, the counter is reduced by 1 until the value is 0;
s6, if the CAN bus is not idle, decoding the CAN message all the time, judging whether the message has a message error, if the bus is idle, performing low level detection, and judging whether the bus has the CAN message;
when the bus enters idle state, the flag bit of the message error state register is cleared, and if no data exists on the bus for a long time, the error counter is cleared.
As shown in fig. 3, a 500K CAN message is received by RX, the CAN sampling baud rate externally configured by a CDR register is 1M, because the baud rates are not matched, an internal bit timing module samples error data, it CAN be known from the waveform that CAN message errors (CRC errors, bit filling errors, format errors) occur, and each time such an error occurs, an error counter automatically adds "1", when the counter exceeds a threshold value of 31, PNFDE _ flag is set to a high level, an error interrupt that the baud rates are not matched is generated, an external microcontroller is prompted to adjust the baud rate of the sent message or adjust the sampling frequency of the internal bit timing through the CDR, and a state signal COSC _ flag monitored by the message error is still in a low level state after sending a frame of message, which indicates that there is an error condition in the internal message.
Through the analysis, the implementation method for baud rate matching detection in the high-speed CAN transceiver applied to the local network CAN meet the functional requirements, is flexible in configuration, and has certain tolerance to the condition that the message error occurs due to EMC and other unknown errors on the CAN bus.
The preferred embodiments of the invention disclosed above are intended to be illustrative only. The preferred embodiments are not intended to be exhaustive or to limit the invention to the precise forms disclosed. Many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims (8)
1. A high-speed CAN transceiver baud rate matching detection system for local networks, comprising:
bit timing logic for bit timing, sampling and synchronization;
a bit stream processor for decoding the CAN message and detecting the CAN FD message;
a sampling baud rate configuration register for externally configuring standard CAN baud rate;
the baud rate frequency divider is used for configuring the value of the register according to the sampling baud rate and dividing the frequency of a system clock into the minimum time Tq corresponding to the CAN standard baud rate;
the shift register module comprises a plurality of shift registers and is used for temporarily storing each section of data decoded by the CAN protocol decoder;
the message error management logic is used for detecting whether each segment of data has a message error, counting the number of errors and generating a baud rate matching interrupt signal and a message error state signal;
and the interrupt configuration register is used for enabling or disabling the baud rate matching interrupt externally or clearing the baud rate matching interrupt by software.
2. The system of claim 1, wherein the bit sequencing logic samples the received data at the corresponding baud rate, sends the sample points and the sampled bits to the bit data stream processor, and the bit data stream processor feeds back a synchronization pattern to the bit sequencing logic to determine which synchronization pattern to use.
3. The system of claim 1 in which the bit stream processor detects CAN FD frames during CAN message bit stream jumps and adds additional CAN FD state to the bit stream state machine.
4. The high speed CAN transceiver baud rate match detection system for local networks of claim 1, wherein the sample baud rate configuration register supports 50K, 100K, 125K, 250K, 500K, 1M standard CAN baud rate configurations.
5. The system of claim 1, wherein the error management logic is configured to perform the following operations:
counting the occurrence frequency of the message errors through an error counter in the message error management logic, wherein the error counter is self-increased by '1' when the message errors occur, counting the occurrence frequency of the message errors through the error counter, if the count threshold is exceeded, generating baud rate unmatched interruption, and if the message errors do not occur in the whole frame, the error counter is self-decreased by '1';
marking in a message error state register as long as a message error exists;
the idle time of the bus exceeds the silent time of the bus, which means that the whole bus is in the silent state, the baud rate matching detection is restarted, and the message error counter is reset and cleared.
6. The high speed CAN transceiver baud rate match detection system for local networks of claim 5, wherein the count threshold is 31.
7. The high speed CAN transceiver baud rate match detection system for local networks of claim 5, wherein bus quiet time is 1 s.
8. The high speed CAN transceiver baud rate match detection system for local networks of claim 1, further comprising an independent gated clock that is turned on when the local network is externally enabled and turned off otherwise.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110968661.3A CN113688086A (en) | 2021-08-23 | 2021-08-23 | Baud rate matching detection system of high-speed CAN transceiver for local network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110968661.3A CN113688086A (en) | 2021-08-23 | 2021-08-23 | Baud rate matching detection system of high-speed CAN transceiver for local network |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113688086A true CN113688086A (en) | 2021-11-23 |
Family
ID=78581487
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110968661.3A Pending CN113688086A (en) | 2021-08-23 | 2021-08-23 | Baud rate matching detection system of high-speed CAN transceiver for local network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113688086A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114826977A (en) * | 2022-04-12 | 2022-07-29 | 广州致远电子有限公司 | Baud rate detection method and device, terminal equipment and storage medium |
CN115981289A (en) * | 2023-02-10 | 2023-04-18 | 力高(山东)新能源技术股份有限公司 | Fault diagnosis processing method for CAN specific frame wakeup |
CN117376058A (en) * | 2023-12-07 | 2024-01-09 | 武汉神动汽车电子电器股份有限公司 | CAN bus baud rate self-adaption method |
CN117650866A (en) * | 2023-11-23 | 2024-03-05 | 广州致远仪器有限公司 | CAN frame decoding method, device, equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103777538A (en) * | 2012-10-19 | 2014-05-07 | 重庆长安汽车股份有限公司 | Baud-rate automatic matching method for controller and CAN bus |
CN104052579A (en) * | 2014-06-26 | 2014-09-17 | 湖南先步信息股份有限公司 | Automatic MODBUS-RTU communication baud rate matching method |
CN104199298A (en) * | 2014-08-18 | 2014-12-10 | 广西师范大学 | Controller area network (CAN) bus Baud rate self-adapting method |
CN104796222A (en) * | 2014-11-21 | 2015-07-22 | 湖南先步信息股份有限公司 | A CAN baud-rate automatic matching method |
CN106603358A (en) * | 2016-11-24 | 2017-04-26 | 南京国电南自电网自动化有限公司 | High-speed bus system based on an MLVDS interface and implementation method |
CN107547326A (en) * | 2016-06-23 | 2018-01-05 | 上海北京大学微电子研究院 | Controller LAN IP kernel based on FPGA |
CN113194016A (en) * | 2021-04-15 | 2021-07-30 | 常州易控汽车电子股份有限公司 | CAN bus baud rate self-adaption method and device based on TC387 chip and storage medium |
-
2021
- 2021-08-23 CN CN202110968661.3A patent/CN113688086A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103777538A (en) * | 2012-10-19 | 2014-05-07 | 重庆长安汽车股份有限公司 | Baud-rate automatic matching method for controller and CAN bus |
CN104052579A (en) * | 2014-06-26 | 2014-09-17 | 湖南先步信息股份有限公司 | Automatic MODBUS-RTU communication baud rate matching method |
CN104199298A (en) * | 2014-08-18 | 2014-12-10 | 广西师范大学 | Controller area network (CAN) bus Baud rate self-adapting method |
CN104796222A (en) * | 2014-11-21 | 2015-07-22 | 湖南先步信息股份有限公司 | A CAN baud-rate automatic matching method |
CN107547326A (en) * | 2016-06-23 | 2018-01-05 | 上海北京大学微电子研究院 | Controller LAN IP kernel based on FPGA |
CN106603358A (en) * | 2016-11-24 | 2017-04-26 | 南京国电南自电网自动化有限公司 | High-speed bus system based on an MLVDS interface and implementation method |
CN113194016A (en) * | 2021-04-15 | 2021-07-30 | 常州易控汽车电子股份有限公司 | CAN bus baud rate self-adaption method and device based on TC387 chip and storage medium |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114826977A (en) * | 2022-04-12 | 2022-07-29 | 广州致远电子有限公司 | Baud rate detection method and device, terminal equipment and storage medium |
CN114826977B (en) * | 2022-04-12 | 2023-08-22 | 广州致远电子股份有限公司 | Baud rate detection method and device, terminal equipment and storage medium |
CN115981289A (en) * | 2023-02-10 | 2023-04-18 | 力高(山东)新能源技术股份有限公司 | Fault diagnosis processing method for CAN specific frame wakeup |
CN117650866A (en) * | 2023-11-23 | 2024-03-05 | 广州致远仪器有限公司 | CAN frame decoding method, device, equipment and storage medium |
CN117376058A (en) * | 2023-12-07 | 2024-01-09 | 武汉神动汽车电子电器股份有限公司 | CAN bus baud rate self-adaption method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113688086A (en) | Baud rate matching detection system of high-speed CAN transceiver for local network | |
RU2566948C2 (en) | Method and apparatus for busbar subscriber activation and corresponding subscriber | |
EP3576353B1 (en) | Flexible data rate handling in a data bus receiver | |
US10326583B2 (en) | Low-power data bus receiver | |
US9032124B2 (en) | Definition of wakeup bus messages for partial networking | |
US20090213915A1 (en) | Method for the non-bitrate-dependent encoding of digital signals on a bus system | |
RU2573237C2 (en) | Method and apparatus for busbar subscriber activation and corresponding subscriber | |
WO2015051189A1 (en) | Camera control interface sleep and wake up signaling | |
US8825935B2 (en) | Pattern detection for partial networking | |
CN103412634A (en) | Device and method for awakening MCU (micro control unit) of SOC (system on chip) chip | |
US8989210B2 (en) | Method and bus connection unit for unambiguously waking users of a bus system | |
CN102916716B (en) | Transceiver | |
US8837468B1 (en) | Network device and method for powering a media access controller | |
CN112540943B (en) | Circuit structure and method for preventing I2C interface from waking up SOC system by mistake | |
EP1650669A2 (en) | Method and system for reducing power consumption of handsets through uart auto flow control | |
JP5134055B2 (en) | Communication system, transceiver, node | |
US11157290B2 (en) | Method and circuit for waking up I2C device | |
CN104951413A (en) | Low-power communication apparatus and associated method | |
CN105792339A (en) | Low power consumption design method for wireless sensor network node | |
JP2012065095A (en) | Communication system, transceiver, and node | |
CN113985726B (en) | Master-slave controller communication method of APF control system | |
JP2013038653A (en) | Communication system, and master node and slave node used for the communication system | |
Pan et al. | Realization of CAN FD Shielding in High Speed CAN Transceiver for Partial Networking | |
JP5091292B2 (en) | Communication system, transceiver, node | |
CN108234075B (en) | Power optimization mechanism for framers by using serial comparisons in frame alignment processing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB03 | Change of inventor or designer information | ||
CB03 | Change of inventor or designer information |
Inventor after: Pan Jian Inventor after: Zhang Wenjie Inventor before: Xie Liang Inventor before: Zhang Wenjie Inventor before: Pan Jian |