Serial communication module, system, method and electronic equipment
By using a three-state buffer unit in the serial communication module between the portable host device and the external device, the problem of data conflict is solved, the manufacturing cost is reduced, and the priority transmission of device data with higher priority is achieved.
Patent Information
- Application Number
- CN202411013955.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2025-01-24
AI Technical Summary
Data conflicts are easily generated during the communication between the existing portable host device and the external device, resulting in communication failure, and the need for MCU software drivers increases production and manufacturing costs.
Provide a serial communication module, including a three-state buffer unit, through which the communication node is placed at a target level to ensure that when two devices send data to each other at the same time, the communication node voltage related to the data of the device with a higher priority is flat, solving data conflict problems without MCU software driver.
When the communication between the two devices is realized, the higher priority device data is prioritized, avoiding data conflicts and reduced production costs.
Smart Images

Figure CN119357102A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a serial communication module, system, method and electronic device. Background Art
[0002] The transmission conflict problem is solved through software, which increases software development and requires technical support and testing on different platforms. Existing portable host devices, such as mobile phones and tablets, need to be connected to some external devices, such as keyboards, mice, projectors, etc., during daily operation or office or study. However, the communication protocols and the number of communication cables between the host device and the external device may be different. In order to adapt to various devices, a high manufacturing cost is required, and data conflicts are prone to occur during the communication process. For example, when the computer communicates with the keyboard, it cannot be guaranteed that the computer's information has a higher priority. When the computer sends update data to the keyboard, an accidental touch of the keyboard will cause a data conflict, which will lead to the failure of the update.
[0003] In the related art, in order to solve the above problems, MCU (Microcontroller Unit) driver software is usually used to solve the data transmission conflict problem. At the same time, technical support and testing of different platforms are also required, which undoubtedly increases the software development cost. Summary of the invention
[0004] Based on this, it is necessary to provide a serial communication module, system, method and electronic device to address the above technical problems.
[0005] The present disclosure provides a serial communication module, including a three-state buffer unit located in a first electronic device; the first electronic device includes a first signal transmitting end and a first signal receiving end, the first signal transmitting end is used to transmit a first data signal to a second electronic device, and the first signal receiving end is used to receive a second data signal transmitted by the second electronic device; the second electronic device includes a second signal transmitting end and a second signal receiving end, the second signal transmitting end is used to transmit the second data signal to the first electronic device, and the second signal receiving end is used to receive the first data signal transmitted by the first electronic device; the first signal transmitting end is connected to a first communication node through the three-state buffer unit and the first signal receiving end, and the first communication node is also used to connect to the second signal transmitting end and the second signal receiving end; the three-state buffer unit is used to: in response to the first electronic device transmitting the first data signal to the second electronic device and the second electronic device transmitting the second data signal to the first electronic device, the first communication node is placed at a target level according to the first data signal.
[0006] Optionally, the three-state buffer unit includes a three-state input terminal, a three-state output terminal and a three-state enable terminal; the three-state input terminal is used to receive the first data signal sent by the first signal sending terminal to the second electronic device, the three-state output terminal and the first signal receiving terminal are connected to the first communication node, and the three-state enable terminal is used to receive a first enable signal or a second enable signal; the three-state buffer unit is specifically used to: in response to the three-state enable terminal receiving the first enable signal, place the first communication node at the target level according to the first data signal; or, in response to the three-state enable terminal receiving the second enable signal, place the three-state output terminal in a high-impedance state.
[0007] Optionally, the three-state buffer unit is specifically used to: in response to the three-state enable end receiving the first enable signal and the level of the first data signal being the first level, place the first communication node at a third level; or, in response to the three-state enable end receiving the first enable signal and the level of the first data signal being the second level, place the first communication node at a fourth level, wherein the first level is higher than the second level, and the third level is higher than the fourth level.
[0008] Optionally, the serial communication module also includes a first level conversion unit located in the first electronic device; the first level conversion unit includes a first end, a second end and a control end, the first end of the first level conversion unit is used to receive the first data signal sent by the first signal sending end to the second electronic device, the second end of the first level conversion unit is connected to the three-state input end of the three-state buffer unit, and the first level conversion unit is used to control the conduction or cutoff between the first end and the second end according to the level difference between the first end and the control end; the three-state input end of the three-state buffer unit also receives a first pull-up signal, and the level of the first pull-up signal is a fifth level; the first level conversion unit is specifically used to: in response to the first data signal being a first level, control the cutoff between the first end and the second end; or, in response to the first data signal being a second level, control the conduction between the first end and the second end, wherein the first level and the fifth level are both higher than the second level.
[0009] Optionally, the serial communication module also includes a second level conversion unit located in the first electronic device; the second level conversion unit includes a first end, a second end and a control end, the first end of the second level conversion unit is connected to the first signal receiving end, the second end of the second level conversion unit is used to receive the second data signal sent by the second electronic device to the first electronic device, and the second level conversion unit is used to control the connection or disconnection between the first end and the second end according to the level difference between the second end and the control end; the first signal receiving end also receives a second pull-up signal, and the level of the second pull-up signal is a sixth level; the second level conversion unit is specifically used to: in response to the second data signal being a seventh level, control the disconnection between the first end and the second end; or, in response to the second data signal being an eighth level, control the connection between the first end and the second end, wherein the seventh level and the sixth level are both higher than the eighth level.
[0010] Optionally, the serial communication module also includes a third level conversion unit located in the first electronic device; the third level conversion unit includes a first end, a second end and a control end, the first end of the third level conversion unit is used to receive a first initial enable signal or a second initial enable signal, the second end of the third level conversion unit is connected to the three-state enable end of the three-state buffer unit, and the third level conversion unit is used to control the conduction or cutoff between the first end and the second end according to the level difference between the first end and the control end; the third level conversion unit is specifically used to: in response to the first end receiving the first initial enable signal, control the cutoff between the first end and the second end; or, in response to the first end receiving the second initial enable signal, control the conduction between the first end and the second end.
[0011] Optionally, the serial communication module also includes a first resistor and a second resistor located in the second electronic device; the first end of the first resistor is connected to the second signal sending end, the first end of the second resistor is connected to the second signal receiving end, and the resistance of the first resistor is greater than that of the second resistor; the second end of the first resistor and the second end of the second resistor are connected to a second communication node, and the second communication node is used to connect to the first communication node.
[0012] Based on the same inventive concept. The present disclosure also provides a serial communication method, which is applied to the serial communication module, and the method includes: in response to the first electronic device sending the first data signal to the second electronic device, and the second electronic device sending the second data signal to the first electronic device, using the tri-state buffer unit to set the first communication node to the target level according to the first data signal.
[0013] Based on the same inventive concept, the present disclosure also provides an electronic device, which is the first electronic device or the second electronic device.
[0014] Based on the same inventive concept, the present disclosure also provides a serial communication system, comprising the first electronic device and a second electronic device.
[0015] Compared with the prior art, the technical solution provided by the present invention has the following advantages:
[0016] The serial communication module provided by the present disclosure enables two devices to communicate through one node, and ensures that when two devices send data to each other at the same time, one of the devices has a higher priority, that is, the level of the communication node is related to the data sent by the device with a higher priority, which solves the problem of data conflict during the communication process. In addition, the serial communication module provided by the present disclosure does not require MCU software drive, saving the production cost of the device.
[0017] The serial communication method provided by the present disclosure enables two devices to communicate through a node, and through simple signal instructions, ensures that when two devices send data to each other at the same time, one of the devices has a higher priority, that is, the level of the communication node is related to the data sent by the device with a higher priority, solving the problem of data conflict during the communication process. In addition, the serial communication method provided by the present disclosure does not require MCU software driver execution, saving the production cost of the device.
[0018] The electronic device provided by the present disclosure can communicate with another device through a node, and ensures that when two devices send data to each other at the same time, one of the devices has a higher priority, that is, the level of the communication node is related to the data sent by the device with a higher priority, which solves the problem of data conflict during the communication process. In addition, the electronic device provided by the present disclosure does not require MCU software drive, saving the production cost of the device.
[0019] The serial communication system provided by the present disclosure enables two devices to communicate through one node, and ensures that when two devices send data to each other at the same time, one of the devices has a higher priority, that is, the level of the communication node is related to the data sent by the device with a higher priority, which solves the problem of data conflict during the communication process. In addition, the serial communication system provided by the present disclosure does not require MCU software drive, saving the production cost of the device. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0022] Figure 1 A schematic diagram of the structure of a serial communication module provided in an embodiment of the present disclosure;
[0023] Figure 2 A schematic diagram of the structure of another serial communication module provided in an embodiment of the present disclosure;
[0024] Figure 3 A schematic diagram of the structure of another serial communication module provided in an embodiment of the present disclosure;
[0025] Figure 4 A signal timing diagram of a serial communication module provided by an embodiment of the present disclosure when it is working;
[0026] Figure 5 A signal timing diagram of another serial communication module provided by an embodiment of the present disclosure when it is working;
[0027] Figure 6 A signal timing diagram of another serial communication module provided by an embodiment of the present disclosure when it is working;
[0028] Figure 7 A signal timing diagram of another serial communication module provided by an embodiment of the present disclosure when it is working;
[0029] Figure 8 A schematic diagram of the structure of another serial communication module provided in an embodiment of the present disclosure;
[0030] Fig. 9 A schematic diagram of the structure of another serial communication module provided in an embodiment of the present disclosure;
[0031] Fig.10 A schematic diagram of the structure of another serial communication module provided in an embodiment of the present disclosure;
[0032] Fig.11 A schematic diagram of the structure of another serial communication module provided in an embodiment of the present disclosure;
[0033] Fig.12 A schematic diagram of a partial circuit principle of a serial communication module provided by an embodiment of the present disclosure;
[0034] Fig.13 A flowchart of a serial communication method provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] In order to more clearly understand the above-mentioned purposes, features and advantages of the embodiments of the present disclosure, the scheme of the embodiments of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other without conflict.
[0036] In the following description, many specific details are set forth to facilitate a full understanding of the embodiments of the present disclosure, but the embodiments of the present disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0037] Serial communication is a data transmission method in which data is transmitted in bits, instead of transmitting multiple bits at the same time in bytes or larger blocks as in parallel communication. Serial communication requires only a small number of transmission lines, reducing cost and complexity. However, when devices send data simultaneously through a small number of transmission lines, data conflicts will arise.
[0038] In view of this, an embodiment of the present disclosure provides a serial communication module, such as Figure 1 As shown, the three-state buffer unit U1 is located in the first electronic device 10.
[0039] The first electronic device 10 includes a first signal transmitting terminal AP_TX and a first signal receiving terminal AP_RX. The first signal transmitting terminal AP_TX is used to transmit a first data signal to the second electronic device 20, and the first signal receiving terminal AP_RX is used to receive a second data signal transmitted by the second electronic device 20.
[0040] Specifically, the first electronic device 10 is composed of a plurality of electronic modules, and the plurality of electronic modules jointly perform data processing, data reception, and data transmission. The first signal transmitting terminal AP_TX and the first signal receiving terminal AP_RX may be ports of an electronic module for transmitting / receiving data inside the first electronic device 10, rather than ports for the first electronic device 10 to directly communicate with other devices. The second electronic device 20, the second signal transmitting terminal KP_TX, and the second signal receiving terminal KP_RX described below are similar, and will not be described in detail.
[0041] The second electronic device 20 includes a second signal transmitting terminal KP_TX and a second signal receiving terminal KP_RX. The second signal transmitting terminal KP_TX is used to transmit a second data signal to the first electronic device 10 , and the second signal receiving terminal KP_RX is used to receive a first data signal transmitted by the first electronic device 10 .
[0042] It can be understood that the above-mentioned first data signal and second data signal are only used to distinguish whether the data signal is sent by the first electronic device 10 or the second electronic device 20, and it is not limited to that the data contained in the first data signal and the second data signal must be different, nor is it limited to that the signal sent by the first electronic device 10 or the second electronic device 20 always contains the same data. The following embodiments of the present disclosure are similar and will not be repeated.
[0043] The first signal transmitting end AP_TX is connected to the first communication node N1 through the tri-state buffer unit U1 and the first signal receiving end AP_RX. The first communication node N1 is also used to connect to the second signal transmitting end KP_TX and the second signal receiving end KP_RX.
[0044] In a specific embodiment, Figure 1 As shown, the second signal transmitting terminal KP_TX and the second signal receiving terminal KP_RX are connected to the second communication node N2 in the second electronic device 20, and the three-state output terminal Y and the first signal receiving terminal AP_RX are connected to the first communication node N1 in the first electronic device 10. After the first communication node N1 in the first electronic device 10 and the second communication node N2 in the second electronic device 20 are electrically connected to the cable through the device interface POGO, they are equivalent to the same communication node, thereby realizing the connection between the first communication node N1 and the second signal transmitting terminal KP_TX and the second signal receiving terminal KP_RX.
[0045] The above-mentioned three-state buffer unit U1 is used for:
[0046] In response to the first electronic device 10 sending the first data signal to the second electronic device 20 and the second electronic device 20 sending the second data signal to the first electronic device 10, the first communication node N1 is placed at a target level according to the first data signal.
[0047] Specifically, after the three-state buffer unit U1 places the first communication node N1 at the target level, no matter what kind of second data signal the second electronic device 20 sends to the first electronic device 10, it will not affect the level of the first communication node N1. Furthermore, the level of the second signal receiving terminal KP_RX of the second electronic device 20 is always the level of the first communication node N1, which is equivalent to the second signal receiving terminal KP_RX receiving the first data signal sent by the first electronic device 10 to the second electronic device 20, and at the same time will not be affected by the second data signal sent by the second electronic device 20 to the first electronic device 10, thereby achieving that the message priority of the first electronic device 10 is higher than that of the second electronic device 20.
[0048] The serial communication module provided by the embodiment of the present disclosure enables two devices to communicate through one node, and ensures that when two devices send data to each other at the same time, one of the devices has a higher priority, that is, the level of the communication node is related to the data sent by the device with a higher priority, which solves the problem of data conflict during the communication process. In addition, the serial communication module provided by the present disclosure does not require MCU software drive, saving the production cost of the device.
[0049] In a specific implementation, the first electronic device 10 may be a host device, such as a mobile phone, a computer, a tablet computer, etc.; the second electronic device 20 may be an external device, such as a keyboard, a mouse, a projector, etc.
[0050] In a specific embodiment, the first electronic device 10 is a tablet computer, and the second electronic device 20 is a keyboard. When the tablet computer and the keyboard send data at the same time, the serial communication module in the above embodiment can ensure that the message priority of the tablet computer is higher. When the tablet computer sends data information related to the update and upgrade to the keyboard, even if the keyboard key is accidentally touched, the update and upgrade process will not be affected.
[0051] In the related art, Bluetooth communication can also be used between the host device and the external device, but Bluetooth wireless communication is easily interfered, and the external device needs to be powered separately (extra charging or battery replacement), which reduces the user experience.
[0052] In view of this, in some embodiments, Figure 2 As shown, the first electronic device 10 and the second electronic device 20 can be connected and communicated by wire, and the first electronic device 10 can supply power to the second electronic device through the cable (in Figure 2 In the illustrated embodiment, the power supply of the first electronic device 10 is VCC1, the power supply terminal of the second electronic device is VCC2), and the lines for power supply and the lines for communication between the first electronic device 10 and the second electronic device 20 can share the same device interface POGO.
[0053] In a specific embodiment, the first electronic device 10 and the second electronic device 20 are connected and communicated through a POGO interface and a cable. The POGO interface is also called a Pogo Pin interface, and its official name is "Spring Loaded Contact". The POGO interface contains a precise spring structure, which is composed of three basic components: a needle shaft, a spring, and a needle tube. This design allows the needle to maintain stable electrical contact when compressed, and maintains the reliability of the connection even when subjected to slight physical shocks or vibrations. The design of the metal probe ensures stable electrical contact, is not easily affected by friction or looseness, and maintains good conductivity even after multiple plugging and unplugging.
[0054] Specifically, the first electronic device 10 and the second electronic device 20 may be connected via a 3-wire POGO interface, which specifically includes a line for serial communication, a power line, and a ground line.
[0055] In specific implementation, the above serial communication module can be an asynchronous serial communication module, that is, there is no shared clock signal between data bits, and the boundary of the data frame is defined by the start bit and stop bit. Each data packet usually includes a start bit, data bits, an optional parity bit and a stop bit.
[0056] In specific implementation, the above serial communication module can be based on the UART (Universal Asynchronous Receiver / Transmitter) communication protocol. As long as the communicating parties use the same frame format and baud rate, they can complete the communication process with only two signal lines (RX and TX) without sharing the clock signal, that is, the first signal transmitting end AP_TX and the first signal receiving end AP_RX, and the second signal transmitting end KP_TX and the second signal receiving end KP_RX.
[0057] In some embodiments, Figure 3 As shown, the three-state buffer unit U1 includes a three-state input terminal A, a three-state output terminal Y and a three-state enable terminal OE, the three-state input terminal A is used to receive the first data signal sent by the first signal transmitting terminal AP_TX to the second electronic device 20; the three-state output terminal Y and the first signal receiving terminal AP_RX are connected to the first communication node N1; the three-state enable terminal OE is used to receive the first enable signal or the second enable signal. Specifically, as Figure 3 As shown, the first electronic device 10 further includes an enable signal sending terminal GPIO_TX, and the enable signal sending terminal GPIO_TX is used to send a first enable signal or a second enable signal to the tri-state enable terminal OE.
[0058] The tri-state buffer unit U1 is specifically used for:
[0059] In response to the tri-state enable terminal OE receiving the first enable signal, the first communication node N1 is set to the target level according to the first data signal; or, in response to the tri-state enable terminal OE receiving the second enable signal, the tri-state output terminal Y is set to a high impedance state.
[0060] High Impedance State, abbreviated as Z. High Impedance State is not a simple on or off state, but a special non-conductive state characterized by very high input or output impedance. When the output of a circuit module is in a high impedance state, it means that the output will not drive the lower signal line, neither pull up nor pull down the potential of the lower signal line, and has no effect or interference on the lower circuit.
[0061] When the three-state output terminal Y is placed in a high impedance state, the first data signal sent by the first electronic device 10 to the second electronic device 20 will not reach the first communication node N1, which is equivalent to blocking the communication from the first electronic device 10 to the second electronic device 20. However, the second data signal sent by the second electronic device 20 to the first electronic device 10 can reach the first communication node N1 and will not be affected by the first data signal, thereby achieving communication from the second electronic device 20 to the first electronic device 10.
[0062] In a specific embodiment, in response to the first electronic device 10 needing to send a first data signal to the second electronic device 20, the three-state enable end OE of the three-state buffer unit U1 will receive the above-mentioned first enable signal; in response to the first electronic device 10 not needing to send the first data signal to the second electronic device 20, the three-state enable end OE of the three-state buffer unit U1 will receive the above-mentioned second enable signal, thereby realizing two-way communication between the first electronic device 10 and the second electronic device 20, and the first electronic device has a higher message priority.
[0063] The above-mentioned three-state buffer unit U1 can adopt a three-state buffer chip or other controllable logic switches. Those skilled in the art can select different hardware implementations based on relevant technologies and according to different application scenarios, and no further limitations are given here.
[0064] In some embodiments, the tri-state buffer unit U1 is specifically used for:
[0065] In response to the three-state enable terminal OE receiving the first enable signal and the level of the first data signal being the first level, the first communication node N1 is placed at the third level; or, in response to the three-state enable terminal OE receiving the first enable signal and the level of the first data signal being the second level, the first communication node N1 is placed at the fourth level, wherein the first level is higher than the second level, and the third level is higher than the fourth level.
[0066] The first level and the third level can be regarded as a higher level, while the second level and the fourth level can be regarded as a lower level. The working logic of the three-state buffer unit U1 is that when the three-state enable terminal OE receives a high-level signal (i.e., the first enable signal), the three-state input terminal A inputs a high level, and the three-state output terminal Y outputs a high level, and the three-state input terminal A inputs a low level, and the three-state output terminal Y outputs a low level; when the three-state enable terminal OE receives a low-level signal (i.e., the second enable signal), then no matter whether the three-state input terminal A inputs a high level or a low level, the three-state output terminal Y outputs a high impedance state.
[0067] Specifically, the three-state buffer unit U1 is also connected to the power supply VCC and the ground terminal GND. The three-state output terminal Y outputs a high level as a power signal and a low level as a ground signal. Therefore, even if the second electronic device 20 sends a second data signal to the first communication node N1, the potential of the first communication node N1 will not change.
[0068] In a specific embodiment, when the first electronic device 10 sends a first data signal to the second electronic device 20, and the second electronic device 20 sends a second data signal to the first electronic device 10, the timing diagram of the first data signal DATA_AP, the second data signal DATA_KP, and the signal DATA_N1 received at the first communication node N1 is as shown in FIG. Figure 4 and Figure 5 As shown, Figure 5 for Figure 4 A partial enlarged view of .
[0069] like Figure 4 and Figure 5 As shown, when the first electronic device 10 needs to send a first data signal to the second electronic device 20, the tri-state enable terminal OE always receives a high-level enable signal TX_EN (ie, the above-mentioned first enable signal).
[0070] When the first data signal DATA_AP outputs a high level and the second data signal DATA_KP outputs a high level, DATA_N1 is set to a high level by the three-state buffer unit U1, and then the second signal receiving terminal KP_RX of the second electronic device 20 receives the high level.
[0071] When the first data signal DATA_AP outputs a high level and the second data signal DATA_KP outputs a low level, DATA_N1 is still set to a high level by the three-state buffer unit U1, and then the second signal receiving terminal KP_RX of the second electronic device 20 receives the high level.
[0072] When the first data signal DATA_AP outputs a low level and the second data signal DATA_KP outputs a high level, DATA_N1 is set to a low level by the tri-state buffer unit U1 , and then the second signal receiving terminal KP_RX of the second electronic device 20 receives the low level.
[0073] When the first data signal DATA_AP outputs a low level and the second data signal DATA_KP outputs a low level, DATA_N1 is still set to a low level by the three-state buffer unit U1, and then the second signal receiving terminal KP_RX of the second electronic device 20 receives the low level.
[0074] In a specific embodiment, when only the first electronic device 10 sends the first data signal to the second electronic device 20, the timing diagram of the first data signal DATA_AP, the signal DATA_N1 received at the first communication node N1, and the signal DATA_KP_RX received at the second signal receiving terminal KP_RX of the second electronic device 20 is as shown in FIG. Figure 6 shown.
[0075] like Figure 6 As shown, when the first electronic device 10 needs to send a first data signal to the second electronic device 20, the tri-state enable terminal OE always receives a high-level enable signal TX_EN (ie, the above-mentioned first enable signal).
[0076] When the first data signal DATA_AP outputs a high level, DATA_N1 is set to a high level by the three-state buffer unit U1, and then the second signal receiving terminal KP_RX of the second electronic device 20 receives the high level.
[0077] When the first data signal DATA_AP outputs a low level, DATA_N1 is set to a low level by the three-state buffer unit U1, and then the second signal receiving terminal KP_RX of the second electronic device 20 receives the low level.
[0078] In a specific embodiment, when only the second electronic device 20 sends the second data signal to the first electronic device 10, the timing diagram of the second data signal DATA_KP, the signal DATA_N1 received at the first communication node N1, the signal DATA_AP_RX received by the first signal receiving terminal AP_RX of the first electronic device 10, and the signal DATA_AP_TX received by the first signal transmitting terminal AP_TX of the first electronic device 10 is as shown in FIG. Figure 7 shown.
[0079] When the first electronic device 10 does not need to send the first data signal to the second electronic device 20, the tri-state enable terminal OE always receives the low-level enable signal TX_EN (ie, the second enable signal), and the tri-state output terminal Y of the tri-state buffer unit U1 outputs a high impedance state.
[0080] When the second data signal DATA_KP outputs a high level, DATA_N1 is also a high level, and then the first signal receiving terminal AP_RX of the first electronic device 10 receives a high level, and the first signal transmitting terminal AP_TX does not receive any signal.
[0081] When the second data signal DATA_KP outputs a low level, DATA_N1 is also a low level, and then the first signal receiving terminal AP_RX of the first electronic device 10 receives a low level, and the first signal transmitting terminal AP_TX does not receive any signal.
[0082] It is understandable that the high level and the low level in the above embodiments need to be set according to the parameters of the device actually used. For example, for a certain tri-state buffer, a 1.8V signal input to its tri-state input terminal can make its tri-state output terminal output a high level, but for another tri-state buffer, a 2.8V signal input to its tri-state input terminal can make its tri-state output terminal output a high level. In addition, for a certain tri-state buffer, its internally connected power supply is 3.3V, and the high level output by its tri-state output terminal is 3.3V, but for another tri-state buffer, its internally connected power supply is 5V, and the high level output by its tri-state output terminal is 5V. The other contents related to the high level and the low level in the embodiments of the present disclosure are similar and will not be repeated.
[0083] In some embodiments, the power supply levels required by the first electronic device 10 and the second electronic device 20 may be different. The related technology usually sets an MCU to perform level conversion. In order to save production costs, an embodiment of the present disclosure provides a level conversion unit.
[0084] like Figure 8 As shown, the serial communication module provided by the embodiment of the present disclosure further includes a first level conversion unit Q1 located in the first electronic device 10 .
[0085] The first level conversion unit Q1 includes a first end 1, a second end 2 and a control end 3. The first end 1 of the first level conversion unit Q1 is used to receive a first data signal sent by the first signal sending end AP_TX to the second electronic device 20. The second end 2 of the first level conversion unit Q1 is connected to the three-state input end A of the three-state buffer unit U1. The first level conversion unit Q1 is used to control the conduction or cutoff between the first end 1 and the second end 2 according to the level difference between the first end 1 and the control end 3.
[0086] The tri-state input terminal A of the tri-state buffer unit U1 also receives the first pull-up signal V1 , and the level of the first pull-up signal V1 is the fifth level. Specifically, the fifth level is the power supply level required by the second electronic device 20 .
[0087] The first level conversion unit Q1 is specifically used for:
[0088] In response to the first data signal being at the first level (the first level can be regarded as a higher level), the first terminal 1 and the second terminal 2 are controlled to be cut off. At this time, the three-state input terminal A of the three-state buffer unit U1 receives the first pull-up signal V1 of the fifth level through the pull-up resistor, thereby completing the conversion from the first level to the fifth level; or, in response to the first data signal being at the second level (the second level can be regarded as a lower level), the first terminal 1 and the second terminal 2 are controlled to be turned on, the level difference between the first terminal 1 and the second terminal 2 is zero, and the three-state input terminal A of the three-state buffer unit U1 receives a low level signal, and the first level and the fifth level are both higher than the second level.
[0089] In a specific embodiment, Figure 8 As shown, the first level conversion unit Q1 is a MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor), the first terminal 1 is the source s, the second terminal 2 is the drain d, the control terminal 3 is the gate g, the power supply level required by the first electronic device 10 is 1.8V, and the power supply level required by the second electronic device 20 is 3.3V. The gate g of the first level conversion unit Q1 is connected to the power supply VIO18 of the first electronic device 10, that is, 1.8V, and the tri-state input terminal A of the tri-state buffer unit U1 receives the first pull-up signal V1 of 3.3V.
[0090] When the first data signal is at a low level (i.e., the second level mentioned above), Vgs of Q1 = 1.8V, MOSFET is turned on, Vds of Q1 = 0, and the tri-state input terminal A of the tri-state buffer unit U1 receives a low level signal. When the first data signal is at a high level (i.e., the first level mentioned above), Vgs of Q1 = 0V, MOSFET is turned off, and the tri-state input terminal A of the tri-state buffer unit U1 receives the first pull-up signal V1 of 3.3V.
[0091] The above embodiment uses hardware to complete the level conversion when the power supply levels of two devices are inconsistent. Compared with the related art that adds an MCU and develops software, it saves production costs.
[0092] like Fig. 9 As shown, the serial communication module provided by the embodiment of the present disclosure further includes a second level conversion unit Q2 located in the first electronic device 10 .
[0093] The second level conversion unit Q2 includes a first end 1, a second end 2 and a control end 3. The first end 1 of the second level conversion unit Q2 is connected to the first signal receiving end AP_RX. The second end 2 of the second level conversion unit Q2 is used to receive a second data signal sent by the second electronic device 20 to the first electronic device 10. The second level conversion unit Q2 is used to control the conduction or cutoff between the first end 1 and the second end 2 according to the level difference between the second end 2 and the control end 3.
[0094] The first signal receiving terminal AP_RX also receives a second pull-up signal V2, and the second pull-up signal V2 is at a sixth level. Specifically, the sixth level is a power supply level required by the first electronic device 10.
[0095] The second level conversion unit Q2 is specifically used for:
[0096] In response to the second data signal being the seventh level (the seventh level can be regarded as a higher level), the first terminal 1 and the second terminal 2 are controlled to be cut off. At this time, the first signal receiving terminal AP_RX receives the second pull-up signal V2 of the sixth level, thereby completing the conversion from the seventh level to the sixth level; or, in response to the second data signal being the eighth level (the eighth level can be regarded as a lower level), the first terminal 1 and the second terminal 2 are controlled to be turned on, the level difference between the first terminal 1 and the second terminal 2 is zero, and the first signal receiving terminal AP_RX receives a low level signal, wherein the seventh level and the sixth level are higher than the eighth level.
[0097] In a specific embodiment, Fig. 9 As shown, the second level conversion unit Q2 is a MOSFET including a body diode, the first terminal 1 is a source s, the second terminal 2 is a drain d, the control terminal 3 is a gate g, the power supply level required by the first electronic device 10 is 1.8V, and the power supply level required by the second electronic device 20 is 3.3V. The gate g of the second level conversion unit Q2 is connected to the power supply of the first electronic device 10, that is, 1.8V, and the first signal receiving terminal AP_RX receives the second pull-up signal V2 of 1.8V.
[0098] When the second data signal is at a low level (i.e., the eighth level mentioned above), the source s and the drain d of the second level conversion unit Q2 are turned on through the body diode inside the MOSFET, Vgs of Q2 = 1.8V, the MOSFET is turned on, Vds of Q2 = 0, and the first signal receiving terminal AP_RX receives a low level signal. When the second data signal is at a high level (i.e., the seventh level mentioned above), the body diode backflow prevention inside the MOSFET is turned off, and since the first signal receiving terminal AP_RX and the source s of Q2 receive the second pull-up signal V2 of 1.8V together, Vgs of Q2 = 0V, the MOSFET is turned off, and the first signal receiving terminal AP_RX receives the second pull-up signal V2 of 1.8V.
[0099] exist Figure 3 In the illustrated embodiment, the first enable signal or the second enable signal received by the tri-state enable terminal OE of the tri-state buffer unit U1 can be directly provided by the first electronic device 10. However, when the first electronic device 10 cannot provide the enable signal required by the tri-state enable terminal OE (for example, the level input to the tri-state enable terminal OE is considered to be a high level input only when it is greater than 3V, but the power supply voltage of the first electronic device 10 is only 1.8V), a level conversion unit can be added.
[0100] like Fig.10 As shown, the serial communication module provided by the embodiment of the present disclosure further includes a third level conversion unit Q3 located in the first electronic device 10 .
[0101] The third level conversion unit Q3 includes a first end 1, a second end 2 and a control end 3. The first end 1 of the third level conversion unit Q3 is used to receive a first initial enable signal or a second initial enable signal. The second end 2 of the third level conversion unit Q3 is connected to the three-state enable end OE of the three-state buffer unit U1. The third level conversion unit Q3 is used to control the conduction or cutoff between the first end 1 and the second end 2 according to the level difference between the first end 1 and the control end 3.
[0102] The tri-state enable terminal OE of the tri-state buffer unit U1 is used to receive a first enable signal and a second enable signal.
[0103] The third level conversion unit Q3 is specifically used for:
[0104] In response to the first terminal 1 receiving the first initial enable signal (the level of the first initial enable signal can be regarded as a higher level, but its level is lower than the first enable signal), the first terminal 1 and the second terminal 2 are controlled to be cut off, and the power supply voltage V3 pulls up the level at the three-state enable terminal OE of the three-state buffer unit U1, and converts the above-mentioned first initial enable signal into the above-mentioned first enable signal (that is, a signal that meets the requirements of the three-state buffer unit U1); or, in response to the first terminal 1 receiving the second initial enable signal (the level of the second enable signal can be regarded as a lower level), the first terminal 1 and the second terminal 2 are controlled to be connected, and at this time, the second initial enable signal can reach the three-state enable terminal OE of the three-state buffer unit U1 through the third level conversion unit Q3, and is provided to the three-state enable terminal OE as the second enable signal.
[0105] In some embodiments, Fig.11 As shown, the serial communication module provided in the embodiment of the present disclosure further includes a first resistor RA and a second resistor RB located in the second electronic device 20;
[0106] The first end of the first resistor RA is connected to the second signal transmitting end KP_TX, the first end of the second resistor RB is connected to the second signal receiving end KP_RX, and the resistance of the first resistor RA is greater than that of the second resistor RB. In a specific embodiment, the resistance of the first resistor RA is 500Ω to 1500Ω, preferably 1000Ω, and the resistance of the second resistor RB is 1Ω to 20Ω, preferably 10Ω.
[0107] The second end of the first resistor RA and the second end of the second resistor RB are connected to the second communication node N2, and the second communication node N2 is used to connect to the first communication node N1. After the first communication node N1 in the first electronic device 10 and the second communication node N2 in the second electronic device 20 are electrically connected to the cable through the device interface POGO, they are equivalent to the same communication node.
[0108] In a specific embodiment, when the first electronic device 10 sends a first data signal to the second electronic device 20 and the second electronic device 20 sends a second data signal to the first electronic device 10, when the first data signal DATA_AP outputs a high level and the second data signal DATA_KP outputs a low level, the three-state output terminal Y of the three-state buffer unit U1 outputs a high level, and the signal DATA_N1 received at the first communication node N1 is pulled up to a high level by the three-state buffer unit U1 and the first resistor RA, and then the second signal receiving terminal KP_RX of the second electronic device 20 receives the high level.
[0109] When the first data signal DATA_AP outputs a low level and the second data signal DATA_KP outputs a high level, the three-state output terminal Y of the three-state buffer unit U1 outputs a low level, and the signal DATA_N1 received at the first communication node N1 is pulled down to a low level by the three-state buffer unit U1 and the first resistor RA, and then the second signal receiving terminal KP_RX of the second electronic device 20 receives the low level.
[0110] Fig.12 A circuit schematic diagram of a partial serial communication module located in a first electronic device 10 provided by an embodiment of the present disclosure is shown. The first electronic device includes an enable signal sending terminal GPIO_TX, a first signal sending terminal AP_TX, a first signal receiving terminal AP_RX, and a trigger signal receiving terminal INT. Among them, the enable signal sending terminal GPIO_TX includes two ports GPIO_TX1 and GPIO_TX2 that can receive different levels, and the trigger signal receiving terminal INT is used to trigger a communication interrupt when the first signal receiving terminal AP_RX receives a data signal. VIO18 is a 1.8V power supply for the first electronic device 10, and MCU3V3 is a 3.3V power supply for the second electronic device 20.
[0111] The serial communication module mainly includes the above-mentioned three-state buffer unit U1, the first level conversion unit Q1, the second level conversion unit Q2 and the third level conversion unit Q3 (JP7704 connected to the drain d of the first level conversion unit Q1 is a short-circuit symbol reserved for debugging in the disclosed embodiment, which can be regarded as a 0Ω resistor). The functions and connection methods of each unit can refer to the above-mentioned embodiments and will not be repeated here. In addition, the serial communication module also includes R7730, R7722, R7724, R7720, R7731, R7725, R7726, R7727, R7728, R7705, R7706, R7715, R7729, R7717 multiple resistors, and C7702 capacitor. Among them, C7702 capacitor is a decoupling capacitor to prevent noise interference. R7720 is a compatible design resistor for the third level conversion unit Q3. When the enable signal provided to the three-state buffer unit U1 does not need to be converted, the direct signal can pass through the R7720 resistor. R7722, R7726, R7727, R7715, and R7717 are pull-up resistors. R7724 is a pull-down resistor to avoid instability of the signal at the enable signal transmitter GPIO_TX during the power-on initialization process. R7730, R7725, and R7728 are current-limiting anti-interference resistors to avoid abnormal damage to the three-state buffer unit U1 on the communication line, while limiting the current to reduce circuit power consumption. R7705 and R7706 are 0Ω resistors used in the debugging phase and can be removed during specific implementation. R7729 is a current-limiting protection resistor to prevent the first communication node N1 from generating abnormal signals that damage the device.
[0112] Based on the same inventive concept, corresponding to the serial communication module in any of the above embodiments, the present application also provides a serial communication method, such as Fig.13 As shown, this includes:
[0113] In response to the first electronic device 10 sending a first data signal to the second electronic device 20 and the second electronic device 20 sending a second data signal to the first electronic device 10, S1 is executed: using the tri-state buffer unit U1 to set the first communication node N1 to a target level according to the first data signal.
[0114] The method provided by the embodiment of the present disclosure enables two devices to communicate through a node, and through simple signal instructions, ensures that when two devices send data to each other at the same time, one of the devices has a higher priority, that is, the level of the communication node is related to the data sent by the device with a higher priority, solving the problem of data conflict during the communication process. In addition, the serial communication module provided by the present disclosure does not require MCU software drive, saving the production cost of the device.
[0115] based on Figure 3 The serial communication module shown, the above method specifically includes:
[0116] A first enable signal is sent to the tri-state enable terminal OE of the tri-state buffer unit U1, and the first electronic device 10 sends a first data signal to the second electronic device 20; or, a second enable signal is sent to the tri-state enable terminal OE of the tri-state buffer unit U1, and the second electronic device 20 sends a second data signal to the first electronic device 10.
[0117] In some embodiments, the above method package specifically includes:
[0118] In response to the first electronic device 10 needing to send a first data signal to the second electronic device 20, a first enable signal is sent to the three-state enable terminal OE of the three-state buffer unit U1, and the first electronic device 10 sends the first data signal to the second electronic device 20; or, in response to the first electronic device 10 not needing to send the first data signal to the second electronic device 20, a second enable signal is sent to the three-state enable terminal OE of the three-state buffer unit U1, and the second electronic device 20 sends the second data signal to the first electronic device 10.
[0119] It should be understood that although Fig.13 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Fig.13 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0120] The method of the above-mentioned embodiment of the present disclosure is applied to the serial communication module provided in the above-mentioned embodiment and has corresponding technical effects, which will not be elaborated here.
[0121] Based on the same inventive concept, corresponding to the serial communication module in any of the above embodiments, an embodiment of the present disclosure further provides an electronic device, which may be the first electronic device or the second electronic device in the above embodiments.
[0122] The electronic device provided by the embodiment of the present disclosure can communicate with another device through a node, and ensure that when two devices send data to each other at the same time, one of the devices has a higher priority, that is, the level of the communication node is related to the data sent by the device with a higher priority, which solves the problem of data conflict during the communication process. In addition, the electronic device provided by the present disclosure does not require MCU software drive, saving the production cost of the device.
[0123] In some embodiments, corresponding to any of the above-mentioned serial communication methods, the first electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps in the above-mentioned serial communication method embodiments when executing the computer program.
[0124] Based on the same inventive concept, corresponding to the serial communication module in any of the above embodiments, the disclosed embodiment further provides a serial communication system, including the first electronic device and the second electronic device in the above embodiments.
[0125] The serial communication system provided by the embodiment of the present disclosure enables two devices to communicate through one node, and ensures that when two devices send data to each other at the same time, one of the devices has a higher priority, that is, the level of the communication node is related to the data sent by the device with a higher priority, which solves the problem of data conflict during the communication process. In addition, the serial communication system provided by the present disclosure does not require MCU software drive, saving the production cost of the device.
[0126] In some embodiments, corresponding to the serial communication method in any of the above embodiments, the first electronic device and the second electronic device in the above serial communication system can communicate and exchange data based on the method in the above embodiments.
[0127] In one embodiment, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0128] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory or other media used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory, magnetic tape, floppy disk, flash memory or optical storage, etc. Volatile memory may include random access memory or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static random access memory and dynamic random access memory, etc.
[0129] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.
[0130] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A serial communication module, characterized in that: including a tri-state buffer unit located in a first electronic device; The first electronic device comprises a first signal transmitting end and a first signal receiving end, the first signal transmitting end is used to transmit a first data signal to the second electronic device, and the first signal receiving end is used to receive a second data signal transmitted by the second electronic device; The second electronic device comprises a second signal transmitting end and a second signal receiving end, the second signal transmitting end is used to transmit the second data signal to the first electronic device, and the second signal receiving end is used to receive the first data signal transmitted by the first electronic device; The first signal transmitting end is connected to a first communication node through the three-state buffer unit and the first signal receiving end, and the first communication node is also used to connect to the second signal transmitting end and the second signal receiving end; The tri-state buffer unit is used for: In response to the first electronic device sending the first data signal to the second electronic device and the second electronic device sending the second data signal to the first electronic device, the first communication node is placed at a target level according to the first data signal.
2. The serial communication module according to claim 1, characterized in that: The tri-state buffer unit comprises a tri-state input terminal, a tri-state output terminal and a tri-state enable terminal; The tri-state input terminal is used to receive the first data signal sent by the first signal transmitting terminal to the second electronic device, the tri-state output terminal and the first signal receiving terminal are connected to the first communication node, and the tri-state enable terminal is used to receive a first enable signal or a second enable signal; The tri-state buffer unit is specifically used for: In response to the tri-state enable terminal receiving the first enable signal, the first communication node is placed at the target level according to the first data signal; or, in response to the tri-state enable terminal receiving the second enable signal, the tri-state output terminal is placed in a high impedance state.
3. The serial communication module according to claim 2, characterized in that: The tri-state buffer unit is specifically used for: In response to the three-state enable terminal receiving the first enable signal and the level of the first data signal being the first level, the first communication node is set to the third level; or, in response to the three-state enable terminal receiving the first enable signal and the level of the first data signal being the second level, the first communication node is set to the fourth level, wherein the first level is higher than the second level, and the third level is higher than the fourth level.
4. The serial communication module according to claim 1, characterized in that: Also included is a first level conversion unit located in the first electronic device; The first level conversion unit includes a first end, a second end and a control end, the first end of the first level conversion unit is used to receive the first data signal sent by the first signal sending end to the second electronic device, the second end of the first level conversion unit is connected to the tri-state input end of the tri-state buffer unit, and the first level conversion unit is used to control the connection or disconnection between the first end and the second end according to the level difference between the first end and the control end; The tri-state input terminal of the tri-state buffer unit further receives a first pull-up signal, the level of the first pull-up signal being a fifth level; The first level conversion unit is specifically used for: In response to the first data signal being at a first level, the first terminal and the second terminal are controlled to be cut off; or, in response to the first data signal being at a second level, the first terminal and the second terminal are controlled to be connected, wherein the first level and the fifth level are both higher than the second level.
5. The serial communication module according to claim 1, characterized in that: Also included is a second level conversion unit located in the first electronic device; The second level conversion unit includes a first end, a second end and a control end, the first end of the second level conversion unit is connected to the first signal receiving end, the second end of the second level conversion unit is used to receive the second data signal sent by the second electronic device to the first electronic device, and the second level conversion unit is used to control the connection or disconnection between the first end and the second end according to the level difference between the second end and the control end; The first signal receiving end further receives a second pull-up signal, the level of the second pull-up signal being a sixth level; The second level conversion unit is specifically used for: In response to the second data signal being at the seventh level, the first terminal and the second terminal are controlled to be cut off; or, in response to the second data signal being at the eighth level, the first terminal and the second terminal are controlled to be connected, wherein the seventh level and the sixth level are both higher than the eighth level.
6. The serial communication module according to claim 2, characterized in that: Also included is a third level conversion unit located in the first electronic device; The third level conversion unit includes a first end, a second end and a control end, the first end of the third level conversion unit is used to receive the first initial enable signal or the second initial enable signal, the second end of the third level conversion unit is connected to the tri-state enable end of the tri-state buffer unit, and the third level conversion unit is used to control the first end and the second end to be turned on or off according to the level difference between the first end and the control end; The third level conversion unit is specifically used for: In response to the first end receiving the first initial enable signal, the first end and the second end are controlled to be cut off; or, in response to the first end receiving the second initial enable signal, the first end and the second end are controlled to be connected.
7. The serial communication module according to claim 1, characterized in that: Also included is a first resistor and a second resistor located in the second electronic device; The first end of the first resistor is connected to the second signal transmitting end, the first end of the second resistor is connected to the second signal receiving end, and the resistance value of the first resistor is greater than that of the second resistor; The second end of the first resistor and the second end of the second resistor are connected to a second communication node, and the second communication node is used to be connected to the first communication node.
8. A serial communication method, characterized in that: Applied to the serial communication module according to any one of claims 1 to 7, the method comprising: In response to the first electronic device sending the first data signal to the second electronic device and the second electronic device sending the second data signal to the first electronic device, the first communication node is placed at the target level according to the first data signal using the tri-state buffer unit.
9. An electronic device, characterized in that: The first electronic device or the second electronic device according to any one of claims 1 to 7.
10. A serial communication system, characterized in that: The invention comprises the first electronic device and the second electronic device as described in any one of claims 1 to 7.