CN112272117B - LIN network simulation system and LIN network-based data transmission method - Google Patents

LIN network simulation system and LIN network-based data transmission method Download PDF

Info

Publication number
CN112272117B
CN112272117B CN202011245151.5A CN202011245151A CN112272117B CN 112272117 B CN112272117 B CN 112272117B CN 202011245151 A CN202011245151 A CN 202011245151A CN 112272117 B CN112272117 B CN 112272117B
Authority
CN
China
Prior art keywords
lin
node
slave
network
channels
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
Application number
CN202011245151.5A
Other languages
Chinese (zh)
Other versions
CN112272117A (en
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.)
Chongqing Sumarte Technology Development Co ltd
Original Assignee
Chongqing Sumarte Technology Development Co ltd
Filing date
Publication date
Application filed by Chongqing Sumarte Technology Development Co ltd filed Critical Chongqing Sumarte Technology Development Co ltd
Priority to CN202011245151.5A priority Critical patent/CN112272117B/en
Publication of CN112272117A publication Critical patent/CN112272117A/en
Application granted granted Critical
Publication of CN112272117B publication Critical patent/CN112272117B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The application discloses a LIN network simulation system and a data transmission method based on a LIN network. The application can realize that the main mode channel only transmits the frame head, the slave mode channel monitors and only provides the response function. In the slave mode, the system receives the frame header to generate interruption, so that the problem that the frame header is not interrupted when the master mode transmits the frame header is solved; the LIN network can be well simulated under the condition of a single node, the LIN channel of the master mode is enabled to serve as a host node, the LIN channel of the slave mode is enabled to serve as a slave node, and when the host node continuously transmits a frame header, the slave node is always in a monitoring state and performs corresponding processing according to the interrupt generated by the received frame header; in an actual LIN network, the last generated LIN node in the present application may act as a host node of the network.

Description

LIN network simulation system and LIN network-based data transmission method
Technical Field
The invention relates to the technical field of automobile buses, in particular to a LIN network simulation system and a data transmission method.
Background
In the PowerPC57xx series of MCUs for LIN network simulation and measurement, if this method is implemented with one path through the MCU supporting both a master mode and a slave mode LIN channel, the channel is configured either as master or slave from the software configuration level. When the channel is used as a host node, an internal implementation mechanism of the channel cannot separate the host node into a master task and a slave task, and when the host node is required to provide a response, frame headers and data must be transmitted simultaneously, that is, the frame headers and the response cannot be provided respectively, and the frame headers and the frame data fields cannot be interrupted respectively, so that certain limitations exist, such as recording the time stamp of a message, and the time stamp is recorded accurately by the message header. If the frame header and the data are transmitted simultaneously, the time stamp can be stamped only at the moment when one frame of message is finished, and thus the recorded time stamp is not accurate.
Therefore, the person skilled in the art is dedicated to developing a LIN network simulation system and a data transmission method which are specially aimed at the PowerPC57xx series MCU, so that the problem that the PowerPC57xx series MCU cannot separate master-slave tasks of a host node when the LIN network is in communication can be effectively solved, and the entire LIN network can be virtualized, and the real LIN network can be complemented.
Disclosure of Invention
In view of the above-mentioned drawbacks of the prior art, the present application is to provide a LIN network simulation system and a data transmission method specifically for a PowerPC57xx series MCU, which can effectively solve the problem that the PowerPC57xx series MCU cannot separate master and slave tasks of a host node during LIN network communication. In an actual network, the node can serve as a master node to provide a message header or a slave node to provide a response. Thus, the whole LIN network can be virtualized, and the real LIN network can be complemented.
In order to achieve the above purpose, the invention provides a LIN network simulation system, which is characterized in that an MCU is connected with an AND gate through two LIN channels, the output end of the AND gate is connected with an isolator, the isolator is connected to an LIN transceiver, and the LIN transceiver is connected with an LIN bus.
Preferably, TX pins of the two paths of the LIN channels are connected to the and gate, and are connected to the TXD terminal of the LIN transceiver through the isolator.
Preferably, the RX pins of the two paths of LIN channels are directly connected to the RXD terminal of the LIN transceiver through the isolator.
Preferably, the device also comprises a GPIO pin output control module, wherein the VIA pin and the VIB pin of the GPIO pin output control module are respectively connected to the two GPIO pins of the MCU.
The invention also provides a data transmission method based on the LIN network, which comprises the following steps:
1) Setting two LIN channels, and connecting the two LIN channels to an MCU, wherein one LIN channel supporting a master is used as a main task of a node to provide a frame header, and the other LIN channel supporting a slave is used as a slave task of the node to provide a response;
2) Outputting TX pins of the two LIN channels through the same AND gate, and then reaching the LIN transceiver through the isolator;
3) Connecting RX pins of the two-way LIN channels directly to the LIN transceiver through the isolator;
4) The LIN transceiver converts the received signal into a LIN node that is connected to a LIN bus.
The beneficial effects of the application are as follows: the application can realize that the main mode channel only sends the frame head, the slave mode channel monitors and only provides response, and the frame head received in the slave mode generates interruption, thereby solving the problem that the frame head sent in the main mode does not generate interruption; the LIN network can be well simulated under the condition of a single node, the LIN channel of the master mode is enabled to serve as a host node, the LIN channel of the slave mode is enabled to serve as a slave node, and when the host node continuously transmits a frame header, the slave node is always in a monitoring state and performs corresponding processing according to the interrupt generated by the received frame header; in an actual LIN network, the last generated LIN node in the present application may act as a host node of the network, and is used to schedule the transmission order of frames on the bus, monitor data, process errors, etc. by sending a frame header; the method can also flexibly act as a slave node to realize the dispatching of the host node on the bus and provide response.
Drawings
Fig. 1 is a schematic structural diagram of an embodiment of the present invention.
Fig. 2 is a circuit configuration diagram of an embodiment of the present invention.
Detailed Description
The invention is further described below with reference to the drawings and examples.
As shown in fig. 1 and fig. 2, in this embodiment, the and gate U36 is directly a 74LVC1GO8 chip, an isolator U38 is connected to the output end of the and gate U36, the isolator U38 is an ADuM1201BRZ chip, the isolator U38 is connected to the LIN transceiver U37, the LIN transceiver U37 is a MAX13021asa+ chip, and the LIN transceiver U37 is connected to the LIN bus.
The TX pin of the two-way LIN channel is connected to an and gate U36, and through an isolator U38 to the TXD terminal of a LIN transceiver U37. I.e. the TX pin of the two-way LIN channel is output through an and gate, via which connection the level of the TXD terminal of the LIN transceiver U37 is determined by the output terminal of the and gate U36. The RX pin of the two-way LIN channel is directly connected to the RXD terminal of the LIN transceiver U37 through an isolator, so that the RX pin level of the LIN channel is determined by the output terminal of the LIN transceiver U37.
The application also comprises a GPIO pin output control module U4O, wherein an ADuM1200ARZ chip is adopted as an isolation chip, and a VIA pin and a VIB pin of the isolation chip are respectively connected to two GPIO pins of the MCU. The VIA pin input is output through the isolator VOA pin, its level controls sleep function, and the VIB pin input is output through the isolator VOB pin, its level controls whether pull-up. The VIA pin and the VIB pin can have an electrical isolation effect from the VOA pin and the VOB pin through the isolator, so that circuits of different physical parts are not interfered, and the output level is consistent with the level of the GPIO pin on the MCU.
In the present application, the LIN transceiver U37 supports sleep mode (sleep pin of the transceiver U37 is connected to one GPIO pin of the main chip), and whether the LIN transceiver U37 enters a low power consumption state is determined by outputting a high-low level through the GPIO pin.
In the application, the LIN bus is also connected with a controllable pull-up circuit, and whether the LIN bus level is required to be pulled up to a 12V power supply can be selected according to different configuration master-slave nodes. The pull-up circuit is connected with one GPIO pin of the MCU, outputs high and low levels through the GPIO pin, and controls whether the LIN bus is pulled up or not.
The application also provides a data transmission method based on the LIN network, which can be realized by adopting the LIN network simulation system, and comprises the following steps:
1) Setting two LIN channels, and connecting the two LIN channels to an MCU, wherein one LIN channel supporting a master is used as a main task of a node to provide a frame header, and the other LIN channel supporting a slave is used as a slave task of the node to provide a response;
2) Outputting TX pins of the two LIN channels through the same AND gate, and then reaching the LIN transceiver through the isolator;
3) RX pins of the two-way LIN channels are directly connected to the LIN transceiver through the isolator;
4) The LIN transceiver converts the received signal to a LIN node that is connected to the LIN bus.
In the application, a LIN node (hereinafter referred to as the node) is realized through two LIN channels, wherein one LIN channel is a master mode and the other LIN channel is a slave mode. When two channels are used simultaneously, a virtual LIN network can be simulated, in which: the channel configured as the main mode serves as a main node of the virtual network and provides a message header; the channel configured as a slave mode can act as any slave node, responding differently to the master node's request. In a practical network, when two channels are used simultaneously, this LIN node acts as a host node in the LIN network, where the channels configured as master mode perform the master tasks: providing a message header; the channel configured as a slave mode performs a slave task: a response is provided. When only channels configured as slave modes are used, this node may act as a slave node in the LIN network, providing a response to other nodes in the LIN network. The method achieves the purpose of independently opening the master task and the slave task of one node, and can enable the master task and the slave task to respectively generate interruption when providing frame heads and data, and process different things according to independent interruption.
In the application, two LIN channels are used as a LIN node, wherein one LIN channel is configured as a main mode and is used for fixing a frame header to be sent, and the frame header sent by the LIN channel in the main mode comprises a synchronization interval section, a synchronization section and a PID (Protected Identifier) section. The other LIN channel is configured to receive a frame header and to transmit or receive an acknowledgement from the mode, the acknowledgement provided from the mode LIN channel comprising a data segment and a checksum segment. After receiving the frame header from the mode, a HEADER RECEIVE interrupt will be generated, which can be used to record the timestamp of the frame or to handle a series of things. LIN channels configured as slave modes may be of different schedule than the host node: the system comprises a schedule for sending the response and a schedule for receiving the response, and the processing of different PIDs is well regulated. When the frame header is received, whether the response needs to be sent or received or not is judged according to the agreed PID. While the diagnostic function can be implemented according to a schedule.
The foregoing describes in detail preferred embodiments of the present invention. It should be understood that numerous modifications and variations can be made in accordance with the concepts of the invention by one of ordinary skill in the art without undue burden. Therefore, all technical solutions which can be obtained by logic analysis, reasoning or limited experiments based on the prior art by the person skilled in the art according to the inventive concept shall be within the scope of protection defined by the claims.

Claims (5)

1. A data transmission method based on LIN network is characterized in that: the method comprises the following steps:
1) Setting two LIN channels, and connecting the two LIN channels to an MCU, wherein one LIN channel supporting a master is used as a main task of a node to provide a frame header, and the other LIN channel supporting a slave is used as a slave task of the node to provide a response;
2) Outputting TX pins of the two LIN channels through the same AND gate, and then reaching the LIN transceiver through the isolator;
3) Connecting RX pins of the two-way LIN channels directly to the LIN transceiver through the isolator;
4) The LIN transceiver converts the received signal into a LIN node that is connected to a LIN bus.
2. A LIN network simulation system for implementing the LIN network-based data transmission method of claim 1; the method is characterized in that:
an AND gate is connected to the MCU through two LIN channels, an isolator is connected to the output end of the AND gate, the isolator is connected to an LIN transceiver, and the LIN transceiver is connected with an LIN bus.
3. The LIN network simulation system of claim 2, wherein: and a TX pin of the two paths of LIN channels is connected with the AND gate and is connected with a TXD end of the LIN transceiver through the isolator.
4. The LIN network simulation system of claim 2, wherein: the RX pins of the two paths of LIN channels are directly connected to the RXD end of the LIN transceiver through the isolator.
5. The LIN network simulation system of claim 2, wherein: the device also comprises a GPIO pin output control module, wherein a VIA pin and a VIB pin of the GPIO pin output control module are respectively connected to two GPIO pins of the MCU.
CN202011245151.5A 2020-11-10 LIN network simulation system and LIN network-based data transmission method Active CN112272117B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011245151.5A CN112272117B (en) 2020-11-10 LIN network simulation system and LIN network-based data transmission method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011245151.5A CN112272117B (en) 2020-11-10 LIN network simulation system and LIN network-based data transmission method

Publications (2)

Publication Number Publication Date
CN112272117A CN112272117A (en) 2021-01-26
CN112272117B true CN112272117B (en) 2024-07-12

Family

ID=

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN213342249U (en) * 2020-11-10 2021-06-01 重庆圣眸科技开发有限公司 LIN network simulation system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN213342249U (en) * 2020-11-10 2021-06-01 重庆圣眸科技开发有限公司 LIN network simulation system

Similar Documents

Publication Publication Date Title
US9945906B2 (en) Test device and method
US5287506A (en) Token ring network protocol analyzer
CN106254518A (en) A kind of vehicle-mounted Ethernet system and automobile
US20160134553A1 (en) Flexible scheduling method and apparatus in lin communication
CN108920401B (en) Multi-master multi-slave I2C communication method, system and node equipment
JP5385399B2 (en) Circuit configuration including transceiver circuit for bus system, and node for bus system
US7685442B2 (en) Method and systems for a radiation tolerant bus interface circuit
CN115941102A (en) Method for synchronous communication between controllers by connecting MCU and FPGA through SPI
US7610422B2 (en) Isolation and transmission of digital signals in intended direction
CN112272117B (en) LIN network simulation system and LIN network-based data transmission method
US10740276B1 (en) Method for enhancing execution of AS5643 functions
CN213342249U (en) LIN network simulation system
US20090024875A1 (en) Serial advanced technology attachment device and method testing the same
US20060285547A1 (en) Loop communication system and communication device
CN112272117A (en) LIN network simulation system and LIN network-based data transmission method
JP2008236217A (en) Flexray network connecting method, flexray network and electronic control unit for flexray network
US7386639B2 (en) Switch for coupling one bus to another bus
US8050176B2 (en) Methods and systems for a data processing system having radiation tolerant bus
US11374846B1 (en) Lin master testing device
CN210109582U (en) Bus simulation system based on TTCAN communication module
KR100800836B1 (en) Apparatus of cell bus power duplication
Braun et al. Integration of flexray into the SDL-model-driven development approach
CN116582473A (en) Rack-mounted communication equipment and serial port management method thereof
JPS62213458A (en) Communication network system
CN116431717A (en) Offline reproduction method and system of automatic driving system and related equipment

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant