CN117793218A - CAN network signal line concentration conversion device - Google Patents

CAN network signal line concentration conversion device Download PDF

Info

Publication number
CN117793218A
CN117793218A CN202311823690.6A CN202311823690A CN117793218A CN 117793218 A CN117793218 A CN 117793218A CN 202311823690 A CN202311823690 A CN 202311823690A CN 117793218 A CN117793218 A CN 117793218A
Authority
CN
China
Prior art keywords
network
control unit
data
signal
spi
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
Application number
CN202311823690.6A
Other languages
Chinese (zh)
Inventor
孙子琪
张雄飞
白军强
赵辉
许仕佳
易丹
张超
付兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Shipbuilding Haifeng Aviation Technology Co ltd
Original Assignee
China Shipbuilding Haifeng Aviation Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by China Shipbuilding Haifeng Aviation Technology Co ltd filed Critical China Shipbuilding Haifeng Aviation Technology Co ltd
Priority to CN202311823690.6A priority Critical patent/CN117793218A/en
Publication of CN117793218A publication Critical patent/CN117793218A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a CAN network signal line concentration conversion device, which comprises a CAN signal conversion unit, a data centralized control unit, a network signal control unit and a digital signal conversion unit; the CAN signal conversion unit is used for converting the CAN signal into an SPI signal; the data centralized control unit and the network signal control unit provide a plurality of SPI buses for the CAN communication module to mount; the digital signal conversion unit provides a multi-way switch interface and performs information interaction with the centralized control unit through the bottom plate. The invention integrates the digital conversion board, the network communication board and the CAN combination board on the CAN network signal line concentration conversion device, thereby realizing the data interaction requirement of a plurality of slave devices and host devices, improving the reliability of the device, saving the cost and ensuring that each device has an independent network interface.

Description

CAN network signal line concentration conversion device
Technical Field
The invention belongs to the technical field of communication equipment, and particularly relates to a CAN network signal line concentration conversion device.
Background
In a CAN network information system, a plurality of slave devices and a host device are in CAN network communication, and because the system reliability requirement is extremely high, the risk of paralysis of the whole system is easily caused by single-point faults in a bus network topology mode, and each device requires the host to provide an independent network interface. In the existing equipment, the available network interfaces are fewer, and the use requirements of the intelligent information system in the current ship and aviation industries cannot be met.
Disclosure of Invention
The invention provides a CAN network signal line concentration conversion device, which is improved in that the device comprises a CAN signal conversion unit, a data centralized control unit, a network signal control unit and a digital signal conversion unit; the CAN signal conversion unit is used for converting the CAN signal into an SPI signal; the data centralized control unit and the network signal control unit provide a plurality of SPI buses for the CAN communication module to mount; the digital signal conversion unit provides a multi-way switch interface and performs information interaction with the centralized control unit through the bottom plate.
Further, the device comprises a digital conversion board, a network communication board, a CAN combination board and a backboard; the digital conversion board, the network communication board and the CAN combined board are inserted on the backboard; the CAN signal conversion unit is integrated on the CAN composition board, the data centralized control unit and the network signal control unit are integrated on the CAN network communication board, and the digital signal conversion unit is integrated on the digital conversion board.
Further, the CAN signal conversion unit is used for main circulation operation and interrupt function operation;
the main circulation operation calls a CAN interface base class, an annular buffer area interface base class and an SPI interface base class according to a main function to realize the function of mutual conversion of CAN data and SPI data;
and the interrupt function calls back an interrupt processing interface after running the interrupt.
Furthermore, the CAN signal conversion unit mounts multiple paths of CAN signals and the SPI bus and is used for carrying out interrupt signals, control signals and read-write signals on the multiple paths of signals.
Further, the network signal control unit comprises a main circulation operation and an interrupt function operation;
the main circulation operation calls a network chip base class, a protocol processing interface base class and an SPI interface base class according to a main function to realize a data forwarding function;
and the interrupt function calls back an interrupt processing interface after running the interrupt.
Further, the data centralized control unit and the network signal control unit provide 6 paths of SPI buses for the CAN communication module to mount, and each SPI bus mounts 3 paths of CAN modules for use.
Further, the network signal control unit comprises 2 hundred mega networks for network data communication.
Further, the data centralized control unit is responsible for centralized processing, arbitration, conversion, receiving and sending of SPI bus, network and switching value data.
Further, the digital signal conversion unit provides 12 paths of switch interfaces, and information interaction is carried out between the digital signal conversion unit and the centralized control unit through the bottom plate.
The beneficial effects are that:
the CAN network signals of each device are intensively processed, so that the conversion between the CAN network signals and the Ethernet signals is realized; the split independent CAN network design is adopted to provide independent CAN network interfaces for CAN communication network equipment in a large-scale information system, and different connections of each independent equipment CAN be integrated. Meanwhile, the problems of information blockage and system matching caused by hanging multiple devices into one bus are solved, and the mutual interference between the devices caused by the difference of the devices is avoided, so that the normal operation of the whole information system is not influenced.
The invention integrates the digital conversion board, the network communication board and the CAN combination board on the CAN network signal line concentration conversion device, thereby realizing the data interaction requirement of a plurality of slave devices and host devices, improving the reliability of the device, saving the cost and ensuring that each device has an independent network interface.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the scope of the invention as claimed.
Drawings
FIG. 1 is a schematic diagram of a CAN network signal hub conversion device according to the invention;
FIG. 2 is a flow chart of the processing task of the CAN signal conversion unit in the CAN network signal hub conversion device according to the invention;
FIG. 3 is a flow chart of the task of processing a network signal control unit in a CAN network signal hub conversion device according to the invention;
it should be understood that the drawings are not necessarily to scale, presenting a somewhat simplified representation of various features illustrative of the basic principles of the disclosure. The particular design features of the invention as disclosed herein, including, for example, particular dimensions, orientations, locations, and shapes, will be determined in part by the particular intended application and use environment.
In the drawings, like numerals refer to the same or equivalent parts of the invention throughout the several views of the drawings.
Detailed Description
Reference will now be made in detail to various embodiments of the invention, examples of which are illustrated in the accompanying drawings and described below. While the invention will be described in conjunction with the exemplary embodiments thereof, it will be understood that the present description is not intended to limit the invention to those exemplary embodiments. On the other hand, the present invention is intended to cover not only the exemplary embodiments of the present invention, but also various alternatives, modifications, equivalents and other embodiments, which may be included within the spirit and scope of the invention as defined by the appended claims.
Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. The specific structures and functions described in the exemplary embodiments of the present invention are for illustrative purposes only. Embodiments of the inventive concept according to the present invention may be embodied in various forms and it should be understood that they should not be construed as limited to the exemplary embodiments described in the exemplary embodiments, but include all modifications, equivalents, or alternatives falling within the spirit and scope of the invention.
Throughout the specification, the terminology used herein is for the purpose of describing various exemplary embodiments only and is not intended to be limiting. It will be further understood that the terms "comprises," "comprising," "includes," "including" and the like, when used in this exemplary embodiment, specify the presence of stated features, steps, operations, or elements, but do not preclude the presence or addition of one or more other features, steps, operations, or elements.
The invention provides a CAN network signal line concentration conversion device, as shown in figure 1, which comprises a CAN signal conversion unit, a data centralized control unit, a network signal control unit and a digital signal conversion unit; the CAN signal conversion unit is used for converting the CAN signal into an SPI signal; the data centralized control unit and the network signal control unit provide a plurality of SPI buses for the CAN communication module to mount; the digital signal conversion unit provides a multi-way switch interface and performs information interaction with the centralized control unit through the bottom plate.
The device also comprises a microprocessor, wherein the microprocessor is used for external hardware interfaces such as DI, DO, SPI and FSMC interfaces. The microprocessor is in communication connection with the CAN signal conversion unit, the data centralized control unit, the network signal control unit and the digital signal conversion unit.
The device comprises a digital conversion board, a network communication board, a CAN combination board and a backboard; the digital conversion board, the network communication board and the CAN combined board are inserted on the backboard; the CAN signal conversion unit is integrated on the CAN composition board, the data centralized control unit and the network signal control unit are integrated on the CAN network communication board, and the digital signal conversion unit is integrated on the digital conversion board.
In the above technical solution, as shown in fig. 2, the CAN signal conversion unit is configured to perform two processing tasks by performing a main loop operation and an interrupt function operation;
the main circulation operation calls a CAN interface base class, an annular buffer area interface base class and an SPI interface base class according to a main function to realize the function of mutual conversion of CAN data and SPI data;
and the callback interrupt processing interface stm32f0xx_it.h after the interrupt function runs and interrupts.
The CAN signal conversion unit mounts multiple paths of CAN signals and SPI buses and is used for carrying out interrupt signals, control signals and read-write signals on the multiple paths of signals.
In the above technical solution, the operation mode of the CAN signal conversion unit includes:
1. starting a microprocessor;
2. initializing interfaces of on-chip resources GPIO, CAN interfaces and SPI slave interfaces;
3. entering the main cycle.
The CAN signal conversion unit Main cycle (Main) operation flow is as follows:
the main loop is a function executed in a main function;
circularly reading the pin state, and judging whether the SPI of the current slave is in a reading or writing state;
and if the data is in the reading state, reading the data of the uplink FIFO, and responding to SPI data access of the network communication conversion board.
And if the SPI is in the writing state, reading the data received by the SPI. Because the data packet contains information such as the type of the frame, the length of the frame and the like, the CAN communication module CAN control the CAN peripheral equipment of the MCN according to the information and send data through the CAN mailbox.
In the above technical solution, the operation flow of the interruption function of the CAN signal conversion unit is as follows:
the interrupt processing task is responsible for processing CAN receiving interrupt;
after the CAN protocol peripheral link layer of the microprocessor receives the data, the data is received into 3 receiving mailboxes, and MCU interruption is triggered;
the interrupt program reads the received data through the register and caches the received data into the upstream annular FIFO to wait for the SPI host to read.
In the above technical solution, the CAN interface base class includes:
the CAN interface provides a bottom configuration driver of the CAN peripheral, and a CAN data packing and unpacking structure body, so that all CAN information CAN be pushed into fifo and fifo CAN be pulled out conveniently;
all structures of CAN information are acquired by a host through an SPI interface, and the method comprises the following steps:
can_filterconfig: configuring parameters of a CAN interface filter;
can_start: starting CAN peripheral equipment according to configuration;
can_activateNotification: enabling CAN mailbox interrupt;
CAN_CanData2array_Transform: packaging the frame ID, frame structure, frame format and frame data of the CAN into an array, so as to facilitate pushing fifo;
can_array2 candata_transfer form: and the data queue is pulled out from fifo, and the frame ID, the frame structure, the frame format and the frame data of the CAN are analyzed, so that the CAN transmission is facilitated.
In the above technical solution, a ring buffer (ring buffer) interface base class includes:
the ring buffer buffers the uplink data or the downlink data, and is first in first out. The annular buffer zone has the characteristic of high efficiency, and is beneficial to improving the throughput of CAN module data forwarding.
Applying a memory pool for the annular buffer zone, and designating a handle, a real memory address and a length of the buffer zone;
ringbuffer_put: pushing data of a plurality of bytes into the annular cache area;
ringbuffer_put_force: when the annular buffer area is full, data of a plurality of bytes are forced to be pushed into the annular buffer area, and the data at the tail of the queue can be discarded;
ringbuffer_latch: pushing one byte of data into the annular cache region;
ringbuffer_latch_force: when the annular buffer area is full, one byte of data is forced to be pushed into the annular buffer area, and the data at the tail of the queue can be discarded;
ringbuffer_get: pulling a plurality of bytes of data from the ring buffer;
ringbuffer_latch: pulling one byte of data into the ring buffer;
ringbuffer_get_size: obtaining the maximum capacity of the annular cache region;
ringbuffer_state: acquiring the states of the annular cache region, and the empty, non-empty and half-empty states;
ringbuffer_data_len: and acquiring the size of the stored data in the annular cache region.
In the above technical solution, the SPI interface base class includes:
the SPI slave-related class provides the static address of the transmit function and SPI state macro definition, including:
SPI_TxData: transmitting a data static variable;
SPI state: SPI_READ_STATUS, SPI_READ_FRAME, and SPI_WRITE_FRAME.
In the above technical solution, as shown in fig. 3, the network signal control unit includes two processing tasks of main loop operation and interrupt function operation;
the main circulation operation calls a network chip base class, a protocol processing interface base class and an SPI interface base class according to a main function to realize a data forwarding function;
and the callback interrupt processing interface stm32f4xx_it.h after the interrupt function runs and interrupts.
In the above technical solution, the operation mode of the network signal control unit includes:
1. after power is applied, the power lamp is turned on;
2. starting a microprocessor, and initializing on-chip resources GPIO, FSMC and SPI;
3. invoking a W5300_Rst method and resetting a W5300 module;
4. and performing light inspection: a network 1 status light, a network 2 status light, and a status light are all on; after 2 seconds, all the indicator lights are turned off;
5. and starting an interrupt and entering a main loop.
In the above technical scheme, the main circulation operation flow of the network signal control unit is as follows:
acquiring link states of two network interfaces of the main network and the standby network;
if the state is changed, resetting w5300, delaying for 4s, initializing the network 1 or the network 2 according to the state (initializing the network 1 when the main network and the standby network are normal or the network 1 is normal, initializing the network 2 if only the network 2 is normal, and jumping to the step if the main network and the standby network are abnormal);
otherwise, if at least one of the two networks is available, the state of the socket is acquired;
if the socket is not started, multicast is started newly, otherwise, uplink data acquisition is carried out;
after the uplink data is obtained, frame processing is carried out, and the uplink data is carried out through a multicast network after the uplink data is packed according to a protocol;
judging whether the IO interface is changed or not or whether the timer meets 10s, and uploading the IO after filtering and eliminating jitter;
acquiring downlink data of a network through fsmc;
and carrying out frame processing on downlink data of the network, packaging the data according to an interface protocol of the CAN communication module, and transmitting the data to the CAN communication module through the SPI.
In the above technical solution, the interrupt function operation flow is as follows:
the interrupt function interrupts once every 1ms, and the interrupt processing interface is called back after the interrupt, which is responsible for updating the status indicator lamp and generating a plurality of frequency division clocks for the main function.
The SPI interface base class comprises:
the SPI base class is an interface for the microprocessor to connect with the CAN module. The interface can be used for single-channel read-write operation and multi-SPI channel write operation so as to save data communication time.
UserSPISingleChannelRead: operating a single-channel SPI interface, reading a designated interface CAN module, and realizing uplink data;
userspringenglechannelwrite: operating a single-channel SPI interface, writing data into a designated CAN module, and realizing downlink data;
operating a multi-channel SPI interface, writing data into a plurality of appointed CAN communication modules, and realizing downlink data.
In the above technical solution, the network chip base class (W5300) includes:
the controller is connected with two paths of W5300 chips through FSMC (static memory controller) and is used for realizing one path of double redundancy function of the network.
The W5300 base class may configure the network interface, accept the sending data, i.e. read and write operations. The specific interface is as follows:
w5300_rst: operating a w5300 related register to carry out soft reset on the network chip;
w5300_config: configuring a gateway, an IP address and a subnet mask of a W5300 network chip and selecting an IR_socket channel number as 0;
socket_State_Detector, detecting whether Socket is available, if so, returning to 0;
socket_open_multicast_group: starting a Socket in a multicast mode, and obtaining the State of the Socket as udp through socket_State_detect if the Socket is successful;
socket_rx_process: multicast obtaining data of a hardware buffer area;
socket_tx_process_multicast_group: the transmission data is placed in a hardware buffer, and the multicast data transmission is completed by w 5300.
In the above technical solution, a Protocol processing interface (Protocol) includes:
the downlink network data meets the network interface protocol required by the customer, the data packet obtained through the SPI is packaged according to the CAN format, the packaging formats of the data packet and the SPI are different, and the protocol requirement is met after the structure body is unpacked and packaged.
Eth2spifordown data: and converting the received network frame data into frame data of the CAN module according to a data protocol.
SPI2EthForUpData: and converting the data packet acquired through the SPI into network frame data according to a data protocol.
The data centralized control unit and the network signal control unit provide 6 paths of SPI buses for the CAN communication module to mount, and each SPI bus mounts 3 paths of CAN modules for use.
The data centralized control unit is responsible for centralized processing, arbitration, conversion, receiving and sending functions of SPI bus, network and switching value data.
In the above technical solution, the network signal control unit provides 2 paths of hundred meganetworks for network data communication.
The embodiments of the present application described above may be implemented in various hardware, software code, or a combination of both. For example, embodiments of the present application may also represent program code that performs the above-described methods in a data signal processor. The present application may also relate to various functions performed by a computer processor, a digital signal processor, a microprocessor, or a field programmable gate array. The above-described processors may be configured in accordance with the present application to perform particular processing tasks by executing machine readable software code or firmware code that defines the particular methods disclosed herein. The software code or firmware code may be developed to represent different programming languages and different formats or forms. Different target platform compiled software code may also be represented. However, the different code patterns, types, and languages of software code and other types of configuration code that perform processing tasks according to the present application do not depart from the spirit and scope of the present application.
The foregoing descriptions of specific exemplary embodiments of the present invention have been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed, and obviously many modifications and variations are possible in light of the above teaching. The exemplary embodiments were chosen and described in order to explain certain principles of the invention and their practical application to enable others skilled in the art to make or utilize the invention in various exemplary embodiments and with various alternatives and modifications. It is intended that the scope of the invention be defined by the claims appended hereto and their equivalents.
It is to be understood that the above embodiments are merely illustrative of the application of the principles of the present invention, but not in limitation thereof. Various modifications and improvements may be made by those skilled in the art without departing from the spirit and substance of the invention, and are also considered to be within the scope of the invention.

Claims (9)

1. The CAN network signal line concentration conversion device is characterized by comprising a CAN signal conversion unit, a data centralized control unit, a network signal control unit and a digital signal conversion unit; the CAN signal conversion unit is used for converting the CAN signal into an SPI signal; the data centralized control unit and the network signal control unit provide a plurality of SPI buses for the CAN communication module to mount; the digital signal conversion unit provides a multi-way switch interface and performs information interaction with the centralized control unit through the bottom plate.
2. The CAN network signal hub conversion device of claim 1, wherein the device comprises a digitizer board, a network communication board, a CAN compoboard and a back board; the digital conversion board, the network communication board and the CAN combined board are inserted on the backboard; the CAN signal conversion unit is integrated on the CAN composition board, the data centralized control unit and the network signal control unit are integrated on the CAN network communication board, and the digital signal conversion unit is integrated on the digital conversion board.
3. The CAN network signal hub conversion device of claim 1, wherein the CAN signal conversion unit is configured to operate in a main loop and to operate in an interrupt function;
the main circulation operation calls a CAN interface base class, an annular buffer area interface base class and an SPI interface base class according to a main function to realize the function of mutual conversion of CAN data and SPI data;
and the interrupt function calls back an interrupt processing interface after running the interrupt.
4. The CAN network signal hub switching device of claim 3, wherein the CAN signal switching unit mounts multiple CAN signals with the SPI bus for interrupt signals, control signals, and read/write signals.
5. The CAN network signal hub conversion device of claim 1, wherein the network signal control unit includes a main loop operation and an interrupt function operation;
the main circulation operation calls a network chip base class, a protocol processing interface base class and an SPI interface base class according to a main function to realize a data forwarding function;
and the interrupt function calls back an interrupt processing interface after running the interrupt.
6. The CAN network signal hub conversion device of claim 1, wherein the data hub control unit and the network signal control unit provide 6-way SPI buses for CAN communication modules to mount, each SPI bus mounting 3-way CAN modules for use.
7. The CAN network signal hub switching device of claim 1, wherein the network signal control unit includes a 2-way hundred mega network for network data communication.
8. The CAN network signal hub conversion device of claim 1, wherein the data hub control unit is responsible for centralized processing, arbitration, conversion, reception and transmission of SPI bus and network, switching value data.
9. The CAN network signal hub conversion device of claim 1, wherein the digital signal conversion unit provides a 12-way switch interface, and information interaction is performed with the centralized control unit through the bottom plate.
CN202311823690.6A 2023-12-27 2023-12-27 CAN network signal line concentration conversion device Pending CN117793218A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311823690.6A CN117793218A (en) 2023-12-27 2023-12-27 CAN network signal line concentration conversion device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311823690.6A CN117793218A (en) 2023-12-27 2023-12-27 CAN network signal line concentration conversion device

Publications (1)

Publication Number Publication Date
CN117793218A true CN117793218A (en) 2024-03-29

Family

ID=90385056

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311823690.6A Pending CN117793218A (en) 2023-12-27 2023-12-27 CAN network signal line concentration conversion device

Country Status (1)

Country Link
CN (1) CN117793218A (en)

Similar Documents

Publication Publication Date Title
US4835674A (en) Computer network system for multiple processing elements
US4831620A (en) Controller for controlling multiple LAN types
KR940000177B1 (en) Multiprocessor interrupts rerouting mechanism
US7594226B2 (en) Implementation of packet-based communications in a reconfigurable hardware element
JP4554863B2 (en) Network adapter and communication method with reduced hardware
US4771286A (en) Lan controller having split bus design
EP2003571A2 (en) Network core access architecture
US4750114A (en) Local area network control block
US20020078249A1 (en) Programmable multi-standard MAC architecture
US10572410B2 (en) Function-specific communication on a multi-drop bus for coexistence management
US20190227971A1 (en) Architecture for consolidating multiple sources of low-bandwidth data over a serial bus
CN110658751B (en) Implementation method of EtherCAT field bus control system
CN105591855A (en) Force sensor data collection system and method based on EtherCAT
CN109412897B (en) Shared MAC (media Access control) implementation system and method based on multi-core processor and FPGA (field programmable Gate array)
CN107562672A (en) A kind of system and method for improving vector network analyzer message transmission rate
JP2024513646A (en) Dedicated subsystem of power chip
CN117793218A (en) CAN network signal line concentration conversion device
CN108984324B (en) FPGA hardware abstraction layer
CN114422614B (en) Method, device, equipment and storage medium for controlling multilink equipment to transmit data
CN115776653A (en) Vehicle-mounted data acquisition method, device, equipment and medium
JP6321324B2 (en) Program control in parallel processing systems
CN110098989A (en) A kind of multichannel CAN analogue system and test method based on CANFD bus
US4823124A (en) Lan controller proprietary bus
US20230273778A1 (en) Method and system for protocol processing
EP0255096A2 (en) A controller for controlling multiple LAN types

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