Disclosure of Invention
The embodiment of the application provides a debugging circuit for solving the problems existing in the related technology, and the technical scheme is as follows:
the embodiment of the application provides a debugging circuit, which comprises:
The CAN bus input interface comprises a first input interface, a second input interface and a third input interface, wherein the first input interface is used for accessing CANA networks, the second input interface is used for accessing CANB networks, and the third input interface is used for accessing 422 networks;
The CAN card module is provided with a CAN0 interface and a CAN1 interface, the CAN0 interface is in electrical communication with the first input interface, and the CAN1 interface is in electrical communication with the second input interface through the first switch;
the debugging output interface is in electrical communication with the CAN1 interface through a first switch, wherein the first switch is a double-throw switch;
The system comprises a programming debugging module and a programming device, wherein the programming debugging module is provided with a UART serial interface and a SWD interface, and the SWD interface is in electrical communication with the programming device;
The first conversion module is used for converting the 422 network into the 485 network, a first output end of the first conversion module is electrically communicated with the debugging output interface, a second output end of the first conversion module is electrically communicated with the third input interface, and a first output end and a second output end of the second conversion module are both electrically communicated with the debugging output interface;
The input end of the first conversion module, the first input end and the second input end of the second conversion module and the input end of the burner are all in electrical communication with the UART serial interface through a second switch, and the second switch is a four-throw switch.
In one embodiment, a first stationary end of the first switch is in electrical communication with the debug output interface, a second stationary end of the first switch is in electrical communication with the first input interface, and a movable end of the first switch is in electrical communication with the CAN1 interface.
In one embodiment, the first stationary end of the second switch is in electrical communication with the input end of the first conversion module, the second stationary end of the second switch is in electrical communication with the first input end of the second conversion module, the third stationary end of the second switch is in electrical communication with the second input end of the second conversion module, the fourth stationary end of the second switch is in electrical communication with the input end of the burner, and the movable end of the second switch is in electrical communication with the UART interface.
In one embodiment, the debug circuitry further comprises:
The terminal block is connected between the CAN bus input interface and the CAN card module, the CAN0 interface is in electrical communication with the first input interface through the terminal block, and the CAN1 interface is in electrical communication with the second input interface through the terminal block.
In one embodiment, the debug circuitry further comprises:
And the input end of the PCAN module and the PCAN module are electrically communicated with the CAN1 interface or the CAN0 interface through a third switch, and the third switch is a double-throw switch.
In one embodiment, the first stationary end of the third switch is in electrical communication with the CAN1 interface, the second stationary end of the third switch is in electrical communication with the CAN0 interface, and the movable end of the third switch is in electrical communication with the input end of PCAN.
In one embodiment, the SWD interface is in electrical communication with the debug output interface.
In one embodiment, the first conversion module is configured to convert any two signals of the TTL level signal, the 485 signal and the 422 signal to each other, and the second conversion module is configured to convert any two signals of the TTL level signal and the 232 signal to each other, where a first output end of the first conversion module outputs the 485 signal to the debug output interface, and the first input interface outputs the 422 signal to a second output end of the first conversion module.
In one embodiment, the first output end of the second conversion module is in electrical communication with the debug output interface through a UARTA network, the UARTA network comprises a UARTA receiving branch and a UARTA transmitting branch, and the second output end of the second conversion module is in electrical communication with the debug output interface through a UARTB network, the UARTB network comprises a UARTB receiving branch and a UARTB transmitting branch.
In one embodiment, the UARTA network further includes a fourth switch, the fourth switch being a double throw switch, a first stationary end of the fourth switch in electrical communication with the UARTA receiving branch, a second stationary end of the fourth switch in electrical communication with the UARTA transmitting branch, and a movable end of the fourth switch in electrical communication with the first output end of the second conversion module.
In one embodiment, the UARTB network further comprises a fifth switch, the fifth switch being a double throw switch, a first stationary end of the fifth switch being in electrical communication with the UARTB receiving branch, a second stationary end of the fifth switch being in electrical communication with the UARTB transmitting branch, and a movable end of the fifth switch being in electrical communication with the second output end of the second conversion module.
In one embodiment, both the CAN card and the burn-in debug module have USB interfaces.
The debugging circuit provided by the embodiment of the application has various debugging functions, and is high in integration level and convenient to debug.
The foregoing summary is for the purpose of the specification only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of the present application will become apparent by reference to the drawings and the following detailed description.
Detailed Description
Hereinafter, only certain exemplary embodiments are briefly described. As will be recognized by those of skill in the pertinent art, the described embodiments may be modified in various different ways without departing from the spirit or scope of the present application. Accordingly, the drawings and description are to be regarded as illustrative in nature and not as restrictive.
Fig. 1 shows a circuit diagram of debug circuitry 100 in accordance with an embodiment of the present application. The debug circuitry 100 of the embodiments of the present application may be used for circuit debugging of an AGV.
As shown in fig. 1, the debug circuitry 100 includes a CAN (Controller Area Network ) bus input interface, a CAN card module 20, a debug output interface 30, a burn-in debug module 40, a burner 50, a first conversion module 60, and a second conversion module 70.
Specifically, the CAN bus input interface 10 includes a first input interface 11, a second input interface 12, and a third input interface 13, where the first input interface 11 is used to access CANA a network, the second input interface 12 is used to access CANB a network, and the third input interface 13 is used to access 422 a network. In one example, the CANA network and CANB network are each in electrical communication with different controllers of the AGV, and the third input interface 13 may be an RS422 interface. It can be appreciated that the RS422 interface adopts a data transmission protocol of 4-wire, double full-duplex, differential transmission, and multipoint communication. The CAN bus input interface 10 may be an RJ45 interface.
The CAN card module 20 has a CAN0 interface 21 and a CAN1 interface 22, the CAN0 interface 21 being in electrical communication with the first input interface 11, the CAN1 interface 22 being in electrical communication with the second input interface 12 via the first switch 80. The debug output interface 30 is in electrical communication with the CAN1 interface 22 via a first switch 80, wherein the first switch 80 is a double throw switch. It is to be understood that the first input interface 11 transmits CANA data to the CAN1 interface 22.
In one embodiment, as shown in FIG. 1, a first stationary end of the first switch 80 is in electrical communication with the debug output interface 30, a second stationary end of the first switch 80 is in electrical communication with the first input interface 11, and a movable end of the first switch 80 is in electrical communication with the CAN1 interface 22. Wherein debug output interface 30 may be a DC3-20P connector. When the movable end of the first switch 80 is connected to the first stationary end, the CAN1 interface 22 is in electrical communication with the debug output interface 30, and at this time, the CAN1 interface 22 transmits CANC data to the debug output interface 30, and detects whether the CANC network of the debug circuit 100 fails by detecting whether the debug output interface 30 outputs CANC data. When the movable end of the second switch 81 is connected to the second stationary end, the CAN0 interface 21 is in electrical communication with the first input interface 11, and at this time, the first input interface 11 transmits CANB data to the CAN0 interface 21, and detects whether the CANB network of the debug circuit 100 fails by detecting whether the CAN card receives CANB data.
Further, the burner debugging module 40 has a UART (Universal Asynchronous Receiver/Transmitter, universal asynchronous receiver Transmitter) serial interface and a SWD (SERIAL WIRE Debug) interface, and the SWD interface 42 is in electrical communication with the burner 50. The first conversion module 60 is configured to convert 422 a network to 485 a network, a first output terminal of the first conversion module 60 is in electrical communication with the debug output interface 30, a second output terminal of the first conversion module 60 is in electrical communication with the third input interface 13, and a first output terminal and a second output terminal of the second conversion module 70 are both in electrical communication with the debug output interface 30. The UART is used for converting parallel data transmitted from an external computer into a serial data stream, and outputting or inputting the serial data stream through the UART serial interface 41.
It will be appreciated that 422 network data may be transmitted between the third transmission interface and the second output of the first conversion module 60, 485 network data may be transmitted between the debug output interface 30 and the first output of the first conversion module 60, and the first conversion module 60 may mutually convert 422 network data and 485 network data.
The input end of the first conversion module 60, the first input end and the second input end of the second conversion module 70, and the input end of the burner 50 are all in electrical communication with the UART serial interface 41 through the second switch 81, and the second switch 81 is a four-throw switch. That is, the second switch 81 may electrically connect one of the output terminal of the first conversion module 60, the first and second output terminals of the second conversion module 70, and the input terminal of the burner 50 to the UART serial interface 41.
For example, 485 network signals are transmitted between the UART serial interface 41 and the debug output interface 30 when the UART serial interface 41 is electrically connected to the input of the first conversion module 60, UARTA signals are transmitted between the UART serial interface 41 and the debug output interface 30 when the UART serial interface 41 is electrically connected to the first input of the second conversion module 70, UARTB signals are transmitted between the UART serial interface 41 and the debug output interface 30 when the UART serial interface 41 is electrically connected to the second input of the second conversion module 70, and data are transmitted between the UART serial interface 41 and the burner 50 when the UART serial interface 41 is electrically connected to the input of the burner 50.
In one specific example, as shown in fig. 1, the first stationary end of the second switch 81 is in electrical communication with the input end of the first conversion module 60, the second stationary end of the second switch 81 is in electrical communication with the first input end of the second conversion module 70, the third stationary end of the second switch 81 is in electrical communication with the second input end of the second conversion module 70, the fourth stationary end of the second switch 81 is in electrical communication with the input end of the burner 50, and the movable end of the second switch 81 is in electrical communication with the UART interface. Preferably, the fourth switch 83 is a double pole, four throw switch. Thus, by controlling the electrical conduction between the movable terminal and the different stationary terminal of the second switch 81, the output signal of the UART serial interface 41 can be debugged.
In one embodiment, SWD interface 42 is also in electrical communication with debug output interface 30. Thus, the signal output by SWD interface 42 may be directly output by debug output interface 30, thereby debugging SWD interface 42.
In one embodiment, the debug circuitry 100 further includes a terminal block coupled between the CAN bus input interface 10 and the CAN card module 20, the CAN0 interface 21 in electrical communication with the first input interface 11 through the terminal block, and the CAN1 interface 22 in electrical communication with the second input interface 12 through the terminal block.
In one embodiment, as shown in fig. 1, the debug circuitry 100 further includes PCAN modules, the input of the PCAN modules being in electrical communication with the CAN1 interface 22 or the CAN0 interface 21 through a third switch 82, the third switch 82 being a double throw switch.
In one example, when the second switch 81 electrically turns on the second input interface 12 and CAN1 interface 22, the second input interface 12 and PCAN may be electrically turned on by controlling the third switch 82 to electrically turn on the CAN1 interface 22 and PCAN, thereby separately detecting CANB networks. By controlling the third switch 82 to electrically conduct the CAN0 interfaces 21 and PCAN, the first input interfaces 11 and PCAN CAN be electrically conducted, thereby separately detecting CANA networks.
In one embodiment, the first stationary end of the third switch 82 is in electrical communication with the CAN1 interface 22, the second stationary end of the third switch 82 is in electrical communication with the CAN0 interface 21, and the movable end of the third switch 82 is in electrical communication with the input end of PCAN. For example, a first stationary end of the third switch 82 may be electrically connected between the terminal block and the CAN1 interface 22, and a second stationary end of the third switch 82 may be electrically connected between the terminal block and the CAN0 interface 21.
In one embodiment, the first conversion module 60 is configured to convert any two of the TTL (Transistor Transistor Logic, transistor logic level) level signal, 485 signal, and 422 signal to each other, and the second conversion module 70 is configured to convert any two of the TTL level signal and 232 signal to each other. The first output terminal of the first conversion module 60 outputs a 485 signal to the debug output interface 30, and the first input interface 11 outputs a 422 signal to the second output terminal of the first conversion module 60.
Specifically, as shown in fig. 1, when the movable terminal of the second switch 81 is electrically connected to the first stationary terminal, the first conversion module 60 may convert the TTL level signal output by the UART serial interface 41 into a 485 signal and output the 485 signal to the debug output interface 30, and the first conversion module 60 may also convert the 422 signal input by the third input interface 13 into a TTL level signal and transmit the TTL level signal to the UART serial interface 41. When the movable end of the second switch 81 is electrically connected to the second stationary end, the second conversion module 70 can convert the TTL level signal output by the UART serial interface 41 into a 232-RX0 signal and output the 232-RX0 signal to the debug output interface 30. When the movable terminal of the second switch 81 is electrically connected to the third stationary terminal, the second conversion module 70 can convert the TTL level signal into a 232-RX1 signal and output the 232-RX1 signal to the debug output interface 30.
In one embodiment, the first output of the second conversion module 70 is in electrical communication with the debug output interface 30 via a UARTA network, the UARTA network comprising a UARTA receiving branch and a UARTA transmitting branch, and the second output of the second conversion module 70 is in electrical communication with the debug output interface 30 via a UARTB network, the UARTB network comprising a UARTB receiving branch and a UARTB transmitting branch.
In one embodiment, the UARTA network further includes a fourth switch 83, the fourth switch 83 being a double throw switch, a first stationary end of the fourth switch 83 being in electrical communication with the UARTA receiving branch, a second stationary end of the fourth switch 83 being in electrical communication with the UARTA transmitting branch, and a movable end of the fourth switch 83 being in electrical communication with the first output end of the second conversion module 70. Thus, by controlling the movable end and the two stationary ends of the fourth switch 83 to be electrically conducted respectively, separate debugging can be performed on the UARTA receiving branch and the UARTA transmitting branch separately.
In one embodiment, the UARTB network further includes a fifth switch 84, the fifth switch 84 being a double throw switch, a first stationary end of the fifth switch 84 being in electrical communication with the UARTB receive branch, a second stationary end of the fifth switch 84 being in electrical communication with the UARTB transmit branch, and a movable end of the fifth switch 84 being in electrical communication with the second output end of the second conversion module 70. Thus, by controlling the movable terminal and the two stationary terminals of the fifth switch 84 to be electrically conductive, respectively, separate debugging can be performed on the UARTB receiving branch and the UARTB transmitting branch separately.
In one embodiment, both the CAN card and the burn-in debug module 40 have USB interfaces. Therefore, by arranging the USB interface, the computer CAN be respectively connected with the CAN card and the burning debugging module 40 to respectively transmit debugging signals to the CAN card and the burning debugging module 40.
A debugging method of debug circuitry 100 according to an embodiment of the present application is described below with reference to fig. 1.
As shown in fig. 1, by communicating the moving end of the first switch 80 with the first stationary end and the moving end of the third switch 82 with the second stationary end, the PCAN module is in electrical communication with the second input interface 12, the transmission and reception of the CANB network can be commissioned by the PCAN module. By communicating the moving end of the first switch 80 with the first stationary end and the moving end of the third switch 82 with the first stationary end, the PCAN module is in electrical communication with the debug output interface 30, the transmission and reception of CANC networks can be debugged by the PCAN module. By communicating the movable end of the third switch 82 with the second stationary end, the PCAN module is in electrical communication with the first input interface 11, the transmission and reception of the CANA network can be commissioned by the PCAN module.
By communicating the movable end of the second switch 81 with the first stationary end, the UART serial interface 41 communicates with the debug output interface 30, so that the transmission and reception of 485 signals can be debugged. By communicating the movable end of the second switch 81 with the second stationary end, the transmission and reception of UARTA signals can be debugged. By communicating the movable end of the second switch 81 with the third stationary end, the transmission and reception of UARTB signals can be debugged.
According to the debugging circuit 100 of the embodiment of the application, the CANC network and the CANB network CAN be debugged respectively by arranging the first switch 80 between the CAN card, the CAN bus input interface 10 and the debugging output interface 30 and the first switch 80 is a double-throw switch, and the 485 signal, the 422 signal and the 232 signal CAN be debugged respectively by arranging the second switch 81 between the burning debugging module 40, the first conversion module 60 and the second conversion module 70 and the second switch 81 is a four-throw switch. Thus, the debug circuit 100 according to the embodiment of the application has various debug functions, and has high integration level and convenient debugging.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in accordance with the present application are fully or partially produced. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. Computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Any process or method description in a flowchart or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process. And the scope of the preferred embodiments of the present application includes additional implementations in which functions may be performed in a substantially simultaneous manner or in an opposite order from that shown or discussed, including in accordance with the functions that are involved.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the methods of the embodiments described above may be performed by a program that, when executed, comprises one or a combination of the steps of the method embodiments, instructs the associated hardware to perform the method.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules described above, if implemented in the form of software functional modules and sold or used as a stand-alone product, may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic or optical disk, or the like.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that various changes and substitutions are possible within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.