CN115065572B - CAN FD controller for vehicle-mounted electronic system - Google Patents
CAN FD controller for vehicle-mounted electronic system Download PDFInfo
- Publication number
- CN115065572B CN115065572B CN202210190206.XA CN202210190206A CN115065572B CN 115065572 B CN115065572 B CN 115065572B CN 202210190206 A CN202210190206 A CN 202210190206A CN 115065572 B CN115065572 B CN 115065572B
- Authority
- CN
- China
- Prior art keywords
- data
- buffer
- txt
- controller
- send
- 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.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40006—Architecture of a communication node
- H04L12/40013—Details regarding a bus controller
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/403—Bus networks with centralised control, e.g. polling
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40267—Bus for use in transportation systems
- H04L2012/40273—Bus for use in transportation systems the transportation system being a vehicle
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
本发明公开了一种面向车载电子系统的CAN FD控制器,包括:内存寄存器,用于存储接收和发送的数据,得到位数据;中断管理器,用于对CANFD IP的状态进行监控,并在发生预设情况时发送中断信息;总线采样器,用于接收、发送数据;TXT缓冲器,用于从内存寄存器访问得到位数据,并将帧数据插入自身的缓冲区后,将单个帧数据存储在内部RAM中传输至TX仲裁器;TX仲裁器,用于确定目标TXT缓冲器,并将目标TXT缓冲器中的帧数据发送至CAN协议内核模块;CAN协议内核模块,用于将对帧数据进行并‑串转换,并将得到的串行数据发给总线采样器,以使总线采样器发送串行数据。上述CAN FD控制器将数据发送过程和数据接收过程进行分离处理,避免二者互相影响。
The invention discloses a CAN FD controller for vehicle-mounted electronic systems, which includes: a memory register used to store received and sent data to obtain bit data; an interrupt manager used to monitor the status of CANFD IP and Send interrupt information when a preset situation occurs; bus sampler, used to receive and send data; TXT buffer, used to access bit data from the memory register, insert the frame data into its own buffer, and store the single frame data Transmitted to the TX arbiter in the internal RAM; the TX arbiter is used to determine the target TXT buffer and send the frame data in the target TXT buffer to the CAN protocol core module; the CAN protocol core module is used to process the frame data Perform parallel-to-serial conversion and send the resulting serial data to the bus sampler so that the bus sampler sends serial data. The above-mentioned CAN FD controller separates the data sending process and the data receiving process to avoid mutual influence between the two.
Description
技术领域Technical field
本发明属于CAN总线技术领域,具体涉及一种面向车载电子系统的CAN FD控制器。The invention belongs to the field of CAN bus technology, and specifically relates to a CAN FD controller for vehicle-mounted electronic systems.
背景技术Background technique
目前,商用汽车中广泛应用CAN总线,但串行通信的引入导致对CAN通信带宽的需求不断增加,CAN FD(CAN with Flexible Data rate)总线的数据段具有更高的传输速率,因此使用CAN FD总线逐渐成为趋势。At present, the CAN bus is widely used in commercial vehicles, but the introduction of serial communication has led to an increasing demand for CAN communication bandwidth. The data segment of the CAN FD (CAN with Flexible Data rate) bus has a higher transmission rate, so CAN FD is used The bus is gradually becoming a trend.
CAN FD控制器作为CAN FD总线通信的核心组件,具有多种实现结构和方式。相关技术中,CAN FD控制器将数据的发送和接收过程整合在相同的功能模块内,此种设计方式使得处理信息的过程中容易出错、并且分析控制器时过于复杂,不利于提高处理速度。As the core component of CAN FD bus communication, the CAN FD controller has a variety of implementation structures and methods. In related technologies, the CAN FD controller integrates the data sending and receiving processes in the same functional module. This design method makes the process of processing information prone to errors and is too complex when analyzing the controller, which is not conducive to improving the processing speed.
发明内容Contents of the invention
为了解决现有技术中存在的上述问题,本发明提供了一种面向车载电子系统的CAN FD控制器。本发明要解决的技术问题通过以下技术方案实现:In order to solve the above-mentioned problems existing in the prior art, the present invention provides a CAN FD controller for vehicle-mounted electronic systems. The technical problems to be solved by the present invention are achieved through the following technical solutions:
本发明提供一种面向车载电子系统的CAN FD控制器,包括:AHB接口转换模块、内存寄存器、中断管理器、总线采样器、RX缓冲器、多个TXT缓冲器、TX仲裁器和CAN协议内核模块;其中,The invention provides a CAN FD controller for vehicle-mounted electronic systems, including: AHB interface conversion module, memory register, interrupt manager, bus sampler, RX buffer, multiple TXT buffers, TX arbiter and CAN protocol core module; among them,
所述AHB接口转换模块,用于对内存寄存器、RX缓冲器和TXT缓冲器进行读写操作;The AHB interface conversion module is used to read and write memory registers, RX buffers and TXT buffers;
所述内存寄存器,用于存储接收和发送的数据,得到位数据;The memory register is used to store received and sent data to obtain bit data;
所述中断管理器,用于对CAN FD IP的状态进行监控,并在发生预设情况时发送中断信息;The interrupt manager is used to monitor the status of the CAN FD IP and send interrupt information when a preset situation occurs;
所述总线采样器,用于接收数据和发送数据;The bus sampler is used to receive data and send data;
所述TXT缓冲器,用于通过CAN FD控制器的内存总线从所述内存寄存器访问得到位数据,并将帧数据插入自身的缓冲区后,将单个帧数据存储在内部RAM中传输至TX仲裁器;The TXT buffer is used to access bit data from the memory register through the memory bus of the CAN FD controller, and after inserting the frame data into its own buffer, store the single frame data in the internal RAM and transmit it to the TX arbitration device;
所述TX仲裁器,用于从所述多个TXT缓冲器中确定目标TXT缓冲器,并将所述目标TXT缓冲器中的帧数据发送至CAN协议内核模块;The TX arbiter is used to determine a target TXT buffer from the plurality of TXT buffers, and send the frame data in the target TXT buffer to the CAN protocol core module;
所述CAN协议内核模块,用于将对接收到的所述帧数据进行并-串转换,并将得到的串行数据发给总线采样器,以使总线采样器发送所述串行数据。The CAN protocol core module is used to perform parallel-to-serial conversion on the received frame data, and send the obtained serial data to the bus sampler, so that the bus sampler sends the serial data.
在本发明的一个实施例中,还包括帧过滤器;In one embodiment of the invention, a frame filter is further included;
所述CAN协议内核模块,还用于对所述帧数据进行串-并转换,并将得到的并行数据发送至所述帧过滤器。The CAN protocol core module is also used to perform serial-to-parallel conversion on the frame data, and send the obtained parallel data to the frame filter.
在本发明的一个实施例中,所述帧过滤器,用于根据接收到的所述并行数据中的CAN标识符,过滤得到RX缓冲器的有效数据,并将所述有效数据发送至所述RX缓冲器;In one embodiment of the present invention, the frame filter is used to filter the valid data of the RX buffer according to the CAN identifier in the received parallel data, and send the valid data to the RX buffer;
所述RX缓冲器,用于存储所述有效数据。The RX buffer is used to store the valid data.
在本发明的一个实施例中,还包括预分频器;In one embodiment of the invention, a prescaler is also included;
所述预分频器,用于生成CAN FD协议传输所需的时序信息,并将所述时序信息发送至所述AHB接口转换模块、所述内存寄存器、所述中断管理器、所述总线采样器、所述多个TXT缓冲器、所述TX仲裁器、所述CAN协议内核模块、所述帧过滤器和所述RX缓冲器。The prescaler is used to generate timing information required for CAN FD protocol transmission, and send the timing information to the AHB interface conversion module, the memory register, the interrupt manager, and the bus sampling , the plurality of TXT buffers, the TX arbiter, the CAN protocol core module, the frame filter and the RX buffer.
在本发明的一个实施例中,所述TX仲裁器,具体用于根据各个TXT缓冲器的当前状态和预设优先级、以及各个TXT缓冲器中帧数据的类型和标识符的大小确定目标TXT缓冲器,并将所述目标TXT缓冲器内的帧数据发送至所述CAN协议内核模块。In one embodiment of the present invention, the TX arbiter is specifically used to determine the target TXT based on the current status and preset priority of each TXT buffer, as well as the type and identifier size of the frame data in each TXT buffer. buffer, and sends the frame data in the target TXT buffer to the CAN protocol core module.
在本发明的一个实施例中,所述中断管理器,具体用于对CAN FD IP的状态进行监控,并在发生预设情况时向所述CAN FD控制器所在的片上系统或内存寄存器发送中断信息。In one embodiment of the present invention, the interrupt manager is specifically used to monitor the status of the CAN FD IP and send interrupts to the on-chip system or memory register where the CAN FD controller is located when a preset situation occurs. information.
在本发明的一个实施例中,所述总线采样器,还用于检测接收数据和发送数据的发送延迟时间、并检测接收数据和发送数据是否存在位错误。In one embodiment of the present invention, the bus sampler is also used to detect the transmission delay time of received data and transmitted data, and to detect whether there are bit errors in the received data and transmitted data.
与现有技术相比,本发明的有益效果在于:Compared with the prior art, the beneficial effects of the present invention are:
本发明提供一种面向车载电子系统的CAN FD控制器,包括:AHB接口转换模块、内存寄存器、中断管理器、总线采样器、RX缓冲器、多个TXT缓冲器、TX仲裁器和CAN协议内核模块,由于CAN FD控制器将数据发送过程和数据接收过程进行分离处理,避免二者互相影响;同时,本发明提供的CAN FD控制器重新划分各个模块的功能,能够按照协议规范的要求优化工作流程。The invention provides a CAN FD controller for vehicle-mounted electronic systems, including: AHB interface conversion module, memory register, interrupt manager, bus sampler, RX buffer, multiple TXT buffers, TX arbiter and CAN protocol core module, because the CAN FD controller separates the data sending process and the data receiving process to avoid the mutual influence between the two; at the same time, the CAN FD controller provided by the present invention redivides the functions of each module and can optimize the work according to the requirements of the protocol specification. process.
以下将结合附图及实施例对本发明做进一步详细说明。The present invention will be further described in detail below with reference to the accompanying drawings and examples.
附图说明Description of the drawings
图1是本发明实施例提供的面向车载电子系统的CAN FD控制器的一种结构示意图;Figure 1 is a schematic structural diagram of a CAN FD controller for vehicle-mounted electronic systems provided by an embodiment of the present invention;
图2是本发明实施例提供的面向车载电子系统的CAN FD控制器中RX缓冲器的工作示意图;Figure 2 is a schematic diagram of the operation of the RX buffer in the CAN FD controller for vehicle-mounted electronic systems provided by the embodiment of the present invention;
图3是本发明实施例提供的面向车载电子系统的CAN FD控制器中TX仲裁器的工作示意图;Figure 3 is a schematic diagram of the operation of the TX arbiter in the CAN FD controller for vehicle-mounted electronic systems provided by the embodiment of the present invention;
图4是本发明实施例提供的面向车载电子系统的CAN FD控制器中TXT缓冲器的工作示意图。Figure 4 is a schematic diagram of the operation of the TXT buffer in the CAN FD controller for vehicle-mounted electronic systems provided by the embodiment of the present invention.
具体实施方式Detailed ways
下面结合具体实施例对本发明做进一步详细的描述,但本发明的实施方式不限于此。The present invention will be described in further detail below with reference to specific examples, but the implementation of the present invention is not limited thereto.
图1是本发明实施例提供的面向车载电子系统的CAN FD控制器的一种结构示意图。请参见图1,本发明实施例提供一种面向车载电子系统的CAN FD控制器,包括:AHB接口转换模块、内存寄存器、中断管理器、总线采样器、RX缓冲器、多个TXT缓冲器、TX仲裁器和CAN协议内核模块;其中,Figure 1 is a schematic structural diagram of a CAN FD controller for vehicle-mounted electronic systems provided by an embodiment of the present invention. Referring to Figure 1, an embodiment of the present invention provides a CAN FD controller for vehicle-mounted electronic systems, including: AHB interface conversion module, memory register, interrupt manager, bus sampler, RX buffer, multiple TXT buffers, TX arbiter and CAN protocol core module; among them,
AHB接口转换模块,用于对内存寄存器、RX缓冲器和TXT缓冲器进行读写操作;AHB interface conversion module, used to read and write memory registers, RX buffers and TXT buffers;
内存寄存器,用于存储接收和发送的数据,得到位数据;Memory register, used to store received and sent data to obtain bit data;
中断管理器,用于对CAN FD IP的状态进行监控,并在发生预设情况时发送中断信息;Interrupt manager, used to monitor the status of CAN FD IP and send interrupt information when preset situations occur;
总线采样器,用于接收数据和发送数据;Bus sampler, used to receive data and send data;
TXT缓冲器,用于通过CAN FD控制器的内存总线从内存寄存器访问得到位数据,并将帧数据插入自身的缓冲区后,将单个帧数据存储在内部RAM中传输至TX仲裁器;The TXT buffer is used to access bit data from the memory register through the memory bus of the CAN FD controller, insert the frame data into its own buffer, and then store the single frame data in the internal RAM and transmit it to the TX arbiter;
TX仲裁器,用于从多个TXT缓冲器中确定目标TXT缓冲器,并将目标TXT缓冲器中的帧数据发送至CAN协议内核模块;TX arbiter, used to determine the target TXT buffer from multiple TXT buffers and send the frame data in the target TXT buffer to the CAN protocol core module;
CAN协议内核模块,用于将对接收到的帧数据进行并-串转换,并将得到的串行数据发给总线采样器,以使总线采样器发送串行数据。The CAN protocol core module is used to perform parallel-to-serial conversion on the received frame data, and send the obtained serial data to the bus sampler, so that the bus sampler sends serial data.
如图1所示,本发明提供的CAN FD控制器包括:AHB接口转换模块、内存寄存器、中断管理器、总线采样器、多个TXT缓冲器、TX仲裁器和CAN协议内核模块。具体而言,在上述CAN FD控制器中,AHB接口转换模块(AHB Interface)兼容AMBA 2.0AHB接口规范,用于对内存寄存器、RX缓冲器和TXT缓冲器进行读写操作;内存寄存器(Memory registers)包含CANFD中的所有寄存器,用于存储接收和发送的数据,得到的位数据表示了CAN FD的状态;中断管理器(Interrupt manager)用于对CAN FD IP的状态进行监控,并在发生预设情况时发送中断信息;总线采样器(Bus Sampler)用于发送和接收数据;TXT缓冲器(TXT buffers)用于通过CAN FD控制器的内存总线和SW命令从内存寄存器访问得到位数据,并将帧数据插入自身的缓冲区后,将单个帧数据存储在内部RAM中传输至TX仲裁器(TX arbitrator),应当理解,TXT缓冲器从内存寄存器中得到的位数据包括CAN FD控制器的工作模式、软件命令以及写入相应TXT缓冲器的帧数据,也就是说,得到的位数据包括TXT缓冲器工作所需的信息、以及存储到RAM中的帧数据;进一步地,TX仲裁器用于从多个TXT缓冲器中确定目标TXT缓冲器,并将目标TXT缓冲器中的帧数据发送至CAN协议内核模块;CAN协议内核模块,用于将对接收到的帧数据进行并-串转换,并将得到的串行数据发给总线采样器,以使总线采样器发送串行数据。As shown in Figure 1, the CAN FD controller provided by the present invention includes: AHB interface conversion module, memory register, interrupt manager, bus sampler, multiple TXT buffers, TX arbiter and CAN protocol core module. Specifically, in the above-mentioned CAN FD controller, the AHB interface conversion module (AHB Interface) is compatible with the AMBA 2.0AHB interface specification and is used to read and write memory registers, RX buffers and TXT buffers; memory registers ) contains all registers in CANFD and is used to store received and sent data. The obtained bit data represents the status of CAN FD; the interrupt manager (Interrupt manager) is used to monitor the status of CAN FD IP and respond in advance. Send interrupt information when the situation occurs; the Bus Sampler is used to send and receive data; the TXT buffers are used to access bit data from the memory register through the memory bus of the CAN FD controller and the SW command, and After inserting the frame data into its own buffer, the single frame data is stored in the internal RAM and transmitted to the TX arbitrator (TX arbitrator). It should be understood that the bit data obtained by the TXT buffer from the memory register includes the work of the CAN FD controller mode, software commands and frame data written to the corresponding TXT buffer, that is to say, the obtained bit data includes the information required for the operation of the TXT buffer and the frame data stored in RAM; further, the TX arbiter is used from Determine the target TXT buffer among multiple TXT buffers, and send the frame data in the target TXT buffer to the CAN protocol core module; the CAN protocol core module is used to perform parallel-to-serial conversion on the received frame data, and Send the obtained serial data to the bus sampler so that the bus sampler sends serial data.
可选地,CAN FD控制器还包括帧过滤器;Optionally, the CAN FD controller also includes a frame filter;
CAN协议内核模块,还用于对帧数据进行串-并转换,并将得到的并行数据发送至帧过滤器。The CAN protocol core module is also used to perform serial-to-parallel conversion of frame data and send the resulting parallel data to the frame filter.
本实施例中,CAN协议内核模块可以包括协议控制(Protocol control)、位填充(Bit stuffing)、位去填充(Bit destuffing)、故障限制(Fault confinement)、CAN CRC校验和操作控制模块。示例性地,上述CAN FD控制器还包括帧过滤器(Frame filters);在发送数据的过程中,CAN协议内核模块还用于对帧数据进行串-并转换,并将得到的并行数据发送至帧过滤器。In this embodiment, the CAN protocol core module may include protocol control, bit stuffing, bit destuffing, fault confinement, CAN CRC checksum operation control module. Exemplarily, the above-mentioned CAN FD controller also includes frame filters; during the process of sending data, the CAN protocol core module is also used to perform serial-to-parallel conversion of the frame data, and send the obtained parallel data to Frame filter.
进一步地,帧过滤器,用于根据接收到的并行数据中的CAN标识符,过滤得到RX缓冲器的有效数据,并将有效数据发送至RX缓冲器;Further, the frame filter is used to filter the valid data of the RX buffer according to the CAN identifier in the received parallel data, and send the valid data to the RX buffer;
RX缓冲器,用于存储有效数据。RX buffer, used to store valid data.
具体而言,CAN FD控制器还包括RX缓冲器(RX buffer),帧过滤器接收到并行数据之后,可以根据并行数据中包含的CAN标识符过滤出对RX缓冲器的有效数据,并将有效数据发送至RX缓冲器。Specifically, the CAN FD controller also includes an RX buffer. After the frame filter receives the parallel data, it can filter out the valid data to the RX buffer based on the CAN identifier contained in the parallel data, and save the valid data to the RX buffer. Data is sent to the RX buffer.
示例性地,帧过滤器标识符类型和帧类型由“driving bus”控制。帧过滤器适用于11位和29位标识符,由过滤器A、B、C以及Range组成。如果输入标识符至少匹配一个,则视为有效数据;帧类型包括:CAN Basic、CAN Extended、CAN FD Basic和CAN FD Extended,帧类型可以选择性地进行过滤,帧过滤器可以选择不进行综合处理,也可以在运行时禁用。当然,如果禁用帧过滤器,则不会过滤掉任何帧数据。Illustratively, the frame filter identifier type and frame type are controlled by "driving bus". Frame filters apply to 11-bit and 29-bit identifiers and consist of filters A, B, C and Range. If the input identifier matches at least one, it is considered valid data; frame types include: CAN Basic, CAN Extended, CAN FD Basic and CAN FD Extended. The frame type can be selectively filtered, and the frame filter can choose not to perform comprehensive processing. , can also be disabled at runtime. Of course, if the frame filter is disabled, no frame data will be filtered out.
图2是本发明实施例提供的面向车载电子系统的CAN FD控制器中RX缓冲器的工作示意图。如图2所示,将接接收数据期间的RX CAN帧存储到RX缓冲RAM中,由协议控制FSM控制。RX帧是从帧滤波器中逐字读取的,接收数据时RX缓冲器会连续存储,在结束时会提交到内存中供处理器使用。如果同时发生“溢出”或“释放接收缓冲区”,则将帧数据还原。Figure 2 is a schematic diagram of the operation of the RX buffer in the CAN FD controller for vehicle-mounted electronic systems provided by the embodiment of the present invention. As shown in Figure 2, the RX CAN frame during data reception is stored in the RX buffer RAM and is controlled by the protocol control FSM. The RX frame is read word by word from the frame filter, the RX buffer stores the data continuously as it is received, and at the end it is committed to memory for use by the processor. If an "overflow" or "release of the receive buffer" occurs at the same time, the frame data is restored.
可选地,CAN FD控制器还包括预分频器;Optionally, the CAN FD controller also includes a prescaler;
预分频器,用于生成CAN FD协议传输所需的时序信息,并将时序信息发送至AHB接口转换模块、内存寄存器、中断管理器、总线采样器、多个TXT缓冲器、TX仲裁器、CAN协议内核模块、帧过滤器和RX缓冲器。Prescaler, used to generate the timing information required for CAN FD protocol transmission, and send the timing information to the AHB interface conversion module, memory register, interrupt manager, bus sampler, multiple TXT buffers, TX arbiter, CAN protocol core module, frame filter and RX buffer.
本实施例中,CAN FD控制器还包括预分频器(Prescaler),预分频器可以根据前期配置的相关信息生成CAN FD协议传输所需的时序信息,并将时序信息分别发送至AHB接口转换模块、内存寄存器、中断管理器、总线采样器、多个TXT缓冲器、TX仲裁器、CAN协议内核模块、帧过滤器和RX缓冲器,从而控制整个CAN总线网络的工作。可选地,预分频器包括传输速率计数,传输位段计数,重同步和硬同步的执行,TX和RX触发时序和回读机制,需要说明的是,标称时序和数据时序分别采用不同的计数系统。In this embodiment, the CAN FD controller also includes a prescaler. The prescaler can generate the timing information required for CAN FD protocol transmission based on the relevant information configured in the previous stage, and send the timing information to the AHB interface respectively. Conversion module, memory register, interrupt manager, bus sampler, multiple TXT buffers, TX arbiter, CAN protocol core module, frame filter and RX buffer to control the work of the entire CAN bus network. Optionally, the prescaler includes transmission rate count, transmission bit segment count, resynchronization and hard synchronization execution, TX and RX trigger timing and readback mechanism. It should be noted that the nominal timing and data timing adopt different counting system.
图3是本发明实施例提供的面向车载电子系统的CAN FD控制器中TX仲裁器的工作示意图。如图3所示,TX仲裁器的初始状态为仲裁空闲,之后获得时间戳的上下限用于之后的帧数据传输,即从TX仲裁器模块传输到协议内核模块,接下来TX仲裁器对各个TXT缓冲器中的帧数据类型进行判断,获取各个帧数据中的标识符信息后进行仲裁,仲裁完成后开始向协议内核模块传输仲裁成功的帧数据,并且将传输锁定直到传输完成,然后返回仲裁空闲阶段。Figure 3 is a schematic diagram of the operation of the TX arbiter in the CAN FD controller for vehicle-mounted electronic systems provided by the embodiment of the present invention. As shown in Figure 3, the initial state of the TX arbiter is arbitration idle, and then the upper and lower limits of the timestamp are obtained for subsequent frame data transmission, that is, from the TX arbiter module to the protocol core module. Next, the TX arbiter The frame data type in the TXT buffer is judged, and the identifier information in each frame data is obtained and then arbitrated. After the arbitration is completed, the successfully arbitrated frame data is transmitted to the protocol kernel module, and the transmission is locked until the transmission is completed, and then returns to arbitration. idle phase.
可选地,TX仲裁器具体用于根据各个TXT缓冲器的当前状态和预设优先级、以及各个TXT缓冲器中帧数据的类型和标识符的大小确定目标TXT缓冲器,并将目标TXT缓冲器内的帧数据发送至CAN协议内核模块。Optionally, the TX arbiter is specifically used to determine the target TXT buffer according to the current status and preset priority of each TXT buffer, as well as the type and identifier size of the frame data in each TXT buffer, and assign the target TXT buffer to The frame data in the controller is sent to the CAN protocol core module.
具体而言,请参加图3,TXT仲裁器首先获取各个TXT缓冲器中帧数据的时间戳,然后对各个TXT缓冲器中帧数据的类型以及标识符进行判断,从而根据TXT缓冲器的预设优先级和当前状态、以及帧数据的类型和标识符的大小得到仲裁结果,也就是从多个TXT缓冲器中确定目标TXT缓冲器。进一步地,将目标TXT缓冲器中帧数据的时间戳与外部时间戳进行比较,仅当该时间戳低于外部时间戳的值时,对应的帧数据才被标记为对CAN Core有效,而后将该帧数据加载到TX仲裁器的输出中。Specifically, please refer to Figure 3. The TXT arbiter first obtains the timestamp of the frame data in each TXT buffer, and then judges the type and identifier of the frame data in each TXT buffer, so as to determine the type and identifier of the frame data in each TXT buffer. The priority and current status, as well as the type of frame data and the size of the identifier are used to obtain the arbitration result, that is, the target TXT buffer is determined from multiple TXT buffers. Further, the timestamp of the frame data in the target TXT buffer is compared with the external timestamp. Only when the timestamp is lower than the value of the external timestamp, the corresponding frame data is marked as valid for the CAN Core, and then the This frame data is loaded into the output of the TX arbiter.
图4是本发明实施例提供的面向车载电子系统的CAN FD控制器中TXT缓冲器的工作示意图。请参见图4,当CAN FD控制器为关闭状态时,TXT缓冲器进入“传输失败”状态,并且TXT缓冲器在转换为“传输完成”、“中止”、“传输失败”状态时将产生中断。当TXT缓冲器处于“就绪”状态时,TX仲裁器才可以从多个TXT缓冲器中选择目标TXT缓冲器。当TXT缓冲器处于“就绪”、“正在传输”、“传输终止”状态时,TX仲裁器可以读取TXT缓冲器中的数据;当TXT缓冲器处于“空”、“传输完成”、“中止”、“传输失败”状态时,可以将数据写入相应的地址存储空间。当TXT缓冲器处于“空”、“传输完成”、“中止”、“传输失败”状态并且从内存寄存器发出的“设置就绪”命令有效时,则转换到“就绪”状态;当TXT缓冲器处于“传输完成”、“中止”、“传输失败”状态并且从内存寄存器发出的“设置为空”命令有效时,则转换到“空”状态;当TXT缓冲器处于“就绪”状态且从内存寄存器模块发出的“设置中止”命令有效时,则转换到“中止”状态;当TXT缓冲器处于“就绪”状态且传输开始信号有效(开始向TX仲裁器传输帧数据)时,则转换到“正在传输”状态;当TXT缓冲器处于“正在传输”状态但其传输不成功,则转换返回“就绪”状态;当TXT缓冲器处于“正在传输”状态且由于异常状态的出现导致“设置中止”命令有效时,则转换到“传输终止”状态,从而传输不成功进入“中止”状态;当TXT缓冲器处于“正在传输”状态且传输成功,则转换到“传输完成”状态;当TXT缓冲器处于“传输终止”状态且到达重传限制或总线关闭时,则转换到“传输失败”状态。Figure 4 is a schematic diagram of the operation of the TXT buffer in the CAN FD controller for vehicle-mounted electronic systems provided by the embodiment of the present invention. Please refer to Figure 4. When the CAN FD controller is in the off state, the TXT buffer enters the "transmission failure" state, and the TXT buffer will generate an interrupt when it transitions to the "transmission complete", "abort", or "transmission failure" state. . When the TXT buffer is in the "ready" state, the TX arbiter can select the target TXT buffer from multiple TXT buffers. When the TXT buffer is in the "ready", "transmitting", and "transmission terminated" states, the TX arbiter can read the data in the TXT buffer; when the TXT buffer is in the "empty", "transmission completed", "aborted" state ", "Transmission failed" status, the data can be written to the corresponding address storage space. When the TXT buffer is in the "empty", "transmission completed", "aborted", "transmission failed" state and the "set ready" command issued from the memory register is valid, it transitions to the "ready" state; when the TXT buffer is in the When the "Transfer Complete", "Abort", "Transfer Failed" state and the "Set to Empty" command issued from the memory register is valid, it transitions to the "Empty" state; when the TXT buffer is in the "Ready" state and the "Set to Empty" command from the memory register is valid When the "Set Abort" command issued by the module is valid, it switches to the "Abort" state; when the TXT buffer is in the "Ready" state and the transmission start signal is valid (starts transmitting frame data to the TX arbiter), it switches to the "In Progress" state. Transmitting" state; when the TXT buffer is in the "Transmitting" state but its transmission is unsuccessful, the transition returns to the "Ready" state; when the TXT buffer is in the "Transmitting" state and the "Set Abort" command is caused by the occurrence of an abnormal state When valid, it transitions to the "transmission terminated" state, so that the transmission is unsuccessful and enters the "aborted" state; when the TXT buffer is in the "transmitting" state and the transmission is successful, it transitions to the "transmission completed" state; when the TXT buffer is in the "transmitting" state When the "transmission terminated" state is reached and the retransmission limit is reached or the bus is closed, it transitions to the "transmission failed" state.
可选地,中断管理器具体用于对CAN FD IP的状态进行监控,并在发生预设情况时向CAN FD控制器所在的片上系统或内存寄存器发送中断信息。Optionally, the interrupt manager is specifically used to monitor the status of the CAN FD IP and send interrupt information to the on-chip system or memory register where the CAN FD controller is located when a preset situation occurs.
本实施例中,中断管理器主要对CAN FD IP中的状态进行监控,在发生预设情况时向外部或内存寄存器发送中断信息,同时中断管理器模块还可以通过输入端口drv_bus[1023:0]来控制每个中断的使能和屏蔽等信息。In this embodiment, the interrupt manager mainly monitors the status in the CAN FD IP and sends interrupt information to the external or memory register when a preset situation occurs. At the same time, the interrupt manager module can also use the input port drv_bus[1023:0] To control the enabling and masking of each interrupt.
需要说明的是,本实施例中预设情况是指仲裁丢失、位速率转换、错误出现、达到错误警告限制、故障限制状态已更改、接收帧数据有效、发送帧数据有效、RX缓冲器数据溢出以及RX缓冲器空/满等。It should be noted that the preset conditions in this embodiment refer to arbitration loss, bit rate conversion, error occurrence, error warning limit reached, fault limit status changed, received frame data valid, sent frame data valid, RX buffer data overflow and RX buffer empty/full etc.
可选地,总线采样器还用于检测接收数据和发送数据的发送延迟时间、并检测接收数据和发送数据是否存在位错误。Optionally, the bus sampler is also used to detect the transmission delay time of received data and transmitted data, and to detect whether there are bit errors in the received data and transmitted data.
具体而言,总线采样器以“回读”的方式检测接收或发送数据的发送延迟时间、以及发送和接收过程中是否存在位错误,如果存在发送时间延迟,则可以通过二次采样偏移来消除发送时间延迟。Specifically, the bus sampler detects the transmission delay time of received or transmitted data in a "readback" manner, and whether there are bit errors during the transmission and reception processes. If there is a transmission time delay, it can be detected by subsampling the offset. Eliminate send time delays.
综上,在本发明提供的CAN FD控制器中,控制器局域网络(CAN FD)IP用于实现数据的在其CAN FD网络中的串行接收和发送;发送数据时,CAN FD IP将要发送的数据进行并-串转换,可以在串行数据加入数据起始标志位,在串行数据后加入CRC校验(CyclicRedundancy Check,循环冗余校验)位和若干数据控制位;接收数据时,CAN FD IP将串行读入的接收数据进行过滤、分析以及缓存,同时通过CRC校验机制检查数据接收的正确性。CANFD IP通过AMBA 2.0AHB接口与AMBA AHB连接,通过该接口内部控制器可以对CAN FD内部寄存器进行读或写,对CAN FD进行设置或读取CAN FD状态。此外,该CAN FD IP还提供了中断接口。在CAN FD IP中通过寄存器的设置可以对IP的传输波特率、工作模式、奇偶校验等进行设置。可选地,CAN FD控制器集成在SOC(System on chip,片上系统)中,实现数据的串行接收和发送。In summary, in the CAN FD controller provided by the present invention, the controller area network (CAN FD) IP is used to realize the serial reception and transmission of data in its CAN FD network; when sending data, the CAN FD IP will be sent For parallel-to-serial conversion of data, you can add a data start flag bit to the serial data, add a CRC check (Cyclic Redundancy Check, cyclic redundancy check) bit and several data control bits after the serial data; when receiving data, CAN FD IP filters, analyzes and caches the received data read serially, and at the same time checks the correctness of data reception through the CRC check mechanism. CANFD IP is connected to AMBA AHB through AMBA 2.0AHB interface. Through this interface, the internal controller can read or write CAN FD internal registers, set CAN FD or read CAN FD status. In addition, the CAN FD IP also provides an interrupt interface. In CAN FD IP, the transmission baud rate, working mode, parity check, etc. of the IP can be set through register settings. Optionally, the CAN FD controller is integrated in the SOC (System on chip) to realize serial reception and transmission of data.
通过上述实施例可知,本发明的有益效果在于:It can be seen from the above embodiments that the beneficial effects of the present invention are:
本发明提供一种面向车载电子系统的CAN FD控制器,包括:AHB接口转换模块、内存寄存器、中断管理器、总线采样器、RX缓冲器、多个TXT缓冲器、TX仲裁器和CAN协议内核模块,由于CAN FD控制器将数据发送过程和数据接收过程进行分离处理,避免二者互相影响;同时,本发明提供的CAN FD控制器重新划分各个模块的功能,能够按照协议规范的要求优化工作流程。The invention provides a CAN FD controller for vehicle-mounted electronic systems, including: AHB interface conversion module, memory register, interrupt manager, bus sampler, RX buffer, multiple TXT buffers, TX arbiter and CAN protocol core module, because the CAN FD controller separates the data sending process and the data receiving process to avoid the mutual influence between the two; at the same time, the CAN FD controller provided by the present invention redivides the functions of each module and can optimize the work according to the requirements of the protocol specification. process.
在本发明的描述中,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the present invention, "plurality" means two or more than two, unless otherwise explicitly and specifically limited.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。此外,本领域的技术人员可以将本说明书中描述的不同实施例或示例进行接合和组合。In the description of this specification, reference to the terms "one embodiment," "some embodiments," "an example," "specific examples," or "some examples" or the like means that specific features are described in connection with the embodiment or example. , structures, materials or features are included in at least one embodiment or example of the invention. In this specification, the schematic expressions of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may join and combine the different embodiments or examples described in this specification.
尽管在此结合各实施例对本申请进行了描述,然而,在实施所要求保护的本申请过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。Although the present application has been described herein in connection with various embodiments, in practicing the claimed application, those skilled in the art will understand and understand by reviewing the drawings, the disclosure, and the appended claims. Other variations of the disclosed embodiments are implemented. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit may perform several of the functions recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not mean that a combination of these measures cannot be combined to advantageous effects.
以上内容是结合具体的优选实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。对于本发明所属技术领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本发明的保护范围。The above content is a further detailed description of the present invention in combination with specific preferred embodiments, and it cannot be concluded that the specific implementation of the present invention is limited to these descriptions. For those of ordinary skill in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, and all of them should be regarded as belonging to the protection scope of the present invention.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210190206.XA CN115065572B (en) | 2022-02-28 | 2022-02-28 | CAN FD controller for vehicle-mounted electronic system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210190206.XA CN115065572B (en) | 2022-02-28 | 2022-02-28 | CAN FD controller for vehicle-mounted electronic system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115065572A CN115065572A (en) | 2022-09-16 |
CN115065572B true CN115065572B (en) | 2023-09-29 |
Family
ID=83197214
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210190206.XA Active CN115065572B (en) | 2022-02-28 | 2022-02-28 | CAN FD controller for vehicle-mounted electronic system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115065572B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5799209A (en) * | 1995-12-29 | 1998-08-25 | Chatter; Mukesh | Multi-port internally cached DRAM system utilizing independent serial interfaces and buffers arbitratively connected under a dynamic configuration |
CN106094800A (en) * | 2016-07-12 | 2016-11-09 | 四川大学 | A kind of management system of novel CAN FD controller |
CN106094801A (en) * | 2016-07-12 | 2016-11-09 | 四川大学 | A kind of novel CAN FD controller |
CN109962830A (en) * | 2017-12-26 | 2019-07-02 | 中国船舶重工集团公司七五〇试验场 | A kind of efficient CAN interface based on FPGA |
CN109981431A (en) * | 2019-03-15 | 2019-07-05 | 西安微电子技术研究所 | A kind of CAN controller data storage circuitry and date storage method |
CN110557739A (en) * | 2018-06-04 | 2019-12-10 | 上海千顾汽车科技有限公司 | Multi-channel CAN FD bus monitoring system and monitoring method based on Bluetooth protocol |
CN113824619A (en) * | 2020-06-18 | 2021-12-21 | 恩智浦有限公司 | CAN transceiver |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2712123A1 (en) * | 2012-09-20 | 2014-03-26 | Robert Bosch Gmbh | Standard CAN implementation tolerating CAN FD frames |
-
2022
- 2022-02-28 CN CN202210190206.XA patent/CN115065572B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5799209A (en) * | 1995-12-29 | 1998-08-25 | Chatter; Mukesh | Multi-port internally cached DRAM system utilizing independent serial interfaces and buffers arbitratively connected under a dynamic configuration |
CN106094800A (en) * | 2016-07-12 | 2016-11-09 | 四川大学 | A kind of management system of novel CAN FD controller |
CN106094801A (en) * | 2016-07-12 | 2016-11-09 | 四川大学 | A kind of novel CAN FD controller |
CN109962830A (en) * | 2017-12-26 | 2019-07-02 | 中国船舶重工集团公司七五〇试验场 | A kind of efficient CAN interface based on FPGA |
CN110557739A (en) * | 2018-06-04 | 2019-12-10 | 上海千顾汽车科技有限公司 | Multi-channel CAN FD bus monitoring system and monitoring method based on Bluetooth protocol |
CN109981431A (en) * | 2019-03-15 | 2019-07-05 | 西安微电子技术研究所 | A kind of CAN controller data storage circuitry and date storage method |
CN113824619A (en) * | 2020-06-18 | 2021-12-21 | 恩智浦有限公司 | CAN transceiver |
Non-Patent Citations (3)
Title |
---|
Zifeng Wang ; Shuqin Geng ; Xiaohong Peng ; Yan Zhang ; Shuaiqi Yan ; Haonan Tang.The Driven Design of CAN-FD Bus Controller Based on Cortex-M0.《2020 IEEE 5th International Conference on Integrated Circuits and Microsystems (ICICM)》.2020,全文. * |
基于CAN总线的Transceiver芯片设计;杨耀杰;《中国优秀硕士学位论文全文数据库》;全文 * |
基于stateflow的车载CAN-FD网络建模与仿真;王利辉;赵丰;王本雄;张明;徐伟业;李进军;赵超;;《电子测量技术》(15);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN115065572A (en) | 2022-09-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5721955A (en) | System for transferring portion of data to host from buffer if size of packet is greater than first threshold value but less than second threshold value | |
US6205501B1 (en) | Apparatus and method for handling universal serial bus control transfers | |
US20080163005A1 (en) | Error injection in pci-express devices | |
JP4554863B2 (en) | Network adapter and communication method with reduced hardware | |
US6701406B1 (en) | PCI and MII compatible home phoneline networking alliance (HPNA) interface device | |
CN110213143B (en) | 1553B bus IP core and monitoring system | |
US20110320706A1 (en) | Storage apparatus and method for controlling the same | |
US20050002384A1 (en) | Method of transmitting data through an I2C router | |
US10348616B2 (en) | Packet transmission method and apparatus, and interconnect interface | |
US8166227B2 (en) | Apparatus for processing peripheral component interconnect express protocol | |
GB2404540A (en) | Router for I2C bus which prevents unauthorised data access | |
CN103178872B (en) | Method and the device of USB system transfers distance is extended by Ethernet | |
GB2403315A (en) | System for detecting and resetting a device coupled to an inter-integrated circuit router | |
CN100585578C (en) | Anti-deadlock method and device for system bus | |
US12001375B2 (en) | Interconnect system | |
JP3920280B2 (en) | Data transmission method through I2C router | |
GB2403565A (en) | Inter-integrated bus port or router for providing increased security | |
CN101304362B (en) | Retransmission buffering apparatus and data transmission method | |
WO2023207571A1 (en) | Data transmission method and device | |
US20050060472A1 (en) | Communications bus transceiver | |
CN115065572B (en) | CAN FD controller for vehicle-mounted electronic system | |
CN118381721B (en) | Method for configuring serializer or sensor by I2C broadcast in A-PHY system | |
US7802026B2 (en) | Method and system for processing frames in storage controllers | |
US20210173808A1 (en) | Early parity error detection on an i3c bus | |
US10848263B2 (en) | Methods for reducing data errors in transceiving of a flash storage interface and apparatuses using the same |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |