CN118612010A - A CAN bus controller system capable of dynamically managing filter SRAM - Google Patents
A CAN bus controller system capable of dynamically managing filter SRAM Download PDFInfo
- Publication number
- CN118612010A CN118612010A CN202410868351.8A CN202410868351A CN118612010A CN 118612010 A CN118612010 A CN 118612010A CN 202410868351 A CN202410868351 A CN 202410868351A CN 118612010 A CN118612010 A CN 118612010A
- Authority
- CN
- China
- Prior art keywords
- filter
- filtering
- sram
- bus controller
- message
- 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
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/40006—Architecture of a communication node
- H04L12/40026—Details regarding a bus guardian
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及CAN总线技术领域,尤其涉及一种可动态管理滤波器SRAM的CAN总线控制器系统。The present invention relates to the technical field of CAN bus, and in particular to a CAN bus controller system capable of dynamically managing a filter SRAM.
背景技术Background Art
CAN(Controller Area Network)目前作为一种ISO国际标准化的串行通信协议,是国际上应用广泛的开放式现场总线之一,最初由德国Bosch公司设计,应用于汽车的监视和控制。之后,CAN总线作为一种多种串行通信总线,由于其低成本、高可靠性、可远程请求等优势,在计算机、通信网络、智能传感技术以及工业控制等领域发挥着越来越重要的作用。目前主要都是针对CAN2.0协议的开发,但是随着对CAN总线通信速率的需求,FDCAN的发展也得到越来越多的关注。FDCAN(CAN with Flexible Data rate)是CAN总线的一种升级版,它继承了CAN的主要特性,并弥补了CAN的数据长度和带宽的限制。CAN (Controller Area Network) is currently an ISO internationally standardized serial communication protocol and one of the most widely used open fieldbuses in the world. It was originally designed by Bosch of Germany and used for automobile monitoring and control. Later, as a variety of serial communication buses, CAN bus has played an increasingly important role in the fields of computers, communication networks, intelligent sensor technology, and industrial control due to its advantages such as low cost, high reliability, and remote request. At present, the development is mainly aimed at the CAN2.0 protocol, but with the demand for the communication rate of the CAN bus, the development of FDCAN has also received more and more attention. FDCAN (CAN with Flexible Data rate) is an upgraded version of the CAN bus. It inherits the main characteristics of CAN and makes up for the limitations of CAN data length and bandwidth.
目前涉及CAN总线的现有技术很多,比如专利号为20081010106353.4的《双冗余CAN总线控制器及其报文处理方法》、专利号为201620798479.2的《CAN总线HUB板卡》、专利号为201710586911.0的《CAN总线网络控制方法及CAN总线网络》等都对两个及以上的CAN总线控制器进行了研究,但是这些控制器都是CAN2.0总线控制器,不涉及FDCAN总线控制器,并且验收滤波器都是默认的内置寄存器,不涉及对共享验收滤波器SRAM的改进。There are many existing technologies related to the CAN bus, such as "Dual Redundant CAN Bus Controller and Message Processing Method Thereof" with Patent No. 20081010106353.4, "CAN Bus HUB Board" with Patent No. 201620798479.2, and "CAN Bus Network Control Method and CAN Bus Network" with Patent No. 201710586911.0. These have all studied two or more CAN bus controllers, but these controllers are all CAN2.0 bus controllers, not FDCAN bus controllers, and the acceptance filters are all default built-in registers, and do not involve improvements to the shared acceptance filter SRAM.
如图1所示,常规的CAN总线控制器的验收滤波器都是默认的内置寄存器,外部通过配置寄存器配置ID和掩码,每次只能过滤接收有限的特定的消息。当想要接收其他消息需要重新配置。在冗余CAN总线控制器系统中,每个CAN总线控制器都是利用自身的验收滤波器实现消息过滤。图8示出常规的CAN总线控制器系统通信流程,其滤波器初始化包括配置ID过滤模式寄存器,并将一组的ID参考值和掩码写入对应寄存器,通信过程中只能利用这组ID和掩码及其对应模式进行过滤。As shown in Figure 1, the acceptance filters of conventional CAN bus controllers are all default built-in registers. The ID and mask are configured externally through the configuration register. Only limited specific messages can be filtered and received each time. When you want to receive other messages, you need to reconfigure. In a redundant CAN bus controller system, each CAN bus controller uses its own acceptance filter to implement message filtering. Figure 8 shows the communication process of a conventional CAN bus controller system. Its filter initialization includes configuring the ID filter mode register, and writing a set of ID reference values and masks into the corresponding registers. During the communication process, only this set of IDs and masks and their corresponding modes can be used for filtering.
在冗余CAN总线控制器的实际应用场景中,可能几个CAN总线控制器期望过滤的消息相同,此时共享滤波器SRAM相较于CAN总线控制器独享滤波寄存器更能节约资源。也可能不同CAN总线控制器期望的滤波的ID数量不同,或者某些CAN不工作,就不需要配置滤波器。如果每个CAN总线控制器固定分配容量,就会造成资源浪费,应用不便等问题。In the actual application scenario of redundant CAN bus controllers, several CAN bus controllers may expect to filter the same messages. In this case, sharing the filter SRAM can save more resources than using the filter registers exclusively for the CAN bus controllers. It is also possible that different CAN bus controllers expect different numbers of IDs to be filtered, or some CANs do not work, so there is no need to configure filters. If each CAN bus controller is allocated a fixed capacity, it will cause problems such as waste of resources and inconvenience in application.
发明内容Summary of the invention
基于以上问题,本发明的目的在于实现验收滤波器SRAM动态管理分配到多个CAN总线控制器,可以根据需求分配SRAM空间,从而实现对SRAM空间的充分利用,减少系统面积与功耗、避免资源浪费。Based on the above problems, the purpose of the present invention is to realize dynamic management of acceptance filter SRAM and allocate it to multiple CAN bus controllers. SRAM space can be allocated according to demand, thereby fully utilizing the SRAM space, reducing system area and power consumption, and avoiding resource waste.
本发明实现其发明目的所采用的技术方案是,一种可动态管理滤波器SRAM的CAN总线控制器系统,包括接口管理模块、验收滤波器控制模块、验收滤波器SRAM、总线控制器初始化模块及n个CAN总线控制器,其中:The technical solution adopted by the present invention to achieve its invention object is a CAN bus controller system capable of dynamically managing filter SRAM, comprising an interface management module, an acceptance filter control module, an acceptance filter SRAM, a bus controller initialization module and n CAN bus controllers, wherein:
所述接口管理模块用于通过CAN总线控制器初始化模块进行CAN总线控制器的初始化,用于通过验收滤波器控制模块进行验收滤波器初始化,通过对外部输入信号进行控制,根据相应的地址、数据、控制信号配置内部寄存器;The interface management module is used to initialize the CAN bus controller through the CAN bus controller initialization module, and to initialize the acceptance filter through the acceptance filter control module, and to configure the internal register according to the corresponding address, data, and control signal by controlling the external input signal;
所述验收滤波器控制模块用于根据外部配置控制验收滤波器SRAM的分配,并将验收滤波器SRAM的数据和接收的ID以及IDE、RTR、EDL、FDF的内容进行比较,以决定是否接收报文;验收滤波器控制模块还与CAN总线控制器相连;The acceptance filter control module is used to control the allocation of the acceptance filter SRAM according to the external configuration, and compare the data of the acceptance filter SRAM with the received ID and the contents of IDE, RTR, EDL, and FDF to determine whether to receive the message; the acceptance filter control module is also connected to the CAN bus controller;
所述验收滤波器SRAM用于存储外部配置的用于过滤的ID即滤波参考值和滤波掩码;The acceptance filter SRAM is used to store the externally configured ID for filtering, i.e., the filtering reference value and the filtering mask;
所述CAN总线控制器初始化模块与CAN总线控制器相连,用于根据外部配置完成CAN总线控制器的初始化;The CAN bus controller initialization module is connected to the CAN bus controller and is used to complete the initialization of the CAN bus controller according to the external configuration;
所述CAN总线控制器为标准CAN总线控制器或者FDCAN总线控制器,所述n的最大值为32。The CAN bus controller is a standard CAN bus controller or an FDCAN bus controller, and the maximum value of n is 32.
进一步,所述CAN总线控制器包括发送缓冲区、接收FIFO、位流处理器、位时序逻辑,其中:Further, the CAN bus controller includes a transmit buffer, a receive FIFO, a bit stream processor, and a bit timing logic, wherein:
所述发送缓冲区用于存储外部写入的待发送的帧报文;The sending buffer is used to store externally written frame messages to be sent;
所述接收FIFO用于储存从CAN总线上接收到的并通过验收过滤的报文;The receiving FIFO is used to store messages received from the CAN bus and passed the acceptance filter;
所述位流处理器用于在发送缓冲区、接收FIFO和CAN总线之间控制数据流;当CAN总线控制器处于发送模式时,发送请求置位时,将发送缓冲区帧报文按照CAN标准的帧格式发送;当CAN总线控制器处于接收模式时,从CAN总线接收报文,并将帧ID送入验收滤波器控制器,当验收滤波器指示通过过滤后,将接收的报文送入接收FIFO存储;The bit stream processor is used to control the data flow between the sending buffer, the receiving FIFO and the CAN bus; when the CAN bus controller is in the sending mode, when the sending request is set, the frame message in the sending buffer is sent according to the frame format of the CAN standard; when the CAN bus controller is in the receiving mode, the message is received from the CAN bus, and the frame ID is sent to the acceptance filter controller, and when the acceptance filter indicates that the filter has passed, the received message is sent to the receiving FIFO for storage;
所述位时序逻辑用于监视CAN总线和处理与CAN总线有关的位时序。The bit timing logic is used to monitor the CAN bus and process the bit timing related to the CAN bus.
更进一步,所述验收滤波器控制模块包括滤波器起始组寄存器、滤波器模式寄存器、滤波处理单元,其中:Furthermore, the acceptance filter control module includes a filter starting group register, a filter mode register, and a filter processing unit, wherein:
所述滤波器起始组寄存器用于根据外部配置的每个CAN总线控制器的起始过滤器组实现对验收滤波器SRAM的分配;The filter start group register is used to realize the allocation of the acceptance filter SRAM according to the start filter group of each CAN bus controller configured externally;
所述滤波器模式寄存器为32位,每bit分别控制每组滤波器数据过滤模式,根据外部配置模式分为ID完全匹配过滤模式或者ID掩码过滤模式;The filter mode register is 32 bits, and each bit controls the filter mode of each group of filters, which is divided into ID complete match filter mode or ID mask filter mode according to the external configuration mode;
所述滤波处理单元用于验收滤波器SRAM的数据和接收的ID以及IDE、RTR、EDL、FDF的内容进行比较,以决定是否接收报文。The filtering processing unit is used to compare the data in the acceptance filter SRAM with the received ID and the contents of IDE, RTR, EDL and FDF to determine whether to receive the message.
作为再进一步的优选方案,所述滤波器起始组寄存器可以由外部根据需求对不同CAN总线控制器的起始地址配置为相同值,或者为不同值;As a further preferred solution, the filter start group register can be configured externally to have the same value or different values for the start addresses of different CAN bus controllers according to requirements;
如果不同CAN总线控制器期望过滤相同消息,则配置为相同值实现SRAM数据共享;If different CAN bus controllers expect to filter the same message, they are configured with the same value to achieve SRAM data sharing;
如果不同CAN总线控制器期望过滤不同消息,则配置为不同值实现SRAM的动态分配。If different CAN bus controllers are expected to filter different messages, they are configured with different values to achieve dynamic allocation of SRAM.
作为另一种优选方案,所述滤波处理单元工作在ID完全匹配过滤模式下时,在接收到所述位流处理器传入的接收到的消息ID后,如果消息为标准帧,将接收消息的11bitID及IDE、RTR、EDL、FDF的内容与读出的SRAM的滤波参考值进行比较;如果消息为扩展帧,需要将接收消息的29bit ID及IDE、RTR、EDL、FDF的内容与读出的SRAM的滤波参考值进行比较;如果完全匹配,则通过过滤,将匹配标志拉高传入CAN总线控制器,指示将消息存入接收FIFO;否则,消息没有通过过滤,匹配标志保持为低,指示消息不需要存储到接收FIFO;As another preferred solution, when the filtering processing unit works in the ID complete match filtering mode, after receiving the received message ID transmitted by the bit stream processor, if the message is a standard frame, the 11-bit ID and the contents of IDE, RTR, EDL, and FDF of the received message are compared with the filtering reference value read out of the SRAM; if the message is an extended frame, the 29-bit ID and the contents of IDE, RTR, EDL, and FDF of the received message need to be compared with the filtering reference value read out of the SRAM; if it is a complete match, the filtering is passed, and the match flag is pulled high and transmitted to the CAN bus controller, indicating that the message is stored in the receive FIFO; otherwise, the message does not pass the filtering, and the match flag remains low, indicating that the message does not need to be stored in the receive FIFO;
所述滤波处理单元工作在ID掩码过滤模式下时,在接收到所述位流处理器传入的接收到的消息ID后,读出SRAM的滤波参考值和滤波掩码;滤波掩码指示接收到消息的ID及IDE、RTR、EDL、FDF是否需要与滤波参考值进行匹配;滤波掩码为1表示该位必须与滤波参考值中的内容一致才能通过过滤,滤波掩码为0表示该位不做比较;如果消息为标准帧,即使滤波掩码和滤波参考值的EXID对应位均为1,由于标准帧ID不存在EXID,因此滤波掩码和滤波参考值的EXID也不参与滤波,在该模式下,通过掩码控制选择是否关注接收消息的IDE、RTR和EDL、FDF;如果通过过滤,将匹配标志拉高传入CAN总线控制器,指示将消息存入接收FIFO;否则,消息没有通过过滤,匹配标志保持为低,指示消息不需要存储到接收FIFO。When the filtering processing unit works in the ID mask filtering mode, after receiving the received message ID transmitted by the bit stream processor, the filtering reference value and filtering mask of the SRAM are read out; the filtering mask indicates whether the ID and IDE, RTR, EDL, and FDF of the received message need to be matched with the filtering reference value; a filtering mask of 1 indicates that the bit must be consistent with the content in the filtering reference value to pass the filtering, and a filtering mask of 0 indicates that the bit is not compared; if the message is a standard frame, even if the corresponding bits of the EXID of the filtering mask and the filtering reference value are both 1, since the standard frame ID does not have an EXID, the filtering mask and the EXID of the filtering reference value do not participate in the filtering. In this mode, the mask control is used to select whether to pay attention to the IDE, RTR, EDL, and FDF of the received message; if the filtering is passed, the matching flag is pulled high and transmitted to the CAN bus controller, indicating that the message is stored in the receiving FIFO; otherwise, the message does not pass the filtering, and the matching flag remains low, indicating that the message does not need to be stored in the receiving FIFO.
进一步,所述验收滤波器SRAM分为SRAM0和SRAM1,两个SRAM同样大小均为32x32bit共128Byte,相同深度的滤波器数据为一组,共计32组,在ID掩码过滤模式下SRAM0和SRAM1分别存储32bit滤波参考值和32bit滤波掩码,在ID完全匹配过滤模式下,SRAM0和SRAM1都存储32bit的滤波参考值。Furthermore, the acceptance filter SRAM is divided into SRAM0 and SRAM1. The two SRAMs have the same size of 32x32bit, totaling 128Byte. The filter data of the same depth are grouped together, totaling 32 groups. In the ID mask filtering mode, SRAM0 and SRAM1 store 32-bit filtering reference values and 32-bit filtering masks respectively. In the ID complete match filtering mode, SRAM0 and SRAM1 both store 32-bit filtering reference values.
本发明的有益效果为:The beneficial effects of the present invention are:
提供多个CAN或FDCAN总线控制器共享的可以动态管理的验收滤波器SRAM,使用时利用每个CAN或FDCAN总线控制器在滤波器SRAM空间的起始地址进行划分,可以实现验收滤波器SRAM滤波数据共享和动态分配,充分利用SRAM资源,减少系统面积与功耗,避免资源浪费。A dynamically managed acceptance filter SRAM shared by multiple CAN or FDCAN bus controllers is provided. When in use, the starting address of the filter SRAM space of each CAN or FDCAN bus controller is used for division, so that the acceptance filter SRAM filter data can be shared and dynamically allocated, so as to make full use of SRAM resources, reduce system area and power consumption, and avoid resource waste.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为常规的CAN总线控制器系统示意图;FIG1 is a schematic diagram of a conventional CAN bus controller system;
图2为本发明实施例CAN总线控制器系统示意图;FIG2 is a schematic diagram of a CAN bus controller system according to an embodiment of the present invention;
图3为本发明实施例CAN总线控制器示意图;FIG3 is a schematic diagram of a CAN bus controller according to an embodiment of the present invention;
图4为本发明实施例验收滤波器控制模块示意图;FIG4 is a schematic diagram of an acceptance filter control module according to an embodiment of the present invention;
图5为本发明实施例验收滤波器SRAM共享和动态分配示意图;5 is a schematic diagram of SRAM sharing and dynamic allocation of acceptance filters according to an embodiment of the present invention;
图6为本发明实施例验收滤波器SRAM完全匹配过滤模式数据映射图;6 is a data mapping diagram of the SRAM perfect matching filter mode of the acceptance filter according to an embodiment of the present invention;
图7为本发明实施例验收滤波器SRAM掩码过滤模式数据映射图;7 is a data mapping diagram of the SRAM mask filtering mode of the acceptance filter according to an embodiment of the present invention;
图8为常规的CAN总线控制器系统通信流程示意图;FIG8 is a schematic diagram of a conventional CAN bus controller system communication flow;
图9为本发明实施例CAN总线控制器系统通信流程示意图。FIG. 9 is a schematic diagram of the communication flow of the CAN bus controller system according to an embodiment of the present invention.
具体实施方式DETAILED DESCRIPTION
为了能够更清楚地理解本发明的上述目的、特征和优点,下面结合附图和具体实施方式对本发明进行进一步的详细描述。In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
图2~7及图9示出本发明可动态管理滤波器SRAM的CAN总线控制器系统的一种具体实施方式:包括接口管理模块、验收滤波器控制模块、验收滤波器SRAM、总线控制器初始化模块及n个CAN总线控制器,其中:2 to 7 and 9 show a specific implementation of the CAN bus controller system capable of dynamically managing the filter SRAM of the present invention: comprising an interface management module, an acceptance filter control module, an acceptance filter SRAM, a bus controller initialization module and n CAN bus controllers, wherein:
所述接口管理模块用于通过CAN总线控制器初始化模块进行CAN总线控制器的初始化,用于通过验收滤波器控制模块进行验收滤波器初始化,通过对外部输入信号进行控制,根据相应的地址、数据、控制信号配置内部寄存器;The interface management module is used to initialize the CAN bus controller through the CAN bus controller initialization module, and to initialize the acceptance filter through the acceptance filter control module, and to configure the internal register according to the corresponding address, data, and control signal by controlling the external input signal;
所述验收滤波器控制模块用于根据外部配置控制验收滤波器SRAM的分配,并将验收滤波器SRAM的数据和接收的ID以及IDE、RTR、EDL、FDF的内容进行比较,以决定是否接收报文;The acceptance filter control module is used to control the allocation of the acceptance filter SRAM according to the external configuration, and compare the data of the acceptance filter SRAM with the received ID and the contents of IDE, RTR, EDL, and FDF to determine whether to receive the message;
所述验收滤波器SRAM用于存储外部配置的用于过滤的ID即滤波参考值和滤波掩码;The acceptance filter SRAM is used to store the externally configured ID for filtering, i.e., the filtering reference value and the filtering mask;
所述CAN总线控制器初始化模块与CAN总线控制器相连,用于根据外部配置完成CAN总线控制器的初始化;The CAN bus controller initialization module is connected to the CAN bus controller and is used to complete the initialization of the CAN bus controller according to the external configuration;
所述CAN总线控制器为标准CAN总线控制器或者FDCAN总线控制器,所述n为32。The CAN bus controller is a standard CAN bus controller or a FDCAN bus controller, and n is 32.
本实施例中,所述CAN总线控制器包括发送缓冲区、接收FIFO、位流处理器、位时序逻辑,其中:In this embodiment, the CAN bus controller includes a sending buffer, a receiving FIFO, a bit stream processor, and a bit timing logic, wherein:
所述发送缓冲区用于存储外部写入的待发送的帧报文;The sending buffer is used to store externally written frame messages to be sent;
所述接收FIFO用于储存从CAN总线上接收到的并通过验收过滤的报文;The receiving FIFO is used to store messages received from the CAN bus and passed the acceptance filter;
所述位流处理器用于在发送缓冲区、接收FIFO和CAN总线之间控制数据流;当CAN总线控制器处于发送模式时,发送请求置位时,将发送缓冲区帧报文按照CAN标准的帧格式发送;当CAN总线控制器处于接收模式时,从CAN总线接收报文,并将帧ID送入验收滤波器控制器,当验收滤波器指示通过过滤后,将接收的报文送入接收FIFO存储;The bit stream processor is used to control the data flow between the sending buffer, the receiving FIFO and the CAN bus; when the CAN bus controller is in the sending mode, when the sending request is set, the sending buffer frame message is sent according to the frame format of the CAN standard; when the CAN bus controller is in the receiving mode, the message is received from the CAN bus, and the frame ID is sent to the acceptance filter controller, and when the acceptance filter indicates that the filter has passed, the received message is sent to the receiving FIFO for storage;
所述位时序逻辑用于监视CAN总线和处理与CAN总线有关的位时序。The bit timing logic is used to monitor the CAN bus and process the bit timing related to the CAN bus.
本实施例中,所述验收滤波器控制模块包括滤波器起始组寄存器、滤波器模式寄存器、滤波处理单元,其中:In this embodiment, the acceptance filter control module includes a filter starting group register, a filter mode register, and a filter processing unit, wherein:
所述滤波器起始组寄存器用于根据外部配置的每个CAN总线控制器的起始过滤器组实现对验收滤波器SRAM的分配;The filter start group register is used to realize the allocation of the acceptance filter SRAM according to the start filter group of each CAN bus controller configured externally;
滤波器起始组寄存器可以由外部根据需求对不同CAN总线控制器的起始地址配置为相同值,或者为不同值;The filter start group register can be configured externally to have the same value or different values for the start addresses of different CAN bus controllers according to requirements;
如果不同CAN总线控制器期望过滤相同消息,则配置为相同值实现SRAM数据共享;If different CAN bus controllers expect to filter the same message, they are configured with the same value to achieve SRAM data sharing;
如果不同CAN总线控制器期望过滤不同消息,则配置为不同值实现SRAM的动态分配。If different CAN bus controllers are expected to filter different messages, they are configured with different values to achieve dynamic allocation of SRAM.
如图5所示,CAN2和CAN3控制器共享SRAM数据,其他控制器独享SRAM数据实现动态分配SRAM,其他共享数据和动态分配SRAM数据实施可以根据需求对应配置相应滤波器起始组寄存器为合适值。As shown in FIG5 , CAN2 and CAN3 controllers share SRAM data, and other controllers exclusively use SRAM data to implement dynamic SRAM allocation. Other shared data and dynamically allocated SRAM data can configure the corresponding filter start group registers to appropriate values according to requirements.
所述滤波器模式寄存器为32位,每bit分别控制每组滤波器数据过滤模式,根据外部配置模式分为ID完全匹配过滤模式或者ID掩码过滤模式;The filter mode register is 32 bits, and each bit controls the filter mode of each group of filters, which is divided into ID complete match filter mode or ID mask filter mode according to the external configuration mode;
所述滤波处理单元用于验收滤波器SRAM的数据和接收的ID以及IDE、RTR、EDL、FDF的内容进行比较,以决定是否接收报文。滤波处理单元与CAN总线控制器中的位流处理器相连。The filter processing unit is used to compare the data in the acceptance filter SRAM with the received ID and the contents of IDE, RTR, EDL and FDF to determine whether to receive the message. The filter processing unit is connected to the bit stream processor in the CAN bus controller.
滤波处理单元工作在ID完全匹配过滤模式下时,在接收到所述位流处理器传入的接收到的消息ID后,如果消息为标准帧,将接收消息的11bit ID及IDE、RTR、EDL、FDF的内容与读出的SRAM的滤波参考值进行比较;如果消息为扩展帧,需要将接收消息的29bit ID及IDE、RTR、EDL、FDF的内容与读出的SRAM的滤波参考值进行比较;如果完全匹配,则通过过滤,将匹配标志拉高传入CAN总线控制器,指示将消息存入接收FIFO;否则,消息没有通过过滤,匹配标志保持为低,指示消息不需要存储到接收FIFO;When the filtering processing unit works in the ID complete match filtering mode, after receiving the received message ID transmitted by the bit stream processor, if the message is a standard frame, the 11-bit ID and the contents of IDE, RTR, EDL, and FDF of the received message are compared with the filtering reference value read out of the SRAM; if the message is an extended frame, the 29-bit ID and the contents of IDE, RTR, EDL, and FDF of the received message need to be compared with the filtering reference value read out of the SRAM; if it is completely matched, it passes the filtering, pulls up the match flag and transmits it to the CAN bus controller, indicating that the message is stored in the receiving FIFO; otherwise, the message does not pass the filtering, and the match flag remains low, indicating that the message does not need to be stored in the receiving FIFO;
滤波处理单元工作在ID掩码过滤模式下时,在接收到所述位流处理器传入的接收到的消息ID后,读出SRAM的滤波参考值和滤波掩码;滤波掩码指示接收到消息的ID及IDE、RTR、EDL、FDF是否需要与滤波参考值进行匹配;滤波掩码为1表示该位必须与滤波参考值中的内容一致才能通过过滤,滤波掩码为0表示该位不做比较;如果消息为标准帧,即使滤波掩码和滤波参考值的EXID对应位均为1,由于标准帧ID不存在EXID,因此滤波掩码和滤波参考值的EXID也不参与滤波,在该模式下,通过掩码控制选择是否关注接收消息的IDE、RTR和EDL、FDF;如果通过过滤,将匹配标志拉高传入CAN总线控制器,指示将消息存入接收FIFO;否则,消息没有通过过滤,匹配标志保持为低,指示消息不需要存储到接收FIFO。When the filtering processing unit works in the ID mask filtering mode, after receiving the received message ID transmitted by the bit stream processor, the filtering reference value and filtering mask of the SRAM are read out; the filtering mask indicates whether the ID and IDE, RTR, EDL, and FDF of the received message need to be matched with the filtering reference value; the filtering mask is 1, indicating that the bit must be consistent with the content in the filtering reference value to pass the filtering, and the filtering mask is 0, indicating that the bit is not compared; if the message is a standard frame, even if the corresponding bits of the EXID of the filtering mask and the filtering reference value are both 1, since the standard frame ID does not have EXID, the filtering mask and the EXID of the filtering reference value do not participate in the filtering. In this mode, the mask control is used to select whether to pay attention to the IDE, RTR, EDL, and FDF of the received message; if the filtering is passed, the matching flag is pulled high and transmitted to the CAN bus controller, indicating that the message is stored in the receiving FIFO; otherwise, the message does not pass the filtering, and the matching flag remains low, indicating that the message does not need to be stored in the receiving FIFO.
本实施例中,所述验收滤波器SRAM分为SRAM0和SRAM1,两个SRAM同样大小均为32x32bit共128Byte,相同深度的滤波器数据为一组,共计32组,在ID掩码过滤模式下SRAM0和SRAM1分别存储32bit滤波参考值和32bit滤波掩码,在ID完全匹配过滤模式下,SRAM0和SRAM1都存储32bit的滤波参考值。In this embodiment, the acceptance filter SRAM is divided into SRAM0 and SRAM1. The two SRAMs have the same size of 32x32bit, totaling 128Byte. The filter data of the same depth are grouped together, totaling 32 groups. In the ID mask filtering mode, SRAM0 and SRAM1 store 32-bit filtering reference values and 32-bit filtering masks respectively. In the ID complete match filtering mode, SRAM0 and SRAM1 both store 32-bit filtering reference values.
图9示出本实施例的CAN总线控制器通信流程,其中滤波器初始化主要流程如下:FIG9 shows the CAN bus controller communication process of this embodiment, wherein the main process of filter initialization is as follows:
1)配置当前CAN总线控制器系统滤波器起始组寄存器;1) Configure the current CAN bus controller system filter start group register;
2)配置滤波器模式寄存器,每bit分别控制每组滤波器数据过滤模式,分为ID完全匹配过滤模式或者ID掩码过滤模式;2) Configure the filter mode register, each bit controls the data filtering mode of each group of filters, which is divided into ID complete match filtering mode or ID mask filtering mode;
3)初始化SRAM0和SRAM1。3) Initialize SRAM0 and SRAM1.
本发明的上述实施例仅仅是为说明本发明所作的举例,而并非是对本发明的实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其他不同形式的变化和变动。这里无法对所有的实施方式予以穷举。凡是属于本发明的技术方案所引申出的显而易见的变化或变动仍处于本发明的保护范围之列。The above embodiments of the present invention are merely examples for illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes and modifications can be made based on the above description. It is impossible to list all the embodiments here. Any obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410868351.8A CN118612010A (en) | 2024-07-01 | 2024-07-01 | A CAN bus controller system capable of dynamically managing filter SRAM |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410868351.8A CN118612010A (en) | 2024-07-01 | 2024-07-01 | A CAN bus controller system capable of dynamically managing filter SRAM |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118612010A true CN118612010A (en) | 2024-09-06 |
Family
ID=92559449
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410868351.8A Pending CN118612010A (en) | 2024-07-01 | 2024-07-01 | A CAN bus controller system capable of dynamically managing filter SRAM |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118612010A (en) |
-
2024
- 2024-07-01 CN CN202410868351.8A patent/CN118612010A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6122676A (en) | Apparatus and method for transmitting and receiving data into and out of a universal serial bus device | |
US6985969B1 (en) | Receiving data on a networked computer in a reduced power state | |
AU703388B2 (en) | Method and apparatus for exchanging data, status and commands over an hierarchical serial bus assembly using communication packets | |
KR101077900B1 (en) | Method for communication of interface device of SoC-based system network and interface device communicating by the same | |
US6546496B1 (en) | Network interface with power conservation using dynamic clock control | |
US8542693B2 (en) | Managing free packet descriptors in packet-based communications | |
CN101937406A (en) | Method and system for driving 1394 devices in VxWorks operating system | |
CN111221759B (en) | Data processing system and method based on DMA | |
JP2002204253A (en) | Host processor in asynchronous transfer mode, interface unit for inter-digital signal processor transfer, and data processing system using the same | |
CN114546913B (en) | Method and device for high-speed data interaction between multiple hosts based on PCIE interface | |
US7860120B1 (en) | Network interface supporting of virtual paths for quality of service with dynamic buffer allocation | |
CN113852656A (en) | A data transmission method, processor system and memory access system | |
CN110941582B (en) | A USB bus structure of a BMC chip and its communication method | |
JP2009502072A (en) | FlexRay communication module, FlexRay communication control device, and method for transmitting a message between a FlexRay communication connection and a FlexRay subscriber device | |
US20120324078A1 (en) | Apparatus and method for sharing i/o device | |
CN118113496B (en) | Inter-process communication method, system and chip based on multi-core heterogeneous SOC | |
CN118612010A (en) | A CAN bus controller system capable of dynamically managing filter SRAM | |
CN114185830A (en) | Mailbox-based multiprocessor communication method, device, system and storage medium | |
CN116166581A (en) | Queue type DMA controller circuit for PCIE bus and data transmission method | |
US6834316B1 (en) | Data transfer controller and electronic device | |
US6421745B1 (en) | Asynchronous connections with scattering page tables for transmitting data from a producer device to a consumer device over an IEEE 1394 serial data bus | |
US6915356B1 (en) | Register addresses optimum access | |
CN118642669B (en) | Double-end access method, system, main controller card and sub-card | |
US6789144B1 (en) | Apparatus and method in a network interface device for determining data availability in a random access memory | |
CN221768064U (en) | A system for interconnecting PCIE and RapidIO protocols based on FPGA |
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 |