CN210864417U - Vehicle CAN bus interface conversion self-adaptive system - Google Patents

Vehicle CAN bus interface conversion self-adaptive system Download PDF

Info

Publication number
CN210864417U
CN210864417U CN202020810882.9U CN202020810882U CN210864417U CN 210864417 U CN210864417 U CN 210864417U CN 202020810882 U CN202020810882 U CN 202020810882U CN 210864417 U CN210864417 U CN 210864417U
Authority
CN
China
Prior art keywords
interface
level
module
uart
uart interface
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
CN202020810882.9U
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.)
Nanjing Zhaoyue Intelligent Technology Co ltd
Original Assignee
Nanjing Zhaoyue Intelligent 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 Nanjing Zhaoyue Intelligent Technology Co ltd filed Critical Nanjing Zhaoyue Intelligent Technology Co ltd
Priority to CN202020810882.9U priority Critical patent/CN210864417U/en
Application granted granted Critical
Publication of CN210864417U publication Critical patent/CN210864417U/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The utility model discloses a vehicle CAN bus interface conversion self-adaptation system. The utility model relates to an electricity digital data processing field, when the level of solution at vehicle CAN bus and automotive electronics's UART serial ports communication both ends was not matched, directly carried out interface communication and connection, probably leaded to the unable normal communication of data communication to and the problem that causes the interface damage of equipment end. The utility model discloses a vehicle CAN bus interface conversion adaptive system includes: the system comprises a CAN transceiving module, a power module, a first UART interface, a UART interface level diagnosis module, a UART interface level switching module, an RS232 level conversion module, a logic processing module and a main control unit; for the automobile electronic equipment without the CAN bus interface, the system CAN realize CAN interface conversion and CAN bus communication through the device; for different automobile electronic devices, whether the TTL level specification or the RS232 interface level specification can be matched with interfaces with different level specifications in a self-adaptive mode.

Description

Vehicle CAN bus interface conversion self-adaptive system
Technical Field
The utility model relates to an electricity digital data processing technology field, concretely relates to vehicle CAN bus interface conversion adaptive system.
Background
The CAN bus interface is an important communication interface between the automobile electronic equipment and the vehicle as an industry standard interface of the current vehicle communication. In practical application, especially, a plurality of rear-mounted vehicle-mounted electronic devices do not have a CAN bus interface, so that the CAN bus interface is converted into more universal UART serial port communication, and further the CAN bus communication between the vehicle electronic devices and vehicles is a very practical measure. And a Universal asynchronous receiver Transmitter (Universal asynchronous receiver/Transmitter) is the most common data communication interface in the industry, and the standard baud rate is 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200. The UART interface hardware level specification is mainly divided into two types: TTL level and RS232 level. TTL level, logic 1: 3.3V/5V; logic 0: 0V. RS232 level, logic 1: -3 to-12V; logic 0: +3 to + 12V.
In practical application, the corresponding level standard needs to be confirmed according to the level specifications at two ends of UART serial port communication, if the levels are not matched, the interface communication and connection are directly performed, one is: data communication cannot be normally communicated due to level mismatching; in addition, because the levels at the two ends of the device are not matched, the voltage may greatly exceed the voltage range that the interface can bear, and the interface at the device end is damaged, so that the two serial ports cannot be directly connected blindly. Therefore, it is necessary to provide a vehicle CAN bus interface conversion adaptive system to solve the above problems.
SUMMERY OF THE UTILITY MODEL
An object of the utility model is to provide a vehicle CAN bus interface conversion adaptive system to solve the above-mentioned problem that prior art exists.
The utility model provides a vehicle CAN bus interface conversion self-adaptation system, include: the system comprises a CAN transceiving module, a power module, a first UART interface, a UART interface level diagnosis module, a UART interface level switching module, an RS232 level conversion module, a logic processing module and a main control unit;
the CAN transceiver module is communicated with a vehicle CAN bus and is also communicated with a main control unit;
the power supply module is connected with the main control unit and is used for converting a vehicle-mounted power supply network into a local power supply network which meets the requirement of the conversion of a vehicle CAN bus interface self-adaptive system;
the first UART interface is connected with a second UART interface of the automobile electronic equipment;
the UART interface level diagnosis module is connected with the first UART interface and the main control unit and is used for processing and diagnosing the electrical characteristics according to the received signal of the transmitting end of the automobile electronic equipment at the opposite end, inputting the processed result into the main control unit, judging the level of the UART interface and executing an interface level control signal, so that the interface level can be adaptive to the interface level specification of the opposite end;
the UART interface level switching module is connected with the main control unit and the first UART interface and is used for selecting TTL and RS232 interface levels according to a level control signal of the main control unit;
the RS232 level conversion module is connected with the UART interface level switching module and the logic processing module and is used for converting one path of TTL level of the logic processing module into standard RS232 level specification;
the logic processing module is connected with the main control unit, the UART interface level switching module and the RS232 level conversion module, and is used for performing logic processing on 1 path of UART TTL level of the main control unit, expanding the level of UART TTL level into 2 paths of UART interfaces and respectively corresponding to the TTL level interface and the RS232 level conversion module interface.
Optionally, the main control unit includes a CAN interface, an interface protocol configuration module, a CAN interface protocol processing module, a UART interface level adaptive processing module, and a third UART interface;
the CAN interface is in communication connection with the CAN transceiver module to realize communication with a vehicle CAN bus;
the interface protocol configuration module is used for realizing the following function configuration through a configuration file: the CAN interface communication protocol and the UART interface communication protocol are configured, and the CAN interface and the UART serial port are converted and configured into a transparent transmission mode or a local analysis mode; meanwhile, the configuration file supports local configuration issued through a third UART interface or remote configuration file issued by the automobile electronic equipment;
the CAN interface protocol processing module is connected with the CAN interface and used for realizing the data transceiving with the vehicle CAN bus protocol according to the configuration protocol;
the UART interface protocol processing module is connected with the third UART interface and is used for completing the transceiving of the converted UART interface protocol data according to the configuration protocol;
the UART interface level self-adaptive processing module is respectively connected with the UART interface level diagnosis module and the UART interface level switching module, and is used for carrying out signal processing and analyzing and judging the specification of the interface level of the opposite terminal according to the signal output by the UART interface level diagnosis module, outputting a level control signal to the UART interface level switching module, and self-adaptively selecting the adaptive interface level.
Optionally, the UART interface level switching module supports TTL and RS232 level specifications, supports a voltage range of-12V to +12V, is powered by a single power supply, supports a wide voltage level range by using a signal relay scheme, realizes the path switching of TTL and RS232 through a relay switch inside, forcibly connects the TTL interface level in the CAN bus interface conversion adaptive device by default to the relay, disconnects the RS232 interface path, ensures that the output level of the device is TTL level, controls the switch terminal SW _ CTR of the relay to realize the level switching of TTL and RS232, and connects the port data receiving signal V _ CHECK to the UART interface level diagnosis module for monitoring the UART interface level at the opposite end of the device.
Optionally, the UART interface level diagnosis module includes a first resistor, a second resistor, a third resistor, a fourth resistor, and an operational amplifier;
the one end of first resistance is connected with automotive electronics's transmission signal line V _ CHECK, the other end of first resistance is connected with operational amplifier's positive input end, VCC3V3 is connected to the one end of second resistance, the other end of second resistance is connected with operational amplifier's positive input end, the one end of third resistance is connected with operational amplifier's positive input end, the other end ground connection of third resistance, the one end of fourth resistance is connected with operational amplifier's negative input end, the other end of fourth resistance is connected with operational amplifier's output.
Optionally, the voltage range of the sending signal line V _ CHECK is-12V to 12V, the voltage range of the positive input end of the operational amplifier is 0V to 3.3V, and the output voltage V _ OUT of the operational amplifier is 0V to 3.3V.
Optionally, the resistance of the first resistor is 10k Ω, the resistance of the second resistor is 2.2k Ω, the resistance of the third resistor is 2k Ω, and the resistance of the fourth resistor is 10k Ω.
Optionally, the logic processing module includes a first and gate logic device and a second and gate logic device, where the first and gate logic device and the second and gate logic device are two-input and gate logic devices;
the input end A and the input end B of the first AND logic device are connected with the sending end of a third UART interface of the main control unit, and the output end O of the first AND logic device is connected with the sending end of the RS232 level conversion module and the TTL sending end;
the A input end of the second AND logic device is connected with the receiving end of the RS232 level conversion module, the B input end of the second AND logic device is connected with the TTL receiving end, the O output end of the second AND logic device is connected with the receiving end of the third UART interface of the main control unit, a resistor and a diode are connected between the B input end of the second AND logic device and the TTL receiving end in series, and a grounding voltage stabilizing diode is connected between the B input end of the second AND logic device and the resistor.
The utility model discloses following beneficial effect has: the utility model provides a vehicle CAN bus interface conversion self-adaptation system, to the automotive electronics equipment that does not have CAN bus interface, CAN realize CAN interface conversion through the device, realize CAN bus communication; for different automobile electronic devices, no matter the TTL level specification or the RS232 interface level specification, interfaces with different level specifications can be matched in a self-adaptive mode, and any UART interface can be matched; for CAN bus conversion, through a configuration file scheme, a data transparent transmission scheme CAN be realized, the CAN bus protocol is analyzed by the automobile electronic equipment, and the CAN bus protocol is analyzed locally by the device through the configuration file scheme, so that the analysis result is output to the automobile electronic equipment, and the flexibility and the universality are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is the utility model provides a vehicle CAN bus interface conversion adaptive system's schematic diagram.
FIG. 2 is a schematic diagram of a UART interface level switch module.
FIG. 3 is a schematic diagram of a UART interface level diagnostic module.
FIG. 4 is a schematic diagram of a logic processing module.
Fig. 5 is the utility model provides a vehicle CAN bus interface conversion adaptive system's work flow chart.
Illustration of the drawings: 1-CAN transceiver module; 2-a power supply module; 3-a first UART interface; 4-UART interface level diagnosis module; 5-UART interface level switching module; 6-RS232 level conversion module; 7-a logic processing module; 8-and a master control unit; 100-automotive electronics; 101-a central processing unit; 102-a second UART interface; 81-CAN interface; 82-interface protocol configuration module; 83-CAN interface protocol processing module; 84-UART interface protocol processing module; 85-UART interface level self-adaptive processing module; 86-third UART interface.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present invention will be described in detail below with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the disclosure. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
Spatially relative terms, such as "above … …," "above … …," "above … …," "above," and the like, may be used herein for ease of description to describe one device or feature's spatial relationship to another device or feature as illustrated in the figures. It will be understood that the spatially relative terms are intended to encompass different orientations of the device in use or operation in addition to the orientation depicted in the figures. For example, if a device in the figures is turned over, devices described as "above" or "on" other devices or configurations would then be oriented "below" or "under" the other devices or configurations. Thus, the exemplary term "above … …" can include both an orientation of "above … …" and "below … …". The device may be otherwise variously oriented (rotated 90 degrees or at other orientations) and the spatially relative descriptors used herein interpreted accordingly.
Exemplary embodiments according to the present application will now be described in more detail with reference to the accompanying drawings. These exemplary embodiments may, however, be embodied in many different forms and should not be construed as limited to only the embodiments set forth herein. It is to be understood that these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art, in the drawings, the thicknesses of layers and regions are exaggerated for clarity, and the same devices are denoted by the same reference numerals, and thus the description thereof will be omitted.
As shown in fig. 1, for the embodiment of the present invention provides a vehicle CAN bus interface conversion adaptive system, including: the system comprises a CAN transceiving module 1, a power module 2, a first UART interface 3, a UART interface level diagnosis module 4, a UART interface level switching module 5, an RS232 level conversion module 6, a logic processing module 7 and a main control unit 8.
The CAN transceiver module 1 is used for realizing a CAN bus electrical characteristic interface, communicating with a vehicle CAN bus and communicating with the main control unit 8 to complete a CAN bus interface function. The power supply module 2 is a power supply module for realizing a CAN bus interface conversion device, meets the requirement of a vehicle-mounted 12/24V power supply network, and converts the vehicle-mounted power supply network into a local power supply network meeting the requirement of the device to work. The power supply module may be connected with the main control unit 8. The first UART interface 3 is connected to the second UART interface 102 of the automotive electronic device 100. The automotive electronics 100 generally includes a central processor 101 and a second UART interface 102 coupled to the central processor 101.
The UART interface level diagnosis module 4 is connected to the first UART interface 3 and the main control unit 8, and is configured to perform electrical characteristic processing and diagnosis according to a received transmitting end signal of the vehicle electronic device 100 at the opposite end, input a processed result to the main control unit 8, perform UART interface level determination and execute an interface level control signal, so that an interface level can be adaptively adapted to an interface level specification of the opposite end. The UART interface level switching module 5 is connected to the main control unit 8 and the first UART interface 3, and is configured to select TTL and RS232 interface levels according to a level control signal of the main control unit 8. The RS232 level conversion module 6 is connected to the UART interface level switching module 5 and the logic processing module 7, and is configured to convert one of the TTL levels of the logic processing module 7 into a standard RS232 level specification. The logic processing module 7 is connected with the main control unit 8, the UART interface level switching module 5, and the RS232 level conversion module 6, and is configured to perform logic processing on the 1-channel UART TTL level of the main control unit 8, expand the UART level to 2-channel UART interfaces, respectively correspond to the TTL level interface and the RS232 level conversion module interface, and simultaneously, adaptively adapt to TTL 3.3V/5V levels at the TTL interface at the expanded rear end.
Specifically, the main control unit 8 includes a CAN interface 81, an interface protocol configuration module 82, a CAN interface protocol processing module 83, a UART interface protocol processing module 84, a UART interface level adaptive processing module 85, and a third UART interface 86.
The CAN interface 81 is in communication connection with the CAN transceiver module 1 to realize communication with a vehicle CAN bus. An interface protocol configuration module 82, configured to implement the following functional configuration through a configuration file: the CAN interface communication protocol and the UART interface communication protocol are configured, and the CAN interface 81 and the UART serial port are converted and configured into a transparent transmission mode or a local analysis mode; at the same time, the configuration file supports the configuration being issued locally via the third UART interface 86 or remotely by the automotive electronics 100. The CAN interface protocol processing module 83 is connected with the CAN interface 81 and is used for realizing the data transceiving with the vehicle CAN bus protocol according to the configuration protocol. The UART interface protocol processing module 84 is connected to the third UART interface 86, and is configured to complete the transceiving of the converted UART interface protocol data according to the configuration protocol. The UART interface level adaptive processing module 85 is connected to the UART interface level diagnostic module 4 and the UART interface level switching module 5, respectively, and is configured to perform signal processing and analysis to determine a specification of an opposite terminal interface level according to a signal output by the UART interface level diagnostic module 4, and output a level control signal to the UART interface level switching module 5, so as to select an adaptive interface level in an adaptive manner.
In this embodiment, the UART interface level switching module 5 needs to support TTL and RS232 level specifications, and the voltage range that needs to be supported is a voltage range of-12V to +12V, and because of the negative voltage level, in order to reduce the power supply design complexity and cost considerations, a single power supply is adopted to supply power, and a signal relay scheme is selected to support a wide voltage level range. As shown in fig. 2, P _ RX and P _ TX are external interfaces of the device, and the relay switch is used to switch paths of TTL and RS 232.
In practical application, if the output is that the RS232 level is butted with the TTL level interface, the RS232 level has a negative level and a voltage far exceeding the TTL level, which may cause overvoltage damage to the TTL interface terminal. Therefore, the relay is forced to be connected with the TTL interface level in the CAN bus interface conversion self-adaptive device by default, the RS232 interface channel is disconnected, the output level of the device is ensured to be the TTL level, and the UART interface of the opposite terminal equipment cannot be damaged. The control end of the relay controls the switch end SW _ CTR of the relay, and the level switching of the TTL end and the RS232 end can be realized. The port data receiving signal V _ CHECK is directly connected to a level diagnosis module in the device, and is used for monitoring the level of the UART interface at the opposite end of the device.
In this embodiment, the interface level diagnosis module 4 mainly diagnoses the interface level specification of the opposite-end device according to the level detection of the transmitting signal line V _ CHECK of the opposite-end automobile electronic device of the UART interface, thereby realizing that the UART interface level of the CAN bus interface conversion device is adaptively configured as a level specification interface matched with the opposite-end interface level. The diagnostic circuitry of the diagnostic module is shown in fig. 3.
The UART interface level diagnostic module 4 includes a first resistor R1, a second resistor R2, a third resistor R3, a fourth resistor RF, and an operational amplifier. One end of a first resistor R1 is connected to the transmission signal line V _ CHECK of the automotive electronic device 100, the other end of the first resistor R1 is connected to the positive input terminal of the operational amplifier, one end of a second resistor R2 is connected to VCC3V3, the other end of the second resistor R2 is connected to the positive input terminal of the operational amplifier, one end of a third resistor R3 is connected to the positive input terminal of the operational amplifier, the other end of the third resistor R3 is grounded, one end of a fourth resistor RF is connected to the negative input terminal of the operational amplifier, and the other end of the fourth resistor RF is connected to the output terminal of the operational amplifier. The voltage range of the sending signal line V _ CHECK is-12V, the voltage range of the positive input end of the operational amplifier is 0-3.3V, and the output voltage V _ OUT of the operational amplifier is 0-3.3V. The first resistor R1 has a resistance of 10k Ω, the second resistor R2 has a resistance of 2.2k Ω, the third resistor R3 has a resistance of 2k Ω, and the fourth resistor RF has a resistance of 10k Ω.
The possible voltage range of the opposite-end signal transmission line is-12V wide voltage range, so that firstly, in order to reduce the design difficulty, the device is powered by a single power supply; in addition, overvoltage damage of the negative voltage to an electronic device in a single power supply design is prevented, and an input signal is required to be ensured to meet the rated working voltage range of 0-3.3V. In the design, an operational amplifier is skillfully applied to design a set of adder circuit, and the resistance values of a first resistor R1, a second resistor R and a third resistor R3 are reasonably selected to ensure that the voltage range of the positive end of the operational amplifier is in the range of 0-3.3V within the V _ CHECK input wide voltage range of-12V, so that the pin rated working voltage of an electronic device is met. The feedback loop design of the operational amplifier is reasonably selected and designed into a voltage follower, so that the output V _ OUT of the operational amplifier is ensured to also meet the rated working voltage range of 0-3.3V.
The input voltage value of the + end of the operational amplifier is deduced, and the obtained calculation expression is as follows:
V+=(3.3×R1×R3+V_CHECK×R2×R3)/(R1×R2+R1×R3+R2×R3) (1)
the signal voltage value of the output end under the feedback loop of the operational amplifier is as follows:
Vout= V+ (2)
therefore, considering the voltage range of-12V to 12V, the resistance values with 1% precision are selected through statistical operation and are respectively as follows:
R1 = 10kΩ,R2 = 2.2kΩ,R3 = 2kΩ,RF = 10kΩ。
the correlation operation values calculated by using the calculation expression 1 are shown in the following table, the circuit is designed to be a voltage follower, and the voltage value of the V _ OUT output signal is the same as V +.
TABLE 1 correlation values
Figure 265464DEST_PATH_IMAGE001
In this embodiment, the main function of the logic processing module 7 is to implement that the main control unit 1-way UART port respectively corresponds to the RS232 and TTL two-way interfaces, and the main core processing measures of the module are as follows: and 2-path received data signal processing is realized through a logic AND gate, and the received data signals are integrated into 1-path signals to be connected with the main control module. Through the selection of the logic gate component, the input voltage range meets 5.5V threshold level and meets the input voltage range of 3.3V/5V TTL level specification under the condition of meeting the power supply of a 3.3V power supply, and the input voltage range is matched with the 3.3V/5V TTL interface level specification. The TTL receiving end circuit is designed, local circuit protection is well done, and the TTL interface level specification can receive the RS232 wide voltage input range, so that the circuit or the device in the TTL interface channel of the device cannot be damaged due to the RS232 level of opposite-end equipment in any state.
As shown in fig. 4, the logic processing module 7 includes a first and gate logic device and a second and gate logic device, and the first and gate logic device and the second and gate logic device are two-input and gate logic devices. An input end a and an input end B of the first and logic device are connected to a transmitting end (MCU _ TX) of the third UART interface 86 of the main control unit 8, and an output end O of the first and logic device is connected to a transmitting end (RS 232_ TX) and a TTL transmitting end (TTL _ TX) of the RS232 level conversion module 6. An input end A of the second AND logic device is connected with a receiving end (RS 232_ RX) of the RS232 level conversion module 6, an input end B of the second AND logic device is connected with a TTL receiving end (TTL _ RX), an output end O of the second AND logic device is connected with a receiving end (MCU _ RX) of a third UART interface 86 of the main control unit 8, a resistor and a diode are connected between the input end B of the second AND logic device and the TTL receiving end in series, and a grounding voltage stabilizing diode is connected between the input end B of the second AND logic device and the resistor.
The utility model discloses select AND gate logic device, input port voltage range supports under the single voltage power supply state of 3.3V, overvoltage range to 5.5V, and the device supports the ESD protection, satisfies 3.3V 5V TTL level range compatible design, can support hot plug and protection. The default port level of the device is TTL level, if the opposite end is RS232 level standard, in the interface level diagnosis process, RS232 overvoltage is connected into the device, so that a protection circuit design is adopted at the receiving end of a TTL circuit path. The path is connected with a diode in series, the voltage withstanding range is larger than 20V, and device damage caused by negative voltage input is prevented; meanwhile, a grounding voltage stabilizing diode is added to clamp the voltage of 5V, and when the voltage exceeds 5V, the level of a TTL receiving end is clamped to 5V, so that the RS232 level cannot damage the TTL input circuit device.
In this embodiment, the main control unit 8 is used as a core processing module of the apparatus, and may selectively use an off-chip SRAM + FLASH or an on-chip RAM + FLASH as the operating memory and the data storage space of the main control unit. The main control unit comprises an ADC (analog-to-digital converter) which can convert an input analog signal into a digital signal. The main control unit comprises a CPU and can execute relevant operations and data processing. The main control unit comprises a UART interface and a CAN transceiving interface.
Specifically, the functions of the interface protocol configuration module 82 include: and dividing an independent configuration file space inside the FLASH to serve as the configuration file space of the main control unit. The configuration file can be selected as a DBC or XML file, and the configuration file contains information: CAN message protocol: protocol communication of the vehicle CAN message CAN be realized; CAN message baud rate: different baud rates can be set; UART baud rate: the blind baud rate can be set; CAN message forwarding mode: can be configured in a transparent transmission mode or a resolution mode. A transparent transmission mode: the CAN message effective data are directly transmitted to the automobile electronic equipment through a UART interface according to the forms of ID and data; analysis mode: and directly and locally analyzing the data of the CAN message according to the configuration information, and forwarding an analysis result to the automobile electronic equipment according to a set format.
Specifically, the apparatus CAN realize data conversion between the CAN interface 81 and the third UART interface 86, and needs to have the CAN interface and the UART interface respectively, and interface with the vehicle CAN bus and the second UART interface 102 of the automotive electronic device 100 respectively.
Specifically, the UART interface level adaptive processing module 85 includes an ADC digital-to-analog converter, and can perform digital conversion on the voltage signal output by the level diagnosis module to convert the voltage signal into a digital quantity for CPU data processing. According to the output semaphore information of the interface level diagnosis module, the related data processing and analysis information is as follows.
There are 3 conditions for the UART interface state overall: TTL level specification, RS232 level specification, and unconnected interface.
State 1: RS232 level specification. The idle state is a logic '1' negative level, and the logic level in the data transmission stage is a positive and negative level flip state of logic '1' and logic '0', so that the condition that the opposite terminal interface is judged to be the RS232 level according to calculation and statistical empirical values is as follows:
the port is in an idle state: v _ OUT < 1.44V;
the port is in a data sending state: v _ OUT <1.44V (logic 1) or 2.16V < V _ OUT <3.25V (logic 0), and transitions between logic 0 and logic 1 at integer multiple intervals of the baud rate.
State 2: TTL level specification. The idle state is logic '1' TTL high level, and the logic level in the data transmission stage is logic '1' and logic '0' TTL high-low level flip state, so according to calculation and statistical experience values, the condition that the opposite terminal interface is judged to be TTL level is as follows:
the port is in an idle state: 2.09V < V _ OUT < 2.4V;
the port is in a data sending state: 2.09V < V _ OUT <2.4V (logic 1) or 1.80V < V _ OUT <1.85V (logic 0), and the logic 0 and logic 1 transition is performed at integer multiple baud rate intervals.
State 3: the interface is not connected. In this state, the V _ CHECK received signal state is a high impedance state, and V _ OUT = 1.57V.
According to statistical analysis and practical application analysis, the default state of the device port is TTL level specification, the level diagnosis module diagnoses that the level specification of the opposite end interface is RS232 state, the device port level is switched to RS232 port level specification, and otherwise, the state 2, the state 3 or the uncertain state are switched to TTL level specification. The advantages of this setting state are: one, the device is prevented from damaging the port of the opposite terminal equipment when the RS232 port is connected with the TTL level port of the opposite terminal; in addition, the RS232 level characteristics of the diagnosis module are more obvious, the threshold range is larger, and the diagnosis result is more reliable.
Based on the judgment conditions, increasing the threshold range of judgment basis, carrying out sufficient actual test verification, and confirming that the judgment conditions of the RS232 interface level specification are as follows:
the port is in an idle state: v _ OUT < 1.3V.
The port is in a data sending state: within a 100ms period, V _ OUT <1.3V (logic 1) and V _ OUT >2.35V (logic 0) state changes are detected.
The V _ OUT output is connected to a UART interface level self-adaptive processing module of the main control unit, voltage values are detected through an ADC (analog-to-digital converter) contained in the UART interface level self-adaptive processing module, and interface level standard switching is controlled according to the judgment condition. If the conditions are met, the diagnosis module diagnoses that the state of the port at the opposite end is the RS232 level specification, otherwise, the port is switched to the TTL level interface specification immediately.
As shown in fig. 5, an embodiment of the present invention provides a working process of a vehicle CAN bus interface conversion adaptive system as follows:
step 1: after the equipment is powered on, the equipment is initialized and normally started, and the level of the UART interface is configured as TTL level standard by default.
Step 2: and setting the level specification of the UART interface. And reading a configuration file in the main control unit, and confirming whether the UART interface level passes the configuration file configuration.
If the configuration file has configured the interface level specification: configuring the UART interface level into TTL level or RS232 level specification according to configuration file configuration requirements, and not executing self-adaptive operation.
If the configuration file does not configure the interface level specification: and diagnosing according to the level of a transmitting data line of the opposite terminal UART, and carrying out the self-adaptive configuration of the level of the UART interface, if the level is the RS232 interface level specification, configuring the UART interface of the equipment into the RS232 interface level specification, otherwise, configuring the UART interface of the equipment into the TTL interface level specification.
And step 3: according to the CAN interface communication protocol and UART interface communication protocol configuration description in the configuration file, completing the corresponding interface protocol configuration, and according to the configuration requirement of the CAN bus interface conversion device in the configuration file:
if the CAN message is in the transparent transmission mode, the CAN message data is transmitted to the automobile electronic equipment connected with the device without being processed after being acquired;
if the CAN message data is in the loading and unloading mode, local CAN message analysis is carried out after the CAN message data is acquired, and the analyzed CAN message data is transmitted to the automobile electronic equipment connected with the device according to the configured UART interface protocol specification.
And 4, step 4: in order to ensure the reliability of the self-adaptive interface level, an interrupt mode is adopted to detect the interface level change, and if the interface level change is found, the plugging operation of the interface is basically confirmed.
If the interface level changes: immediately configuring the UART interface level to a TTL mode, reconfirming the UART interface level according to the steps, and then executing the data transmission work of the step 3.
If the interface level is unchanged: the data transmission work of step 3 is repeatedly executed according to the UART interface level specification which has been adaptively configured.
To sum up, the utility model provides a vehicle CAN bus interface conversion self-adaptation system, accessible correlation technique diagnosis opposite terminal UART interface level standard, confirms that opposite terminal UART interface level standard is RS232 level or TTL level; through interface level specification diagnosis, output interface level specification is configured in a self-adaptive mode, and opposite end serial port level specification is matched, so that any UART interface equipment can be butted without concerning the interface level specification of opposite end equipment; the method supports local or remote configuration file transmission, realizes the CAN message interface protocol, and realizes the transparent transmission of the CAN message or the local analysis of the CAN message. The UART interface is used as a standard communication interface, and currently, equipment in the industry generally leaves the factory as a TTL level specification interface or an RS232 level specification interface, and communication can be performed only by confirming the level specification of the equipment interface at the opposite end in actual use. The device can simultaneously support the two interface level specifications in the industry, can automatically diagnose and automatically adapt to the interface level specification of the opposite terminal equipment.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments according to the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1. A vehicle CAN bus interface conversion adaptive system is characterized by comprising: the system comprises a CAN transceiving module (1), a power module (2), a first UART interface (3), a UART interface level diagnosis module (4), a UART interface level switching module (5), an RS232 level conversion module (6), a logic processing module (7) and a main control unit (8);
the CAN transceiver module (1) is communicated with a vehicle CAN bus and is also communicated with a main control unit (8);
the power supply module (2) is connected with the main control unit (8) and is used for converting a vehicle-mounted power supply network into a local power supply network which meets the requirement of the conversion of a vehicle CAN bus interface self-adaptive system;
the first UART interface (3) is connected with a second UART interface (102) of the automobile electronic equipment (100);
the UART interface level diagnosis module (4) is connected with the first UART interface (3) and the main control unit (8) and is used for processing and diagnosing electrical characteristics according to received signals of a transmitting end of the automobile electronic equipment (100) of the opposite end, inputting the processed results into the main control unit (8), judging the UART interface level and executing interface level control signals, so that the interface level can be adaptive to the interface level specification of the opposite end;
the UART interface level switching module (5) is connected with the main control unit (8) and the first UART interface (3) and is used for selecting TTL and RS232 interface levels according to a level control signal of the main control unit (8);
the RS232 level conversion module (6) is connected with the UART interface level switching module (5) and the logic processing module (7) and is used for converting one path of TTL level of the logic processing module (7) into standard RS232 level specification;
the logic processing module (7) is connected with the main control unit (8), the UART interface level switching module (5) and the RS232 level conversion module (6) and is used for performing logic processing on the 1-path UART TTL level of the main control unit (8), expanding the level into 2-path UART interfaces and respectively corresponding to the TTL level interface and the RS232 level conversion module interface.
2. The vehicle CAN bus interface conversion adaptive system according to claim 1, wherein the main control unit (8) comprises a CAN interface (81), an interface protocol configuration module (82), a CAN interface protocol processing module (83), a UART interface protocol processing module (84), a UART interface level adaptive processing module (85) and a third UART interface (86);
the CAN interface (81) is in communication connection with the CAN transceiving module (1) to realize communication with a vehicle CAN bus;
the interface protocol configuration module (82) is used for realizing the following functional configuration through a configuration file: the CAN interface communication protocol and the UART interface communication protocol are configured, and the CAN interface (81) and the UART serial port are converted and configured into a transparent transmission mode or a local analysis mode; meanwhile, the configuration file supports local configuration issuing through a third UART interface (86) or remote configuration issuing through the automobile electronic equipment (100);
the CAN interface protocol processing module (83) is connected with the CAN interface (81) and is used for realizing the data transceiving with the vehicle CAN bus protocol according to the configuration protocol;
the UART interface protocol processing module (84) is connected with a third UART interface (86) and is used for finishing the receiving and sending of converted UART interface protocol data according to a configuration protocol;
the UART interface level self-adaptive processing module (85) is respectively connected with the UART interface level diagnosis module (4) and the UART interface level switching module (5) and is used for carrying out signal processing and analyzing and judging the level specification of an opposite terminal interface according to signals output by the UART interface level diagnosis module (4), outputting level control signals to the UART interface level switching module (5) and selecting adaptive interface levels in a self-adaptive mode.
3. The vehicle CAN bus interface conversion adaptive system according to claim 2, wherein the UART interface level switching module (5) supports TTL and RS232 level specifications, supports a voltage range of-12V to +12V, adopts a single power supply to supply power, supports a wide voltage level range by using a signal relay scheme, realizes the channel switching of TTL and RS232 by a relay switch inside, forcibly connects TTL interface level in the CAN bus interface conversion adaptive device by default, disconnects RS232 interface channel, ensures that the output level of the device is TTL level, controls a switch terminal SW _ CTR of the relay to realize the level switching of TTL and RS232, and connects a port data receiving signal V _ CHECK to the UART interface level diagnostic module (4) for monitoring the interface level of the opposite terminal of the device.
4. The vehicle CAN bus interface conversion adaptive system according to claim 3, wherein the UART interface level diagnostic module (4) comprises a first resistor (R1), a second resistor (R2), a third resistor (R3), a fourth Resistor (RF) and an operational amplifier;
the one end of first resistance (R1) is connected with the signal line V _ CHECK that sends of automotive electronics (100), the other end and the positive input end of operational amplifier of first resistance (R1) are connected, VCC3V3 is connected to the one end of second resistance (R2), the other end and the positive input end of operational amplifier of second resistance (R2) are connected, the one end and the positive input end of operational amplifier of third resistance (R3) are connected, the other end ground connection of third resistance (R3), the one end and the negative input end of operational amplifier of fourth Resistance (RF) are connected, the other end and the output of operational amplifier of fourth Resistance (RF) are connected.
5. The adaptive system for CAN bus interface conversion of vehicle as claimed in claim 4, wherein the voltage of the transmission signal line V _ CHECK ranges from-12V to 12V, the voltage of the positive input terminal of the operational amplifier ranges from 0V to 3.3V, and the output voltage V _ OUT of the operational amplifier ranges from 0V to 3.3V.
6. The adaptive system for CAN bus interface conversion of vehicle according to claim 5, wherein the first resistor (R1) has a resistance of 10k Ω, the second resistor (R2) has a resistance of 2.2k Ω, the third resistor (R3) has a resistance of 2k Ω, and the fourth Resistor (RF) has a resistance of 10k Ω.
7. The vehicle CAN bus interface conversion adaptive system according to claim 6, wherein the logic processing module (7) comprises a first AND gate logic device and a second AND gate logic device, and the first AND gate logic device and the second AND gate logic device are two-input AND gate logic devices;
the input end A and the input end B of the first AND gate logic device are connected with the sending end of a third UART interface (86) of a main control unit (8), and the output end O of the first AND gate logic device is connected with the sending end of an RS232 level conversion module (6) and the TTL sending end;
the A input end of the second AND gate logic device is connected with the receiving end of the RS232 level conversion module (6), the B input end of the second AND gate logic device is connected with the TTL receiving end, the O output end of the second AND gate logic device is connected with the receiving end of a third UART interface (86) of the main control unit (8), a resistor and a diode are connected between the B input end of the second AND gate logic device and the TTL receiving end in series, and a grounding voltage stabilizing diode is connected between the B input end of the second AND gate logic device and the resistor.
CN202020810882.9U 2020-05-15 2020-05-15 Vehicle CAN bus interface conversion self-adaptive system Active CN210864417U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202020810882.9U CN210864417U (en) 2020-05-15 2020-05-15 Vehicle CAN bus interface conversion self-adaptive system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202020810882.9U CN210864417U (en) 2020-05-15 2020-05-15 Vehicle CAN bus interface conversion self-adaptive system

Publications (1)

Publication Number Publication Date
CN210864417U true CN210864417U (en) 2020-06-26

Family

ID=71309490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202020810882.9U Active CN210864417U (en) 2020-05-15 2020-05-15 Vehicle CAN bus interface conversion self-adaptive system

Country Status (1)

Country Link
CN (1) CN210864417U (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111968344A (en) * 2020-07-31 2020-11-20 中国铁道科学研究院集团有限公司 Signal interface detection equipment and method for railway earthquake early warning monitoring system
CN112965468A (en) * 2021-02-22 2021-06-15 上海星融汽车科技有限公司 Diagnostic data sending method, receiving method and system for vehicle ECU
CN114281743A (en) * 2021-11-29 2022-04-05 浪潮(山东)计算机科技有限公司 Device and method for converting PCIE (peripheral component interface express) to RS232 interface and TTL (transistor-transistor logic) interface and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111968344A (en) * 2020-07-31 2020-11-20 中国铁道科学研究院集团有限公司 Signal interface detection equipment and method for railway earthquake early warning monitoring system
CN112965468A (en) * 2021-02-22 2021-06-15 上海星融汽车科技有限公司 Diagnostic data sending method, receiving method and system for vehicle ECU
CN114281743A (en) * 2021-11-29 2022-04-05 浪潮(山东)计算机科技有限公司 Device and method for converting PCIE (peripheral component interface express) to RS232 interface and TTL (transistor-transistor logic) interface and storage medium

Similar Documents

Publication Publication Date Title
CN210864417U (en) Vehicle CAN bus interface conversion self-adaptive system
CN102780725A (en) Communication protocol adaption device and communication protocol adaption method for vehicle diagnosis
EP1407580B1 (en) Bus system and method for exchanging data
CN109050444A (en) CAN circuit structure and its vehicle diagnostic equipment
CN216956764U (en) Pin switching circuit and fault diagnosis device of OBD interface
CN109743240B (en) Interface switching device and method for communication equipment
CN110794808A (en) Matrix driving device and multi-channel signal switching method thereof
CN207560031U (en) The controllable controller of CAN communication circuit terminal resistance
CN114035552A (en) Vehicle diagnosis method, diagnosis device and readable storage medium
CN110580037B (en) UART communication system and vehicle-mounted equipment
CN111711552B (en) Terminal resistor access circuit, servo driver and control system
CN107885188A (en) A kind of vehicle diagnosing system
CN201113099Y (en) Data bus signal dispenser
CN208255712U (en) Hand-held type automobile diagnostic equipment based on CAN-BUS bus communication protocol
CN217388736U (en) Pin switching circuit of OBD interface and vehicle detection equipment
CN216486126U (en) Vehicle fault diagnosis device and configuration bit array circuit
CN112346403A (en) Extend module connecting circuit
CN216387850U (en) OBD communication interface switching circuit
JP2005513872A (en) Method and apparatus for bidirectional transmission of data
CN218788164U (en) IVI testing device and testing system
CN220290093U (en) OBD diagnostic equipment serial ports multiplexing realization circuit
KR102676505B1 (en) Diagnostic information transmitting apparatus and method for detecting pinmap of OBD connector
CN116192711B (en) Ethernet physical layer testing device, method and storage medium
CN215219118U (en) Wire harness module detection tool for vehicle test
CN216486127U (en) Pin signal monitoring circuit and fault detection equipment

Legal Events

Date Code Title Description
GR01 Patent grant
GR01 Patent grant