Communication circuit

CN224709663UActive Publication Date: 2026-09-01HANGZHOU XPOWER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202521789623.1
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2025-08-21
Publication Date
2026-09-01
Estimated Expiration
2035-08-21

AI Technical Summary

Technical Problem

[0002]随着串口通信技术的发展,在对嵌入式系统、单片机、路由器、传感器、工业控制器等设备的进行开发、测试和维护的过程中,通常借助USB转双线串口TTL的通信工具进行相应调试,但目前的充电柜机和充电宝基于节能降本的原因,仅设置了一个通信触点和GND触点,所以现亟需一种能够实现对目前的充电柜机和充电宝进行开发、测试和维护的通信工具

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN224709663U_ABST
    Figure CN224709663U_ABST
Patent Text Reader

Abstract

This application relates to a communication circuit, which includes a control module and a serial port conversion module. The first input terminal and the first output terminal of the control module are connected to a first external terminal, the second input terminal of the control module is connected to the first terminal of the serial port conversion module, the second output terminal of the control module is connected to the second terminal of the serial port conversion module, and the third terminal of the serial port conversion module is connected to a second external terminal. The control module and the serial port conversion module are used to establish communication between the first external terminal and the second external terminal to enable the development, testing, and maintenance of current charging cabinets and power banks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of serial communication technology, and in particular to a communication circuit. Background Technology

[0002] With the development of serial communication technology, in the process of developing, testing and maintaining devices such as embedded systems, microcontrollers, routers, sensors, and industrial controllers, USB to dual-wire serial TTL communication tools are usually used for debugging. However, due to energy saving and cost reduction, current charging cabinets and power banks only have one communication contact and one GND contact. Therefore, there is an urgent need for a communication tool that can realize the development, testing and maintenance of current charging cabinets and power banks. Utility Model Content

[0003] Therefore, it is necessary to provide a communication circuit for developing, testing, and maintaining current charging cabinets and power banks, addressing the aforementioned technical problems.

[0004] In a first aspect, this application provides a communication circuit. It includes: a control module and a serial port conversion module; the first input terminal and the first output terminal of the control module are connected to a first external terminal, the second input terminal of the control module is connected to the first terminal of the serial port conversion module, the second output terminal of the control module is connected to the second terminal of the serial port conversion module, and the third terminal of the serial port conversion module is connected to a second external terminal; the control module and the serial port conversion module are used to establish communication between the first external terminal and the second external terminal.

[0005] In one embodiment, the communication circuit further includes a power supply module; the power supply module is connected to both the control module and the serial port conversion module, and is used to supply power to the control module and the serial port conversion module.

[0006] In one embodiment, the serial port conversion module includes: a first serial port conversion circuit and a second serial port conversion circuit; a first terminal of the first serial port conversion circuit is connected to a second output terminal of the control module, and a second terminal of the first serial port conversion circuit is connected to a second external terminal, for receiving data from the first external terminal transmitted through the control module, and sending the data from the first external terminal to the second external terminal; a first terminal of the second serial port conversion circuit is connected to a second input terminal of the control module, and a second terminal of the second serial port conversion circuit is connected to the second external terminal, for receiving data transmitted from the second external terminal, and sending the data transmitted from the second external terminal to the first external terminal through the control module.

[0007] In one embodiment, the first serial port conversion circuit includes: a first switching device, a first conversion resistor, and a second conversion resistor; a first terminal of the first switching device is connected to a second external terminal and the power module, a second terminal of the first switching device is connected to a first terminal of the first conversion resistor and a first terminal of the second conversion resistor, a second terminal of the first conversion resistor is grounded, a second terminal of the second conversion resistor is connected to a second output terminal of the control module, and a third terminal of the first switching device is grounded.

[0008] In one embodiment, the second serial port conversion circuit includes: a third conversion resistor, a fourth conversion resistor, a fifth conversion resistor, and a second switching device; the first terminal of the second switching device is connected to a second external terminal via the third conversion resistor, the first terminal of the second switching device is grounded via the fourth conversion resistor, the second terminal of the second switching device is connected to a power module via the fifth conversion resistor, the second terminal of the second switching device is connected to a second input terminal of a control module, and the third terminal of the second switching device is grounded.

[0009] In one embodiment, the communication circuit further includes: a first interface; a first contact of the first interface connected to an external power supply; a second contact of the first interface connected to a first input terminal of the control module; a third contact of the first interface connected to a first output terminal of the control module; a fourth contact of the first interface grounded; and the control module connected to the first external terminal through the first interface.

[0010] In one embodiment, the communication circuit further includes a second interface; a first contact of the second interface is connected to an external power supply; a second contact of the second interface is connected to a third terminal of the serial port conversion module; a third contact of the second interface is grounded; and the serial port conversion module is connected to the second external terminal through the second interface.

[0011] In one embodiment, the communication circuit further includes: a first expansion interface; a first connection point of the first expansion interface is connected to a power module; a second connection point of the first expansion interface is connected to a first expansion terminal of the control module; a third connection point of the first expansion interface is connected to a second expansion terminal of the control module; a fourth connection point of the first expansion interface is grounded; and the control module is connected to the first expansion device through the first expansion interface.

[0012] In one embodiment, the communication circuit further includes: a second expansion interface; a first connection point of the second expansion interface is connected to a power module; a second connection point of the second expansion interface is connected to a third expansion terminal of the control module; a third connection point of the second expansion interface is connected to a fourth expansion terminal of the control module; a fourth connection point of the second expansion interface is connected to a fifth expansion terminal of the control module; a fifth connection point of the second expansion interface is grounded; and the control module is connected to the second expansion device through the second expansion interface.

[0013] In one embodiment, the communication circuit further includes: a third expansion interface; a first connection point of the third expansion interface is connected to a power module; a second connection point of the third expansion interface is connected to a sixth expansion terminal of the control module; a third connection point of the third expansion interface is connected to a seventh expansion terminal of the control module; a fourth connection point of the third expansion interface is connected to an eighth expansion terminal of the control module; a fifth connection point of the third expansion interface is grounded; and the control module is connected to the third expansion device through the third expansion interface.

[0014] In the aforementioned communication circuit, the first input and first output terminals of the control module are connected to a first external terminal, the second input terminal of the control module is connected to the first terminal of the serial port conversion module, the second output terminal of the control module is connected to the second terminal of the serial port conversion module, and the third terminal of the serial port conversion module is connected to a second external terminal. Communication between the first and second external terminals is established through the control module and the serial port conversion module to enable the development, testing, and maintenance of current charging cabinets and power banks. Attached Figure Description

[0015] Figure 1 This is a block diagram of the communication circuit in one embodiment;

[0016] Figure 2 This is an actual circuit diagram of the power supply circuit in one embodiment;

[0017] Figure 3 This is an actual circuit diagram of the control module in one embodiment;

[0018] Figure 4 This is an actual circuit diagram of the second interface in one embodiment;

[0019] Figure 5 This is an actual circuit diagram of the serial port conversion module in one embodiment;

[0020] Figure 6 Here is an actual circuit diagram of the first interface in one embodiment;

[0021] Figure 7 This is an actual circuit diagram of the first expansion interface in one embodiment;

[0022] Figure 8 This is an actual circuit diagram of the second expansion interface in one embodiment;

[0023] Figure 9 This is an actual circuit diagram of the third expansion interface in one embodiment.

[0024] Reference numerals: 10, First external terminal; 20, Control module; 30, Serial port conversion module; 31, First serial port conversion circuit; 32, Second serial port conversion circuit; 40, Second external terminal; Q2, First switching device; Q1, Second switching device; R10, First conversion resistor; R8, Second conversion resistor; R5, Third conversion resistor; R9, Fourth conversion resistor; R2, Fifth conversion resistor; R3, Sixth conversion resistor; R0, First interface resistor; R11, Second interface resistor; R12, Third interface resistor; R21, Fourth interface resistor; C3, First interface capacitor; C1, Second external terminal; Q2, First external terminal; Q3, Second external terminal; Q4, First external terminal; Q5, Second external terminal; Q6, Second external terminal; Q7, Second external terminal; Q8, Second external terminal; R9, Third external terminal; R10, First conversion resistor; R11, Second external terminal; R22, Third external terminal; R23, Fourth external terminal; R24, Second external terminal; R25, Second external terminal; R26, Third external terminal; R27, Second external terminal; R28, Second external terminal; R29, Third external terminal; R20, Second external terminal; R21, Third external terminal; R22, Second external terminal; R3, Fourth external terminal; R28, Fifth external terminal; R29, Second external terminal; R20, Third external terminal; R21, Second external terminal; R22, Third external terminal; R3, Fourth external terminal; R29, Fifth external terminal; R20, Second ... Third external terminal; R22, Second external terminal; R3, Fourth external terminal; R29, Fifth external terminal; R20, Second external terminal; R2 Two-interface capacitors; C54, first capacitor; C55, second capacitor; C56, third capacitor; C57, fourth capacitor; U10, voltage regulator component; R6, first extension resistor; R7, second extension resistor; R20, third extension resistor; R19, fourth extension resistor; C2, first extension capacitor; R13, fifth extension resistor; R14, sixth extension resistor; R16, seventh extension resistor; C4, second extension capacitor; R15, eighth extension resistor; R17, ninth extension resistor; R18, tenth extension resistor; C5, third extension capacitor; C6, fifth capacitor; C7, sixth capacitor. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0026] To address the aforementioned problems, in one embodiment of this application, such as Figure 1 As shown, a communication circuit is provided, which includes a control module 20 and a serial port conversion module 30;

[0027] The first input terminal and the first output terminal of the control module 20 are connected to the first external terminal 10, the second input terminal of the control module 20 is connected to the first terminal of the serial port conversion module 30, the second output terminal of the control module 20 is connected to the second terminal of the serial port conversion module 30, and the third terminal of the serial port conversion module 30 is connected to the second external terminal 40.

[0028] The control module 20 and the serial port conversion module 30 are used to establish communication between the first external terminal 10 and the second external terminal 40.

[0029] It should be noted that in this embodiment, the first external terminal 10 is a terminal device supporting the UART protocol, such as a computer, and the second external terminal 40 is a terminal device supporting the TTL communication protocol with only one communication contact and one ground contact, such as a charging cabinet or power bank currently equipped with only one communication contact. The control module 20 is a microcomputer chip. In the above-described communication circuit, the first input terminal and the first output terminal of the control module 20 are connected to the first external terminal 10, the second input terminal of the control module 20 is connected to the first terminal of the serial port conversion module 30, the second output terminal of the control module 20 is connected to the second terminal of the serial port conversion module 30, and the third terminal of the serial port conversion module 30 is connected to the second external terminal 40. A bidirectional data pass-through is established between the first external terminal 10 and the second external terminal 40 through the control module 20 and the serial port conversion module 30 to enable the development, testing, and maintenance of the current charging cabinet and power bank.

[0030] In other embodiments of this application, such as Figure 2 As shown, the communication circuit also includes: a power supply module;

[0031] The power module is connected to both the control module 20 and the serial port conversion module 30, and is used to supply power to the control module 20 and the serial port conversion module 30.

[0032] Specifically, the power supply module includes: a voltage regulator component U10, a first capacitor C54, a second capacitor C55, a third capacitor C56, and a fourth capacitor C57. The first terminal of the first capacitor C54 is connected to both the external power supply and the first terminal of the voltage regulator component U10, and the second terminal of the first capacitor C54 is grounded. The first terminal of the second capacitor C55 is connected to both the external power supply and the first terminal of the voltage regulator component U10, and the second terminal of the second capacitor C55 is grounded. The first terminal of the third capacitor C56 is connected to both the second terminal of the voltage regulator component U10, the control module 20, and the serial port conversion module 30, and the second terminal of the third capacitor C56 is grounded. The first terminal of the fourth capacitor C57 is connected to both the second terminal of the voltage regulator component U10, the control module 20, and the serial port conversion module 30, and the second terminal of the fourth capacitor C57 is grounded. The third terminal of the voltage regulator component U10 is grounded.

[0033] It should be noted that the voltage regulator U10 is an LDO voltage regulator circuit, which can convert the 5V voltage provided by the external power supply into a 3.3V voltage.

[0034] In other embodiments of this application, such as Figure 5As shown, the serial port conversion module 30 includes: a first serial port conversion circuit 31 and a second serial port conversion circuit 32;

[0035] The first terminal of the first serial port conversion circuit 31 is connected to the second output terminal of the control module 20, and the second terminal of the first serial port conversion circuit 31 is connected to the second external terminal 40. It is used to receive the data of the first external terminal 10 transmitted by the first external terminal 10 through the control module 20, and to send the data of the first external terminal 10 to the second external terminal 40.

[0036] The first end of the second serial port conversion circuit 32 is connected to the second input end of the control module 20, and the second end of the second serial port conversion circuit 32 is connected to the second external terminal 40. It is used to receive data transmitted by the second external terminal 40 and send the data transmitted by the second external terminal 40 to the first external terminal 10 through the control module 20.

[0037] In other embodiments of this application, such as Figure 5 As shown, the first serial port conversion circuit 31 includes: a first switching device Q2, a first conversion resistor R10, and a second conversion resistor R8;

[0038] The first terminal of the first switching device Q2 is connected to the second external terminal 40 and the power module. The second terminal of the first switching device Q2 is connected to the first terminal of the first conversion resistor R10 and the first terminal of the second conversion resistor R8. The second terminal of the first conversion resistor R10 is grounded. The second terminal of the second conversion resistor R8 is connected to the second output terminal of the control module 20. The third terminal of the first switching device Q2 is grounded.

[0039] The first serial port conversion circuit 31 also includes a sixth conversion resistor R3, the first end of which is connected to the power module, and the second end of which is connected to the first end of the first switching device Q2.

[0040] When the second output terminal of the control module 20 outputs a high level, the first switching device Q2 is turned on and outputs a low level to the second external terminal 40. When the second output terminal of the control module 20 outputs a low level, the first switching device Q2 is turned off and outputs a high level to the second external terminal 40 under the action of the power supply module.

[0041] It should be noted that in the case of self-sending and self-receiving data, communication will be abnormal. Therefore, data reception should be disabled when sending data and enabled again after sending, or data that does not belong to you should be discarded when you receive data through the communication protocol.

[0042] Under normal circumstances, such as Figure 5 As shown, the bus Data is at a high level when idle. If the first switch Q2 is turned on at this time, the bus Data level is normally low, causing the second input terminal to be unable to receive data. Therefore, after the second output terminal finishes sending data, the level of the second output terminal should be set to low level to prevent the first switch Q2 from being turned on, pulling the bus Data level low, and causing the inability to receive data.

[0043] In other embodiments of this application, such as Figure 5 As shown, the second serial port conversion circuit 32 includes: a third conversion resistor R5, a fourth conversion resistor R9, a fifth conversion resistor R2, and a second switching device Q1;

[0044] The first terminal of the second switching device Q1 is connected to the second external terminal 40 via the third conversion resistor R5. The first terminal of the second switching device Q1 is grounded via the fourth conversion resistor R9. The second terminal of the second switching device Q1 is connected to the power module via the fifth conversion resistor R2. The second terminal of the second switching device Q1 is connected to the second input terminal of the control module 20. The third terminal of the second switching device Q1 is grounded.

[0045] When the second external terminal 40 sends a high level to the second serial port conversion circuit 32, the second switching device Q1 is turned on to ground, so that the second input terminal of the control module 20 is input with a low level. When the second external terminal 40 sends a low level to the first serial port conversion circuit 31, the second switching device Q1 is turned off, and under the action of the power supply module, the second input terminal of the control module 20 is input with a high level.

[0046] In other embodiments of this application, such as Figure 6 As shown, the communication circuit further includes: a first interface;

[0047] The first contact point of the first interface is connected to an external power supply; the second contact point of the first interface is connected to the first input terminal of the control module 20; the third contact point of the first interface is connected to the first output terminal of the control module 20; the fourth contact point of the first interface is grounded; the control module 20 is connected to the first external terminal 10 through the first interface.

[0048] It should be noted that the communication circuit further includes: a first interface resistor R0, a second interface resistor R11, a third interface resistor R12, a fourth interface resistor R21, and a first interface capacitor C3. The first end of the first interface resistor R0 is connected to the first connection contact of the first interface, and the second end of the first interface resistor R0 is connected to an external power supply. The first end of the first interface capacitor C3 is connected to an external power supply, and the second end of the first interface capacitor C3 is grounded. The first end of the second interface resistor R11 is connected to the second connection contact of the first interface, and the second end of the second interface resistor R11 is connected to the first input terminal of the control module 20. The first end of the third interface resistor R12 is connected to the third connection contact of the first interface, and the second end of the third interface resistor R12 is connected to the first output terminal of the control module 20. The first end of the fourth interface resistor R21 is connected to the first output terminal of the control module 20, and the second end of the fourth interface resistor R21 is grounded.

[0049] It should be noted that the first interface resistor R0 is a shorting resistor, the first interface capacitor C3 is a filter capacitor, the second interface resistor R11 and the third interface resistor R12 are current limiting resistors, and the fourth interface resistor R21 is a pull-down resistor.

[0050] In other embodiments of this application, such as Figure 4 As shown, the communication circuit also includes a second interface;

[0051] The first contact point of the second interface is connected to an external power supply; the second contact point of the second interface is connected to the third terminal of the serial port conversion module 30; the third contact point of the second interface is grounded; the serial port conversion module 30 is connected to the second external terminal 40 through the second interface.

[0052] It should be noted that the communication circuit further includes a second interface capacitor C1, the first end of which is connected to the first contact point of the second interface and the external power supply, and the second end of which is grounded.

[0053] It should be noted that the communication circuit is in receive mode by default, in which case two scenarios are possible. One scenario is that when the second external terminal 40 sends data to the communication circuit, the data is transmitted to the serial port conversion module 30 through the second interface. The serial port conversion module 30 then transmits the data to the second input terminal of the control module 20, where the control module 20 receives the data. After data reception is complete, the control module 20 sends data to the external serial port through the first output terminal to the first interface, thus achieving data pass-through from the second external terminal 40 to the first external terminal 10.

[0054] In another scenario, the communication circuit defaults to a receiving state. When the first external terminal 10 sends data to the communication circuit, the data is transmitted through the first interface of the communication circuit to the first input terminal of the control module 20, where the control module 20 receives the data. After data reception is complete, the control module 20 sends data to the serial port conversion module 30 through its second output terminal, while simultaneously closing its second input terminal to prevent data from being sent and received simultaneously and causing confusion. The serial port conversion module 30 then sends the data to the second external terminal 40 through its second interface, thus achieving transparent data transmission from the first external terminal 10 to the second external terminal 40.

[0055] It should be noted that, as Figure 3 As shown, the communication circuit further includes a filtering circuit, which includes a fifth capacitor C6 and a sixth capacitor C7. The first end of the fifth capacitor C6 is connected to ground and the ground terminal of the control module 20, and the second end of the fifth capacitor C6 is connected to the power supply module and the enable terminal of the control module 20. The first end of the sixth capacitor C7 is connected to ground and the ground terminal of the control module 20, and the second end of the sixth capacitor C7 is connected to the power supply module and the enable terminal of the control module 20.

[0056] It should be noted that, in this embodiment, the enable terminal of the control module 20 is pin 9, and the ground terminal of the control module 20 is pin 7.

[0057] In other embodiments of this application, such as Figure 7 As shown, the communication circuit further includes: a first expansion interface;

[0058] The first contact point of the first expansion interface is connected to the power module; the second contact point of the first expansion interface is connected to the first expansion terminal of the control module 20; the third contact point of the first expansion interface is connected to the second expansion terminal of the control module 20; the fourth contact point of the first expansion interface is grounded; the control module 20 is connected to the first expansion device through the first expansion interface.

[0059] It should be noted that the communication circuit further includes: a first expansion resistor R6, a second expansion resistor R7, a third expansion resistor R20, a fourth expansion resistor R19, and a first expansion capacitor C2; the first end of the first expansion resistor R6 is connected to the second connection contact of the first expansion interface, and the second end of the first expansion resistor R6 is connected to the first expansion terminal of the control module 20; the first end of the second expansion resistor R7 is connected to the third connection contact of the first expansion interface, and the second end of the second expansion resistor R7 is connected to the second expansion terminal of the control module 20; the first end of the first expansion capacitor C2 is connected to the power module, the first connection contact of the first expansion interface, the first end of the third expansion resistor R20, and the first end of the fourth expansion resistor R19; the second end of the first expansion capacitor C2 is grounded; the second end of the third expansion resistor R20 is connected to the first expansion terminal of the control module 20, and the second end of the fourth expansion resistor R19 is connected to the second expansion terminal of the control module 20.

[0060] It should be noted that the first extension resistor R6 and the second extension resistor R7 are current-limiting resistors, the first extension capacitor C2 is a power supply filter capacitor, and the third extension resistor R20 and the fourth extension resistor R19 are pull-up resistors.

[0061] It should be noted that the first expansion interface is an expansion interface that supports the I2C protocol. The control module 20 performs corresponding read and write operations by sending corresponding clock signals and data signals through the first expansion terminal and the second expansion terminal, and obtains information about the first expansion device from the first expansion interface.

[0062] In this embodiment, the first extension terminal of the control module 20 is pin 16, and the second extension terminal of the control module 20 is pin 15.

[0063] In other embodiments of this application, such as Figure 8 As shown, the communication circuit further includes: a second expansion interface;

[0064] The first contact point of the second expansion interface is connected to the power module; the second contact point of the second expansion interface is connected to the third expansion terminal of the control module 20; the third contact point of the second expansion interface is connected to the fourth expansion terminal of the control module 20; the fourth contact point of the second expansion interface is connected to the fifth expansion terminal of the control module 20; the fifth contact point of the second expansion interface is grounded; the control module 20 is connected to the second expansion device through the second expansion interface.

[0065] The communication circuit further includes: a fifth extension resistor R13, a sixth extension resistor R14, a seventh extension resistor R16, and a second extension capacitor C4; the first end of the fifth extension resistor R13 is connected to the second connection contact of the second extension interface, and the second end of the fifth extension resistor R13 is connected to the third extension terminal of the control module 20; the first end of the sixth extension resistor R14 is connected to the third connection contact of the second extension interface, and the second end of the sixth extension resistor R14 is connected to the fourth extension terminal of the control module 20; the first end of the seventh extension resistor R16 is connected to the fourth connection contact of the second extension interface, and the second end of the seventh extension resistor R16 is connected to the fifth extension terminal of the control module 20; the first end of the second extension capacitor C4 is connected to both the first connection contact of the second extension interface and the power module, and the second end of the second extension capacitor C4 is grounded.

[0066] It should be noted that the fifth extension resistor R13, the sixth extension resistor R14, and the seventh extension resistor R16 are current-limiting resistors, and the second extension capacitor C4 is a filter capacitor.

[0067] It should be noted that the second expansion interface is an expansion interface that supports the SPI protocol. The control module 20 sends corresponding clock signals and performs corresponding read and write operations on data signals through the third expansion terminal, the fourth expansion terminal and the fifth expansion terminal, including master device sending and slave device receiving, slave device sending and master device receiving, and obtaining information of the second expansion device from the second expansion interface.

[0068] In this embodiment, the third expansion terminal of the control module 20 is pin 12, the fourth expansion terminal is pin 13, and the fifth expansion terminal is pin 14.

[0069] In other embodiments of this application, such as Figure 9 As shown, the communication circuit further includes: a third expansion interface;

[0070] The first contact point of the third expansion interface is connected to the power module; the second contact point of the third expansion interface is connected to the sixth expansion terminal of the control module 20; the third contact point of the third expansion interface is connected to the seventh expansion terminal of the control module 20; the fourth contact point of the third expansion interface is connected to the eighth expansion terminal of the control module 20; the fifth contact point of the third expansion interface is grounded; the control module 20 is connected to the third expansion device through the third expansion interface.

[0071] The communication circuit also includes: an eighth extension resistor R15, a ninth extension resistor R17, a tenth extension resistor R18, and a third extension capacitor C5.

[0072] The first end of the eighth expansion resistor R15 is connected to the second contact point of the third expansion interface, and the second end of the eighth expansion resistor R15 is connected to the sixth expansion terminal of the control module 20. The first end of the ninth expansion resistor R17 is connected to the third contact point of the third expansion interface, and the second end of the ninth expansion resistor R17 is connected to the seventh expansion terminal of the control module 20. The first end of the tenth expansion resistor R18 is connected to the fourth contact point of the third expansion interface, and the second end of the tenth expansion resistor R18 is connected to the eighth expansion terminal of the control module 20. The first end of the third expansion capacitor C5 is connected to both the first contact point of the third expansion interface and the power module, and the second end of the third expansion capacitor C5 is grounded.

[0073] It should be noted that the eighth extension resistor R15, the ninth extension resistor R17, and the tenth extension resistor R18 are current-limiting resistors, and the third extension capacitor C5 is a filter capacitor.

[0074] It should be noted that the third expansion interface is an expansion interface that supports ADC. The control module 20 reads the external analog voltage through the sixth expansion terminal, the seventh expansion terminal and the eighth expansion terminal.

[0075] In this embodiment, the sixth expansion terminal of the control module 20 is pin 3, the seventh expansion terminal is pin 20, and the eighth expansion terminal is pin 19.

[0076] It should be noted that the first external terminal 10 sends corresponding commands to the communication circuit via the first interface through its general-purpose UART serial port. The control module 20 determines which protocol interface to communicate with based on the received commands and sends the corresponding protocol format to the corresponding device. Upon successful writing or reading, the module returns the relevant information to the general-purpose UART serial port via the first interface, thus enabling communication between the general-purpose UART serial port and devices with different protocol interfaces. The serial port command interaction protocol frame format is as follows:

[0077]

[0078] The frame header is 2 bytes long and contains fixed data. The frame length is also 2 bytes long, transmitted first as the lower byte and then as the higher byte, representing the total length in bytes from the frame header to the end of frame verification. The frame sequence number is 1 byte long and follows a preset format. It is only used for short-duration, high-frequency transmissions. Each transmitted command increments the sequence number by 1, ranging from 0 to 255, and is reset to zero if it exceeds the range. Retransmissions retain the same sequence number, meaning three retransmissions are performed at 100ms intervals. The response command frame sequence number equals the sequence number of the responded message. The command word is 1 byte long and represents a specific command function. For example, command word 0x01 indicates I2C communication; command word 0x02 indicates SPI communication; and command word 0x03 indicates ADC voltage acquisition. The length of the command type is 1 byte, 0x00 represents the calling instruction, and 0x01 represents the response instruction; whether it is the first external terminal 10 or the second external terminal 40, as long as a normal data frame is sent, it is a calling instruction; the length of the command body can be multiple bytes, and its length is not fixed. It is related to the function corresponding to the command word, and the command body format will be different for different command words.

[0079] For example, the command words, command types, and command bodies for the I2C protocol, SPI protocol, and ADC interface are as follows:

[0080] .

[0081] It should be noted that when reading and writing I2C and SPI commands, the first external terminal 10 writes data to the second external terminal 40, and the data content is the data to be written. The first external terminal 10 also reads data from the second external terminal 40, and the data content is the data read. When the control module 20 replies to the first external terminal 10 after reading or writing from the second external terminal 40, if it is a write operation: the data content is 1, indicating successful writing; if writing fails, an exception response frame is directly replied. If it is a read operation: the data content is the data read; if reading fails, an exception response frame is directly replied.

[0082] It should be noted that when reading and writing ADC instructions, the first external terminal 10 sends an instruction to read ADC data: the 2 bytes corresponding to the data content are removed, and after the control module 20 reads the ADC data, it replies to the first external terminal 10: the length of the data content is 2 bytes, the content is the data of the ADC that was read, the unit is MV, which is the actual voltage of the circuit, and its upper limit is 65535mV.

[0083] The frame checksum is 2 bytes long. All data from the frame header to the data body needs to be checked, with the checksum result of the lower byte first and the checksum result of the higher byte last. For each frame of interactive data, the receiver needs to check the data. Only when the frame checksum result matches the sender's frame checksum data is the data considered valid. When a checksum error occurs, the receiver replies with an error response frame, which the sender can then retransmit. The receiver and sender are explained as follows: When the first external terminal 10 needs to read or write data from different protocol interfaces, it first sends a protocol format instruction to the communication circuit. In this case, the first external terminal 10 is the sender, and the control module 20 is the receiver. Then, the control module 20 of this system performs read / write operations to the corresponding extended devices through different protocol interfaces, and then sends the read / write results to the first external terminal 10 through the first interface. In this case, the control module 20 is the sender, and the first external terminal 10 is the receiver.

[0084] The normal response frame is as follows: When the first external terminal 10 acts as the sender and the control module 20 acts as the receiver, the sender sends the corresponding protocol command to the receiver. Upon receiving a normal data frame and confirming that the frame format and frame verification are correct, the receiver immediately replies with a normal response frame and simultaneously performs read / write operations on the extended device of the corresponding protocol interface. Within 100ms, the receiver replies with a normal data frame, filling the command body with either a successful write result or read content. If the control module 20 fails to read / write with the corresponding protocol interface or if communication fails, it replies with an abnormal response frame.

[0085] When the control module 20 acts as the sender and the first external terminal 10 acts as the receiver, the sender sends a normal data frame, filling in the command body with the success result or read content of the external device corresponding to the protocol interface. When the receiver receives the normal data frame and the frame format and frame verification are correct, the receiver needs to reply with a normal acknowledgment frame to the sender, indicating that the instruction has been received. The sender stops the retransmission mechanism after receiving the ACK within 100ms. If the receiver receives an abnormal acknowledgment frame, it does not reply.

[0086] For example, the format of a normal response field is:

[0087]

[0088] An abnormal response frame is as follows: When the verification result of the data frame received by the receiver is inconsistent with that of the sender, it indicates that the transmitted frame is abnormal. The receiver needs to send an abnormal response frame to the sender. After receiving the abnormal response frame, the sender can initiate a retransmission mechanism. Retransmission will stop when a normal response frame is received, or if a normal response frame is not received after a limited number of retransmissions, the retransmission mechanism will also stop.

[0089] For example, the format of the exception response field is as follows:

[0090]

[0091] It should be noted that, in terms of practicality: the communication circuit implements bidirectional data pass-through between a universal dual-wire UART serial port and a single-wire serial port. It allows for convenient reading and writing of single-wire serial port device information using commercially available USB-to-TTL serial port tools, such as easily reading and writing data from a 3-contact power bank. This solves the problem of inconvenient debugging of 3-contact power banks, where the 3 contacts are VCC, DATA, and GND.

[0092] In terms of flexibility: the communication circuit implements a universal two-wire UART serial port that can read and write data to I2C and SPI devices, and can also acquire external voltages via ADC. With just the corresponding commands, read and write operations can be performed on different interfaces. This flexibility greatly facilitates the debugging of devices with different protocol interfaces.

[0093] Low cost: The communication circuit consists of simple circuit components, resulting in low overall cost. On one hand, it can be applied to data transmission from an external UART serial port to a single-wire serial port device and to read / write operations on devices with different protocol interfaces. On the other hand, this invention provides a low-cost and feasible modification solution for cabinet units. When a 4-contact cabinet unit and a 3-contact power bank cannot communicate, simply replace the original 4-contact interface with a 3-contact interface, disconnect the original 4-contact interface from the cabinet unit's main control board, connect the power supply and serial port of the original 4-contact interface to the universal UART interface of this invention, and connect the single-wire serial communication interface of this invention to the 3-contact interface. This easily enables communication between the cabinet unit and the 3-contact power bank, significantly reducing the cost of replacing the cabinet unit's motherboard and redeveloping firmware. Similarly, the communication modification between a 3-contact cabinet unit and a 4-contact power bank can also be achieved by integrating this invention.

[0094] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0095] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A communication circuit, characterized in that, The communication circuit includes: a control module and a serial port conversion module; The first input terminal and the first output terminal of the control module are connected to the first external terminal, the second input terminal of the control module is connected to the first terminal of the serial port conversion module, the second output terminal of the control module is connected to the second terminal of the serial port conversion module, and the third terminal of the serial port conversion module is connected to the second external terminal. The control module and serial port conversion module are used to establish communication between the first external terminal and the second external terminal.

2. The communication circuit according to claim 1, characterized in that, The communication circuit also includes: a power supply module; The power module is connected to both the control module and the serial port conversion module, and is used to supply power to the control module and the serial port conversion module.

3. The communication circuit according to claim 2, characterized in that, The serial port conversion module includes: a first serial port conversion circuit and a second serial port conversion circuit; The first terminal of the first serial port conversion circuit is connected to the second output terminal of the control module, and the second terminal of the first serial port conversion circuit is connected to the second external terminal. It is used to receive data from the first external terminal transmitted through the control module and send the data from the first external terminal to the second external terminal. The first end of the second serial port conversion circuit is connected to the second input end of the control module, and the second end of the second serial port conversion circuit is connected to the second external terminal. It is used to receive data transmitted by the second external terminal and send the data transmitted by the second external terminal to the first external terminal through the control module.

4. The communication circuit according to claim 3, characterized in that, The first serial port conversion circuit includes: a first switching device, a first conversion resistor, and a second conversion resistor; The first terminal of the first switching device is connected to the second external terminal and the power module. The second terminal of the first switching device is connected to the first terminal of the first conversion resistor and the first terminal of the second conversion resistor. The second terminal of the first conversion resistor is grounded. The second terminal of the second conversion resistor is connected to the second output terminal of the control module. The third terminal of the first switching device is grounded.

5. The communication circuit according to claim 3, characterized in that, The second serial port conversion circuit includes: a third conversion resistor, a fourth conversion resistor, a fifth conversion resistor, and a second switching device; The first terminal of the second switching device is connected to the second external terminal via the third conversion resistor, the first terminal of the second switching device is grounded via the fourth conversion resistor, the second terminal of the second switching device is connected to the power module via the fifth conversion resistor, the second terminal of the second switching device is connected to the second input terminal of the control module, and the third terminal of the second switching device is grounded.

6. The communication circuit according to claim 1, characterized in that, The communication circuit further includes: a first interface; The first contact point of the first interface is connected to an external power supply. The second contact point of the first interface is connected to the first input terminal of the control module; The third contact point of the first interface is connected to the first output terminal of the control module; The fourth connection point of the first interface is grounded; The control module is connected to the first external terminal through the first interface.

7. The communication circuit according to claim 1, characterized in that, The communication circuit also includes a second interface; The first contact point of the second interface is connected to an external power supply; the second contact point of the second interface is connected to the third terminal of the serial port conversion module; the third contact point of the second interface is grounded. The serial port conversion module is connected to the second external terminal through the second interface.

8. The communication circuit according to claim 2, characterized in that, The communication circuit further includes: a first expansion interface; The first contact point of the first expansion interface is connected to the power module. The second contact point of the first expansion interface is connected to the first expansion terminal of the control module; The third contact point of the first expansion interface is connected to the second expansion terminal of the control module; The fourth connection point of the first expansion interface is grounded; The control module is connected to the first expansion device through the first expansion interface.

9. The communication circuit according to claim 2, characterized in that, The communication circuit further includes: a second expansion interface; The first contact point of the second expansion interface is connected to the power module; The second contact point of the second expansion interface is connected to the third expansion terminal of the control module; The third contact point of the second expansion interface is connected to the fourth expansion terminal of the control module; The fourth contact point of the second expansion interface is connected to the fifth expansion terminal of the control module; The fifth contact point of the second expansion interface is grounded; The control module is connected to the second expansion device through the second expansion interface.

10. The communication circuit according to claim 2, characterized in that, The communication circuit also includes: a third expansion interface; The first contact point of the third expansion interface is connected to the power module. The second contact point of the third expansion interface is connected to the sixth expansion terminal of the control module; The third contact point of the third expansion interface is connected to the seventh expansion terminal of the control module; The fourth contact point of the third expansion interface is connected to the eighth expansion terminal of the control module. The fifth connection point of the third expansion interface is grounded; The control module is connected to the third expansion device through the third expansion interface.