A data transmission system
By designing an automatic gate module in the USB Type C interface to connect the signal transceiver and receiver of the MCU, IO port multiplexing of the data transmission system is solved, and the chip IO port waste in the existing technology is improved and the stability of signal acquisition is improved. and timely.
Patent Information
- Application Number
- CN202210232112.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-02
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-03-02
AI Technical Summary
In the prior art, the data transmission design of the USB Type C interface leads to waste of chip IO ports, and two channels of data need to be used for communication, affecting the stability and timeliness of signal acquisition.
Design a data transmission system, including an MCU, a first automatic gate module, a second automatic gate module and a Type-C module, and connect it to the signal transceiver terminal of the MCU through the automatic gate module to realize the merger and transmission of data, avoid switching The input pins of the two short-circuit signals save IO ports and ensure the stability and timeliness of signal acquisition.
The IO port multiplexing of the data transmission system is realized, avoiding the waste of chip IO ports, ensuring the stability and timeliness of signal acquisition, and simplifying the data transmission process.
Smart Images

Figure CN114721305B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data transmission, and in particular, to a data transmission system. Background Art
[0002] USB Type C is a USB interface standard that is smaller than Type-A and Type-B. It can be used in both PCs and external devices (such as mobile phones). USB Type C provides two CC lines (CC1 and CC2), which are mainly used for USB PD communication and forward and reverse plug identification; that is, after the Type C line is inserted in the forward and reverse directions, the master and slave devices can recognize the access of the Type C line, and then allow the devices connected through Type C to communicate with each other according to the protocol requirements.
[0003] At present, the common design method is to use two data channels for communication separately, that is, the CC1 line detects the insertion, and the USB PD data is transmitted through the chip IO port on the CC1 line; the CC2 line detects the insertion, and the USB PD data is transmitted through the chip IO port connected to the CC2 line) is changed to data from the selected CC line to an IO port of the chip, resulting in a waste of the chip IO port.
[0004] In summary, the prior art has the problem of needing to use two data paths for communication respectively, resulting in a waste of chip IO ports. Summary of the invention
[0005] The purpose of the present application is to provide a data transmission system to solve the problem in the prior art that two data paths need to be used for communication respectively, resulting in waste of chip IO ports.
[0006] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] The embodiment of the present application provides a data transmission system, which includes an MCU, a first automatic gating module, a second automatic gating module and a type-C module, wherein one end of the first automatic gating module and the second automatic gating module are both connected to the signal transceiver end of the MCU, and the first automatic gating module and the second automatic gating module are used to connect to the first port and the second port of the type-C module; wherein,
[0008] When the first automatic gating module is connected to the first port, the first automatic gating module is turned on, so that the MCU communicates with the type-C module through the first automatic gating module;
[0009] When the second automatic gating module is connected to the second port, the second automatic gating module is turned on, so that the MCU communicates with the type-C module through the second automatic gating module.
[0010] Optionally, the circuits of the first automatic gating module and the second automatic gating module are the same.
[0011] Optionally, the first automatic gating module and the second automatic gating module both include an input port, an output port, a switch tube and a bias module, the bias module is electrically connected to the input port, the output port and the switch tube respectively, the switch tube is also electrically connected to the output end, the input port is used to connect the type-C module, and the output port is used to connect the MCU.
[0012] Optionally, the switching tube includes an NMOS tube, the bias module includes a voltage divider unit and a first resistor, the gate of the switching tube is electrically connected to the input port through the voltage divider unit, the source of the switching tube is electrically connected to the input port, the drain of the switching tube is electrically connected to the output port, and the two ends of the first resistor are electrically connected to the source and drain of the switching tube respectively.
[0013] Optionally, the voltage divider unit includes a second resistor and a third resistor, one end of the second resistor is electrically connected to the input port, the other end of the second resistor is respectively electrically connected to one end of the third resistor and the gate of the switching tube, and the other end of the third resistor is grounded.
[0014] Optionally, the data transmission system further includes a first pull-down component and a second pull-down component, wherein the first pull-down component and the second pull-down component are both electrically connected to the MCU, and the first pull-down component is used to be electrically connected to the first port of the type-C module, and the second pull-down component is used to be electrically connected to the second port of the type-C module; wherein,
[0015] When the first pull-down component or the second pull-down component is turned on, the data transmission system implements master-slave device switching.
[0016] Optionally, the first pull-down component and the second pull-down component both include a switch and a pull-down resistor, the control end of the switch is electrically connected to the MCU, one end of the pull-down resistor is connected to the type-C module through the switch, and the other end of the pull-down resistor is grounded.
[0017] Optionally, the data transmission system includes a first sampling resistor and a second sampling resistor, the first sampling resistor is electrically connected to a first sampling terminal of the MCU, the second sampling resistor is electrically connected to a second sampling terminal of the MCU, and the first sampling resistor and the second sampling resistor are both connected to a power supply;
[0018] The type-C module includes a fourth resistor and a fifth resistor, one end of the fourth resistor is electrically connected to the first port, the other end of the fourth resistor is grounded, one end of the fifth resistor is electrically connected to the second port, and the other end of the fifth resistor is grounded;
[0019] The MCU is used to determine the connection status of the data transmission system according to the sampling values of the first sampling end and the second sampling end.
[0020] Optionally, the connection state includes an unconnected state, a forward connection state, and a reverse connection state; wherein,
[0021] When the sampling values of the first sampling terminal and the second sampling terminal are both voltage values corresponding to the power supply, determining that the connection state is a disconnected state;
[0022] When the sampling value of the first sampling terminal is equal to a preset voltage value, determining that the connection state is a positive connection state;
[0023] When the sampling value of the second sampling terminal is equal to a preset voltage value, it is determined that the connection state is a reverse connection state.
[0024] Optionally, the preset voltage value satisfies the formula:
[0025] y=Rd / (Rp+Rd)*VCC
[0026] Wherein, y represents a preset voltage value, Rp represents the resistance value of the first sampling resistor or the second sampling resistor, Rd represents the resistance value of the fourth resistor or the fifth resistor, and VCC represents the voltage value corresponding to the power supply.
[0027] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0028] The embodiment of the present application provides a data transmission system, which includes an MCU, a first automatic gating module, a second automatic gating module and a type-C module, wherein one end of the first automatic gating module and the second automatic gating module are both connected to the signal transceiver end of the MCU, and the first automatic gating module and the second automatic gating module are used to connect to the first port and the second port of the type-C module; wherein, when the first automatic gating module is connected to the first port, the first automatic gating module is turned on so that the MCU communicates with the type-C module through the first automatic gating module; when the second automatic gating module is connected to the second port, the second automatic gating module is turned on so that the MCU communicates with the type-C module through the second automatic gating module. Since the present application provides the first automatic gating module and the second automatic gating module, when any port of the type-C module is connected to the system, the corresponding automatic gating module is turned on, thereby realizing data communication. Furthermore, since there is no need to switch the input pins of the two short-circuit signals, the first automatic gating module and the second automatic gating module can be connected to the same IO port of the MCU, saving IO ports while ensuring the stability and timeliness of signal acquisition.
[0029] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 A schematic diagram of a module of a data transmission system provided in an embodiment of the present application.
[0032] Figure 2 A circuit diagram of a first automatic gating module and a second automatic gating module provided in an embodiment of the present application.
[0033] Figure 3 A circuit diagram of a data transmission system provided in an embodiment of the present application.
[0034] Figure 4 Another circuit diagram of a data transmission system provided in an embodiment of the present application.
[0035] In the figure:
[0036] 100-data transmission system; 110-MCU; 120-first automatic gating module; 130-second automatic gating module; 140-tpye-C module; 150-first pull-down component; 160-second pull-down component; R1-first resistor; R2-second resistor; R3-third resistor; Q1-first transistor. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0038] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0039] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0040] It should be noted that, in this document, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0041] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0042] As described in the background technology, there is a CC1 signal on the front side of the Type C pin and a CC2 signal on the back side. The two signals are separated after entering the host device. If the USB PD (USB Power Delivery) protocol is used to decode the signal, it is necessary to flexibly switch the input pins of the two CC signals to receive and decode the signal, which affects the stability and timeliness of signal acquisition and leads to a waste of chip IO ports.
[0043] In view of this, in order to solve the above problems, an embodiment of the present application provides a data transmission system, which avoids the waste of chip IO ports by merging two CC signals into one pin. At the same time, each program only needs to collect one control USB PD protocol signal, thereby ensuring the stability and timeliness of signal acquisition.
[0044] The following is an exemplary description of the data transmission system provided by this application:
[0045] As an alternative implementation, see Figure 1 The data transmission system 100 includes an MCU 110, a first automatic gating module 120, a second automatic gating module 130 and a tpye-C module 140. One end of the first automatic gating module 120 and the second automatic gating module 130 are both connected to the signal transceiver end of the MCU 110. The first automatic gating module 120 and the second automatic gating module 130 are used to connect to the first port and the second port of the tpye-C module 140. When the first automatic gating module 120 is connected to the first port, the first automatic gating module 120 is turned on so that the MCU 110 communicates with the tpye-C module 140 through the first automatic gating module 120; when the second automatic gating module 130 is connected to the second port, the second automatic gating module 130 is turned on so that the MCU 110 communicates with the tpye-C module 140 through the second automatic gating module 130.
[0046] It can be understood that the signal transceiver end of the MCU 110 described in the present application, that is, the IO port of the chip, as an implementation, the signal transceiver end may include two IO ports, one of which is used to receive data and the other is used to send data, on this basis, the first automatic gating module 120 and the second automatic gating module 130 are both connected to the two IO ports. As another implementation, the signal transceiver end may also include only one IO port, which is used to receive and send data.
[0047] Through this implementation method, the first automatic gating module 120 and the second automatic gating module 130 can realize the multiplexing of the IO ports in the MCU110 (in the prior art, different IO ports need to be connected for two communication circuits), avoiding the waste of IO ports. At the same time, each time the program only needs to collect one control USB PD protocol signal, ensuring the stability and timeliness of signal collection.
[0048] The working principle of the data transmission system 100 is as follows:
[0049] When it is recognized that CC1 is connected to the system (the first port of the Type-C module 140 is connected to the system), the first automatic selection module 120 detects that a circuit is connected and automatically turns on, so that the signal transceiver end of the MCU110 is connected to the CC1 of the Type C module, and thereafter both sending and receiving signals are communicated from this interface.
[0050] When it is recognized that CC2 is connected to the system (the second port of the Type-C module 140 is connected to the system), the second automatic selection module 130 detects that a circuit is connected and automatically turns on, so that the signal transceiver end of the MCU110 is connected to the CC2 of the Type C module, and thereafter, both sending and receiving signals are communicated from this interface.
[0051] It can be understood that in order to facilitate data processing and enable signal transmission through one IO port, the circuits of the first automatic gating module 120 and the second automatic gating module 130 are the same, so that when receiving or sending signals, signal errors will not occur due to the difference between the first automatic gating module 120 and the second automatic gating module 130, thereby ensuring the stability of signal transmission.
[0052] As an implementation, see Figure 2 The first automatic gating module 120 and the second automatic gating module 130 both include an input port ( Figure 2 CC in), output port ( Figure 2 CC out), switch tube and bias module shown, the bias module is electrically connected to the input port, output port and switch tube respectively, the switch tube is also electrically connected to the output end, the input port is used to connect to the type-C module 140, and the output port is used to connect to the MCU110.
[0053] That is, the present application actually utilizes the setting of the hardware circuit so that when the system is connected to the type-C module 140, the first automatic gating module 120 or the second automatic gating module 130 is automatically turned on to achieve data communication. Among them, when the first port (CC1) of the type-C module 140 is connected to the system, the switch tube in the first automatic gating module 120 is automatically turned on to achieve data communication, and when the second port (CC2) of the type-C module 140 is connected to the system, the switch tube in the second automatic gating module 130 is automatically turned on to achieve data communication.
[0054] It should be noted that the present application does not limit the type of the switch tube. For example, it can be a transistor, a MOS tube, an IGBT tube, etc. At the same time, the present application does not limit the type of the switch tube. For example, it can be an N-type switch tube or a P-type switch tube.
[0055] The present application takes the switch tube as an NMOS tube as an example for explanation, on this basis, the bias module includes a voltage divider unit and a first resistor R1, the gate of the switch tube is electrically connected to the input port through the voltage divider unit, the source of the switch tube is electrically connected to the input port, the drain of the switch tube is electrically connected to the output port, and the two ends of the first resistor R1 are electrically connected to the source and drain of the switch tube respectively. In addition, the voltage divider unit includes a second resistor R2 and a third resistor R3, one end of the second resistor R2 is electrically connected to the input port, the other end of the second resistor R2 is electrically connected to one end of the third resistor R3 and the gate of the switch tube respectively, and the other end of the third resistor R3 is grounded.
[0056] Understandably, the CC signal is Figure 2 After CC in enters, it is divided by the voltage divider unit composed of R2 and R3. The divided signal enters the gate G of the switch tube, and the signal without voltage division enters the source S and enters the drain D after passing through a large resistor. In addition, there are two back-to-back PN junctions between the drain D and the source S of the MOS tube. When VGS gradually increases, it is attracted by the positive voltage of the gate; a large number of electrons gather between the drain and the source and form an N-type conductive channel from the drain to the source. When a certain amount of aggregation is reached, the switch tube begins to turn on, forming a drain current ID, thereby achieving conduction. Therefore, when CC in is high, the switch tube is turned on, and CC out is high after conduction; when CC in is low, the switch tube is not turned on, and CC out is low at this time. Thereby, the input high and low signals are realized at the output end, and MCU110 can communicate with the type-C module 140 according to the signal.
[0057] Moreover, generally speaking, when the type-C module 140 is connected to the system, the MCU 110 is used as the master device end and the type-C module 140 is used as the slave device end. When the MCU 110 is needed to be a slave device, in order to realize the physical requirements of the USB PD protocol, the master-slave device switching needs to be realized.
[0058] On this basis, as a way to achieve this, see Figure 3 The data transmission system 100 also includes a first pull-down component 150 and a second pull-down component. The first pull-down component 150 and the second pull-down component are both electrically connected to the MCU 110, and the first pull-down component 150 is used to be electrically connected to the first port of the tpye-C module 140, and the second pull-down component is used to be electrically connected to the second port of the tpye-C module 140; wherein, when the first pull-down component 150 or the second pull-down component is turned on, the data transmission system 100 realizes master-slave device switching.
[0059] Optionally, the first pull-down component 150 and the second pull-down component both include a switch and a pull-down resistor, the control end of the switch is electrically connected to the MCU 110, one end of the pull-down resistor is connected to the type-C module 140 through the switch, and the other end of the pull-down resistor is grounded.
[0060] Taking the first port access system of the tpye-C module 140 as an example, when it is recognized that CC1 is connected to the system, "DRP control 1" opens "switch control 3", and at the same time "DRP control 2" closes "switch control 4", so that the pull-down resistor 5.1K in the second pull-down component is connected to the CC line, thereby realizing the switching of master and slave devices.
[0061] As an implementation method, the present application uses the ADC of the MCU 110 to detect whether the Type-C module is connected to the system. At the same time, the ADC is used to realize the positive and negative connection identification of the present system.
[0062] On this basis, optionally, see Figure 4 The data transmission system 100 includes a first sampling resistor and a second sampling resistor (Rp in the figure), the first sampling resistor is electrically connected to the first sampling terminal of the MCU110, the second sampling resistor is electrically connected to the second sampling terminal of the MCU110, and the first sampling resistor and the second sampling resistor are both connected to a power supply; the type-C module 140 includes a fourth resistor and a fifth resistor (Rd in the figure), one end of the fourth resistor is electrically connected to the first port, the other end of the fourth resistor is grounded, one end of the fifth resistor is electrically connected to the second port, and the other end of the fifth resistor is grounded; the MCU110 is used to determine the connection status of the data transmission system 100 according to the sampling values of the first sampling terminal and the second sampling terminal.
[0063] The connection status includes the disconnected status, the forward connection status and the reverse connection status. The connection status identification method of the present application is:
[0064] When the sampling values of the first sampling terminal and the second sampling terminal are both voltage values corresponding to the power supply, determining that the connection state is a disconnected state;
[0065] When the sampling value of the first sampling terminal is equal to the preset voltage value, determining that the connection state is a positive connection state;
[0066] When the sampling value of the second sampling terminal is equal to the preset voltage value, it is determined that the connection state is a reverse connection state.
[0067] Combination Figure 4When the Type-C module is not connected to the system, the ADC has been sampling the voltage value of Rp directly from Vcc (that is, the voltage value corresponding to the power supply); the voltage value sampled at this time is VCC. As shown in the ADC2 acquisition state. When the Type-C module is connected to the system (as shown in the CC1 line in the figure), when the Type-C module is connected, the circuit Rp in the CC1 line is connected to the resistor Rd to form a complete voltage divider circuit. At this time, the voltage value sampled by ADC1 is the voltage divider formed by Rp and Rd.
[0068] The voltage division value described in this application, that is, the preset voltage value satisfies the formula:
[0069] y=Rd / (Rp+Rd)*VCC
[0070] Wherein, y represents a preset voltage value, Rp represents the resistance value of the first sampling resistor or the second sampling resistor, Rd represents the resistance value of the fourth resistor or the fifth resistor, and VCC represents the voltage value corresponding to the power supply.
[0071] Therefore, if the voltages collected by ADC1 and ADC2 in the figure are both VCC, it means that the Type-C module is not connected to the system at this time. If the voltage value collected by ADC1 is Rd / (Rp+Rd)*VCC and the voltage value collected by ADC2 is VCC, it means that the Type-C module is connected to the system and is in a forward connection state. If the voltage value collected by ADC1 is VCC and the voltage value collected by ADC2 is Rd / (Rp+Rd)*VCC, it means that the Type-C module is connected to the system and is in a reverse connection state.
[0072] Of course, in actual circuit applications, the collected voltage values may fluctuate to a certain extent. Therefore, the voltage values equal to the preset voltage values described in this application can be regarded as equal as long as they are within a certain range, and will not be elaborated here.
[0073] In summary, the embodiment of the present application provides a data transmission system 100, characterized in that the data transmission system 100 includes an MCU 110, a first automatic gating module 120, a second automatic gating module 130 and a tpye-C module 140, one end of the first automatic gating module 120 and the second automatic gating module 130 are both connected to the signal transceiver end of the MCU 110, and the first automatic gating module 120 and the second automatic gating module 130 are used to connect to the first port and the second port of the tpye-C module 140; wherein, when the first automatic gating module 120 is connected to the first port, the first automatic gating module 120 is turned on so that the MCU 110 communicates with the tpye-C module 140 through the first automatic gating module 120; when the second automatic gating module 130 is connected to the second port, the second automatic gating module 130 is turned on so that the MCU 110 communicates with the tpye-C module 140 through the second automatic gating module 130. Since the present application sets up the first automatic gating module 120 and the second automatic gating module 130, when any port of the type-C module 140 is connected to the system, the corresponding automatic gating module is turned on, thereby realizing data communication. In addition, since there is no need to switch the input pins of the two short-circuit signals, the first automatic gating module 120 and the second automatic gating module 130 can be connected to the same IO port of the MCU 110, saving IO ports and ensuring the stability and timeliness of signal acquisition.
[0074] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0075] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A data transmission system, characterized in that: The data transmission system includes an MCU, a first automatic gating module, a second automatic gating module and a type-C module, one end of the first automatic gating module and the second automatic gating module are connected to the signal transceiver end of the MCU, and the first automatic gating module and the second automatic gating module are used to connect to the first port and the second port of the type-C module; wherein, When the first automatic gating module is connected to the first port, the first automatic gating module is turned on, so that the MCU communicates with the type-C module through the first automatic gating module; When the second automatic gating module is connected to the second port, the second automatic gating module is turned on, so that the MCU communicates with the type-C module through the second automatic gating module; The signal transceiver end includes two IO ports, one of which is used to receive data and the other is used to send data, and the first automatic gating module and the second automatic gating module are both connected to the two IO ports; or; the signal transceiver end includes only one IO port, which is used to receive and send data.
2. The data transmission system according to claim 1, characterized in that: The circuits of the first automatic gating module and the second automatic gating module are the same.
3. The data transmission system according to claim 2, characterized in that: The first automatic gating module and the second automatic gating module both include an input port, an output port, a switch tube and a bias module. The bias module is electrically connected to the input port, the output port and the switch tube respectively. The switch tube is also electrically connected to the output end. The input port is used to connect the type-C module, and the output port is used to connect the MCU.
4. The data transmission system according to claim 3, characterized in that: The switch tube includes an NMOS tube, the bias module includes a voltage divider unit and a first resistor, the gate of the switch tube is electrically connected to the input port through the voltage divider unit, the source of the switch tube is electrically connected to the input port, the drain of the switch tube is electrically connected to the output port, and the two ends of the first resistor are electrically connected to the source and drain of the switch tube respectively.
5. The data transmission system according to claim 4, characterized in that: The voltage divider unit includes a second resistor and a third resistor, one end of the second resistor is electrically connected to the input port, the other end of the second resistor is respectively electrically connected to one end of the third resistor and the gate of the switch tube, and the other end of the third resistor is grounded.
6. The data transmission system according to claim 1, characterized in that: The data transmission system further includes a first pull-down component and a second pull-down component, wherein the first pull-down component and the second pull-down component are both electrically connected to the MCU, and the first pull-down component is used to be electrically connected to the first port of the type-C module, and the second pull-down component is used to be electrically connected to the second port of the type-C module; wherein, When the first pull-down component or the second pull-down component is turned on, the data transmission system implements master-slave device switching.
7. The data transmission system according to claim 6, characterized in that: The first pull-down component and the second pull-down component both include a switch and a pull-down resistor, the control end of the switch is electrically connected to the MCU, one end of the pull-down resistor is connected to the type-C module through the switch, and the other end of the pull-down resistor is grounded.
