Data transmission device, electronic device, and method of switching data transmission path

By setting a switch in the SOC module and using the level signals of the USB_ID and VBUS pins to control the connection status of the switch with multiple data ports, the problem that microprocessors cannot support multiple USB device connections at the same time in the prior art is solved, realizing flexible data transmission path switching and reducing development and maintenance difficulty.

CN115237838BActive Publication Date: 2026-03-03JINGCHEN SEMICON SHENZHEN CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110449936.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-25
Publication Date
2026-03-03
Estimated Expiration
2041-04-25

AI Technical Summary

Technical Problem

Existing microprocessors cannot support the connection of multiple USB built-in external devices simultaneously, which increases the difficulty of development and maintenance.

Method used

By setting a switch in the SOC module, the connection status of the switch with multiple data ports can be controlled by the level signals of the USB_ID and VBUS pins, thereby realizing the switching of data transmission paths and reusing one USB pin of the SOC module.

Benefits of technology

It reduces the development cost and maintenance difficulty of USB pins, and enables flexible connection of multiple USB ports and switching of data transmission paths.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115237838B_ABST
    Figure CN115237838B_ABST
Patent Text Reader

Abstract

This invention discloses a data transmission device, an electronic device, and a method for switching data transmission paths. The data transmission device includes multiple data ports, a System-on-a-Chip (SOC) module, and a switching switch. The SOC module includes a control unit, which has at least a USB pin, a GPIO pin, a USB_ID pin, and a VBUS pin. The switching switch is connected to the USB pin and the GPIO pin respectively, and can selectively connect to the multiple data ports. The control unit is used to acquire the level signals of the USB_ID pin and the VBUS pin, and control the connection state of the switching switch with the multiple data ports based on the level signals. According to the data transmission device of this invention, by setting a switching switch, the development cost of the USB pin can be reduced, and the difficulty of production and maintenance can be lowered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data transmission technology, and in particular to a data transmission device, an electronic device, and a method for switching data transmission paths. Background Technology

[0002] On-The-Go (OTG) is a technology that has emerged in recent years based on USB (Universal Serial Bus) technology. It primarily enables connections and data exchange between various different devices or mobile devices without a host computer. Examples include a digital camera directly connecting to a printer, or a car rearview mirror system directly connecting to a camera. Current microprocessors typically only have one microcontroller with USB OTG functionality, and cannot simultaneously support the connection of other USB built-in external devices, resulting in poor scalability.

[0003] To address the above issues, related technologies often integrate multiple USB interfaces with OTG functionality onto a System-on-Chip (SoC). Alternatively, multiple jumpers are placed at the OTG-enabled USB interfaces on the SoC, and different data transmission functions are achieved by switching these jumpers during production.

[0004] However, integrating multiple USB ports with OTG functionality or setting multiple jumpers on a SOC will increase the difficulty of development and subsequent maintenance. Summary of the Invention

[0005] This invention aims to at least solve one of the technical problems existing in the prior art. Therefore, one objective of this invention is to provide a data transmission device that, by incorporating a switching switch, can reduce the development cost of USB pins and simplify production and maintenance.

[0006] The second objective of this invention is to provide an electronic device.

[0007] The third objective of this invention is to propose a method for switching data transmission paths.

[0008] To address the aforementioned problems, a data transmission device provided in a first aspect embodiment of the present invention includes: multiple data ports; a SOC module, the SOC module including a control unit, the control unit having at least a USB pin, a GPIO pin, a USB_ID pin, and a VBUS pin; a switch, the switch being connected to the USB pin and the GPIO pin respectively, and the switch being selectively connected to the multiple data ports; wherein the control unit is configured to acquire the level signals of the USB_ID pin and the VBUS pin, and control the connection state of the switch and the multiple data ports according to the level signals.

[0009] According to the data transmission device of the present invention, by setting a switching switch, the switching switch is connected to a USB pin and a GPIO pin, and the switching switch is also selectively connected to multiple data ports. The control unit controls the connection state of the switching switch and multiple data ports according to the level signals of the VBUS pin and the USB_ID pin. That is, by reusing one USB pin of the SOC module, the data transmission path between the control unit and multiple USB port connected devices, such as built-in or external devices, can be switched by controlling the connection state of the switching switch and multiple data ports. There is no need to add more USB ports or jumpers, which can reduce the development cost of USB pins and facilitate maintenance during subsequent use.

[0010] In some embodiments of the present invention, the multiple data ports include a built-in USB port and a Micro USB port; the control unit, when controlling the switching switch to connect to the multiple data ports, determines that the VBUS pin is low, controls the switching switch to connect to the built-in USB port and disconnect from the Micro USB port, so that the control unit can transmit data with the built-in module.

[0011] By controlling the switch to connect to the built-in USB port, data transmission between the control unit and the internal USB port module of the device can be achieved.

[0012] In some embodiments of the present invention, when the control unit controls the connection state of the switching switch and the plurality of data ports, it is further configured to determine that the VBUS pin is at a high level and the USB_ID pin is at a high level, and control the switching switch to disconnect from the built-in USB port and connect to the Micro USB port, so that data transmission can be performed between the control unit and the programming peripheral. By controlling the switching switch to switch the connected data ports, the data transmission path for programming the control unit can be realized.

[0013] In some embodiments of the present invention, when controlling the switching switch to connect to the multiple data ports, the control unit is further configured to: determine that the VBUS pin is at a high level and the USB_ID pin is at a low level; control the Micro USB port to receive power; and control the switching switch to disconnect from the built-in USB port and connect to the Micro USB port, so that the control unit can perform OTG data transmission. By controlling the switching switch to switch the connected data ports, the OTG data transmission path can be realized.

[0014] To achieve the above objectives, an electronic device provided in a second aspect of the present invention includes: a device body; and a data transmission device as described in any of the above embodiments, wherein the data transmission device is disposed on the device body.

[0015] According to an embodiment of the present invention, an electronic device employing the data transmission device of the above embodiment adds a switching switch outside the SOC module. The switching switch can be selectively connected to multiple data ports. The control unit controls the switching of the switching switch based on the level signals of the VBUS pin and the USB_ID pin. That is, one USB pin of the SOC module is reused. By controlling the connection state of the switching switch with multiple data ports, the data transmission path between the control unit and devices connected to multiple USB ports, such as built-in or external ones, can be switched. There is no need to add more USB ports or jumpers, which can reduce the development cost of USB pins and facilitate maintenance during subsequent use.

[0016] In some embodiments of the present invention, the electronic device includes a built-in communication module, which is connected to a built-in USB port in the data transmission device.

[0017] To achieve the above objectives, a method for switching data transmission paths is provided in a third aspect embodiment of the present invention. This method is used in a data transmission device, which includes a SOC module, a switching switch, and multiple data ports. The SOC module includes a control unit and a USB_ID pin and a VBUS pin connected to the control unit. The method includes: acquiring level signals from the USB_ID pin and the VBUS pin; and controlling the connection state of the switching switch and the multiple data ports based on the level signals.

[0018] According to the method for switching data transmission paths of the present invention, based on the data transmission device of the above embodiment, the data transmission device is provided with a switching switch. The method of the present invention can realize the switching of data transmission paths between the control unit and multiple USB port connected devices, such as built-in or external devices, by acquiring the level signals of the USB_ID pin and the VBUS pin and controlling the connection state of the switching switch with multiple data ports according to the level signals. This can reduce the development cost of USB pins and facilitate maintenance during subsequent use.

[0019] In some embodiments of the present invention, the plurality of data ports include a built-in USB port and a Micro USB port. Controlling the connection state of the switch with the plurality of data ports according to the level signal includes: determining that the VBUS pin is at a low level, controlling the switch to connect with the built-in USB port and disconnect from the Micro USB port, so as to realize data transmission with the built-in module.

[0020] In some embodiments of the present invention, controlling the connection state of the switching switch and the plurality of data ports according to the level signal further includes: determining that the VBUS pin is at a high level and the USB_ID pin is at a high level, controlling the switching switch to disconnect from the USB built-in port and connect to the Micro USB port, so as to realize the data burning of the control unit.

[0021] In some embodiments of the present invention, controlling the connection state of the switching switch and the plurality of data ports according to the level signal further includes: determining that the VBUS pin is at a high level and the USB_ID pin is at a low level, controlling the Micro USB port to supply power, and controlling the switching switch to disconnect from the USB built-in port and connect to the Micro USB port to realize OTG data transmission.

[0022] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0023] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0024] Figure 1 This is a schematic diagram of a data transmission device in the related art;

[0025] Figure 2 This is a schematic diagram of another data transmission device in the related technology;

[0026] Figure 3This is a block diagram of a data transmission device according to an embodiment of the present invention;

[0027] Figure 4 This is a block diagram of a data transmission device according to another embodiment of the present invention;

[0028] Figure 5 This is a block diagram of an electronic device according to an embodiment of the present invention;

[0029] Figure 6 This is a block diagram of an electronic device according to another embodiment of the present invention;

[0030] Figure 7 This is a flowchart of a method for switching data transmission paths according to an embodiment of the present invention;

[0031] Figure 8 This is a flowchart of a method for switching data transmission paths according to another embodiment of the present invention;

[0032] Figure 9 This is a flowchart of a method for switching data transmission paths according to another embodiment of the present invention;

[0033] Figure 10 This is a flowchart of a method for switching data transmission paths according to another embodiment of the present invention.

[0034] Figure label:

[0035] 10 electronic devices;

[0036] Data transmission device 01, equipment body 02, built-in communication module 03;

[0037] Data port 1, SOC module 2, switch 3;

[0038] USB built-in port 11, Micro USB port 12, control unit 21. Detailed Implementation

[0039] The embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. The embodiments of the present invention are described in detail below.

[0040] Figure 1 This is a schematic diagram of a data transmission device in the related art, such as... Figure 1 As shown, the SOC module of the data transmission device integrates two USB pins, such as USB_A and USB_B. These two USB pins can be connected to programming peripherals and OTG peripherals respectively to realize functions such as upgrade programming and OTG data transmission. Integrating two USB pins into the SOC module results in higher development costs for the USB pins themselves.

[0041] Figure 2This is a schematic diagram of another data transmission device in the related art, such as... Figure 2 As shown, the SOC module of the data transmission device has a USB port with two jumpers, jumper 1 and jumper 2, leading out from the USB port. Jumper 1 and jumper 2 can be connected to the firmware flashing peripheral and the OTG peripheral, respectively, to enable functions such as firmware upgrades and OTG data transmission. During production, jumper 1 is soldered first to enable firmware flashing or upgrades. After firmware flashing is complete, jumper 2 is then soldered to enable data transmission between the device and the OTG peripheral. This jumper-switching method leads to significant development complexity and inconvenience for subsequent maintenance.

[0042] Based on the above problems, in order to reduce the development cost of USB pins or reduce the development or maintenance difficulty caused by using jumper switching methods, this invention proposes a data transmission device, as described below. Figures 3-4 A data transmission apparatus according to an embodiment of the present invention is described.

[0043] Figure 3 This is a data transmission device according to an embodiment of the present invention.

[0044] In some embodiments of the present invention, such as Figure 3 As shown, the data transmission device 01 includes multiple data ports 1, a SOC module 2, and a switching switch 3.

[0045] The multiple data ports 1 can be connected to built-in modules, programming peripherals, and OTG peripherals to control the operation of built-in modules, upgrade and program the SOC module, and perform OTG data transmission. Built-in modules may include USB WIFI (Wireless Fidelity), BT (Bit Torrent), 4G modules, etc. Programming peripherals may include computers, embedded computers, etc., and OTG peripherals may include USB flash drives, mice, keyboards, and Bluetooth devices.

[0046] SOC module 2 includes a control unit 21, which has at least a USB pin, a GPIO (General Purpose Input / Output) pin, a USB_ID pin, and a VBUS pin.

[0047] The USB pin is used for data transmission. The GPIO pins have input / output functions and, when connected to relevant modules or switches, can realize communication, control, and data acquisition functions.

[0048] The USB_ID pin in SOC module 2 can be used to identify different cable endpoints. Control unit 21 can detect the level signal of the USB_ID pin to determine the operating status of the device. The data transmission device 01 of this embodiment has USB OTG functionality, enabling data transmission between devices without a host. For example, when a low level signal is detected on the USB_ID pin, the USB_ID pin is grounded, indicating that the default device operates as a Host (also called Device A). When a high level signal is detected on the USB_ID pin, the USB_ID pin is left floating, indicating that the default device operates as a Device (also called Device B).

[0049] The VBUS pin is the power supply line. When SOC module 2 is running as a host, it supplies power to connected slave devices, such as OTG peripherals, via the VBUS pin. When SOC module 2 is running as a device, the master device, such as a computer, supplies power to it via the VBUS pin.

[0050] The switch 3 is connected to both the USB pin and the GPIO pin, and is selectively connected to multiple data ports. Specifically, the SOC module 2 can control the switch 3 to switch to the corresponding data port 1 via the GPIO pin, and connect to the device via the USB pin to the data port 1 for data transmission.

[0051] The control unit 21 is used to acquire the level signals of the USB_ID pin and the VBUS pin, and control the connection status of the switching switch 3 and multiple data ports 1 according to the level signals, so as to realize the switching of the data transmission path of the required functional connection device.

[0052] For example, in the default state, switch 3 is connected to the data port of the built-in module. When control unit 21 detects a low level on the VBUS pin, SOC module 2 operates as the host, enabling data transmission between SOC module 2 and the built-in module. When control unit 21 detects a high level on both the VBUS pin and the USB_ID pin, it determines that SOC module 2 is operating as a device and controls switch 3 to switch to data port 1 connected to the programming peripheral, enabling SOC module 2 to perform data programming from the programming peripheral. When control unit 21 detects a high level on the VBUS pin and a low level on the USB_ID pin, it determines that SOC module 2 is operating as a device and controls switch 3 to switch to data port 1 connected to the OTG peripheral, enabling data transmission between SOC module 2 and the OTG peripheral, thus realizing the device's USB OTG function.

[0053] According to the data transmission device 01 of the present invention, a switching switch 3 is provided, which is connected to a USB pin and a GPIO pin. The switching switch 3 is also selectively connected to multiple data ports 1. The control unit 21 controls the connection state of the switching switch 3 and the multiple data ports 1 according to the level signals of the VBUS pin and the USB_ID pin. That is, one USB pin of the SOC module 2 is reused. By controlling the connection state of the switching switch and the multiple data ports, the data transmission path between the control unit and multiple USB port connected devices, such as built-in or external devices, can be switched. There is no need to add more USB ports or jumpers, which can reduce the development cost of USB pins and facilitate maintenance during subsequent use.

[0054] like Figure 4 The diagram shown is a block diagram of a data transmission device according to another embodiment of the present invention, wherein a plurality of data ports 1 include a built-in USB port 11 and a Micro USB port 12.

[0055] The built-in USB port 11 can be connected to built-in modules such as USB WIFI and 4G modules, while the Micro USB port 12 can be connected to programming peripherals such as computers. The Micro USB port 12 can also be connected to an OTG data cable for connecting to OTG peripherals. By controlling the switch 3 to switch the connected data port 1, the control unit 3 can transmit data with the USB port module inside the device, or the data transmission path for programming the control unit 3 and the OTG data transmission path can be realized.

[0056] In some embodiments of the present invention, when controlling the switching switch 3 to be connected to the multiple data ports 1, the control unit 21 is used to determine that the VBUS pin is low, control the switching switch 3 to connect to the USB built-in port 11 and disconnect from the Micro USB port 12, so that the control unit 21 can transmit data with the built-in module.

[0057] The built-in module can include a 4G module, USB WIFI, etc., and can be installed within the product structure and connected to the USB built-in port 11. When the USB built-in port 11 is connected to the 4G module or USB WIFI, the USB_ID pin is in a floating state, i.e., in an internal pull-up state. At this time, the control unit 21 detects that the VBUS pin is low. If the control unit 21 detects that the VBUS pin level signal is 0, it determines that a built-in module is connected to the USB built-in port 11, and the Micro USB port 12 is floating. The control unit 21 controls the switch 3 to connect to the USB built-in port 11 and disconnect from the Micro USB port 12, so as to realize the connection and conduction between the SOC module 2 and the built-in module. At this time, the SOC module 2 operates as the host, and the built-in module operates as the device. The control unit 21 controls the SOC module 2 to supply power to the built-in module through the VBUS pin, and the SOC module 2 transmits data with the built-in module through the USB pin, so as to realize the SOC module 2 controlling the working state of the built-in module.

[0058] In some embodiments of the present invention, when controlling the switching switch 3 to connect to the multiple data ports 1, the control unit 21 is also used to determine that the VBUS pin is at a high level and the USB_ID pin is at a high level, control the switching switch 3 to disconnect from the USB built-in port 11 and connect to the Micro USB port 12, so that the control unit 21 can transmit data with the programming peripheral.

[0059] In some embodiments of the present invention, when the Micro USB port 12 is connected to a programming peripheral such as a computer or embedded computer, the USB_ID pin is left floating, i.e., in an internal pull-up state. At this time, the control unit 21 detects that the VBUS pin is high and the USB_ID pin is high. If the control unit 21 detects that the VBUS pin level is 1 and the USB_ID pin level is 1, it determines that the programming peripheral is connected to the Micro USB port 12. The control unit 21 controls the switch 3 to disconnect from the USB internal port 11 and connect to the Micro USB port 12, so as to realize the connection between the SOC module 2 and the programming peripheral. At this time, the programming peripheral operates as a host, and the SOC module 2 operates as a device. The external programming peripheral supplies power to the SOC module 2 through the VBUS pin. The control unit 21 can control the SOC module 2 to program data from the programming peripheral through the USB pin, so as to realize functions such as downloading and upgrading the SOC module 2 and accessing files.

[0060] In some embodiments of the present invention, when controlling the switching switch 3 and the multiple data ports 1 to be connected, the control unit 21 is also used to determine that the VBUS pin is at a high level and the USB_ID pin is at a low level, control the Micro USB port 12 to be powered, and control the switching switch 3 to disconnect from the USB built-in port 11 and connect to the Micro USB port 12 so that the control unit 21 can perform OTG data transmission.

[0061] In some embodiments of the present invention, when the Micro USB port 12 is connected to an OTG peripheral such as a USB flash drive, mouse, keyboard, or Bluetooth device, the USB_ID pin is grounded, i.e., in an external pull-down state. At this time, the control unit 21 detects that the VBUS pin is high and the USB_ID pin is low. If the control unit 21 detects a VBUS pin level of 1 and a USB_ID pin level of 0, it determines that the Micro USB port 12 is connected to the OTG data line. The control unit 21 controls the switch 3 to disconnect from the internal USB port 11 and connect to the Micro USB port, enabling the SOC module 2 to connect and conduct with the OTG peripheral, thus realizing the OTG function. At this time, the SOC module 2 operates as a Host, and the OTG peripheral operates as a Device. The control unit 21 controls the SOC module 2 to supply power to the OTG peripheral via the VBUS pin, putting the SOC module 2 in OTG working mode. The SOC module 2 then transmits data with the OTG peripheral via the USB pin.

[0062] Figure 5 This is a block diagram of an electronic device according to an embodiment of the present invention.

[0063] In some embodiments of the present invention, such as Figure 5 As shown, the electronic device 10 includes a device body 02 and a data transmission device 01 in any of the above embodiments, the data transmission device 01 being disposed on the device body 02.

[0064] The electronic device 10 may include smartphones, tablets, digital cameras, camcorders, and printers. By installing the data transmission device 01 of any of the above embodiments on the electronic device 10, the electronic device 10 can perform functions such as controlling internal modules, burning files, and connecting external devices.

[0065] According to the present invention, the electronic device 10 adopts the data transmission device 01 of the above embodiment, and adds a switching switch 3 outside the SOC module 2. The switching switch 3 can be selectively connected to multiple data ports 1. The control unit 21 controls the switching of the switching switch 3 according to the level signals of the VBUS pin and the USB_ID pin, that is, reuses one USB pin of the SOC module 2. By controlling the connection state of the switching switch 3 and multiple data ports 1, the data transmission path of the control unit 21 and multiple USB port connected devices, such as built-in or external ones, can be switched. There is no need to add more USB ports or add jumpers, which can reduce the development cost of USB pins and facilitate maintenance in subsequent use.

[0066] like Figure 6 The diagram shown is a block diagram of an electronic device according to another embodiment of the present invention, wherein the electronic device 10 includes a built-in communication module 03, which is connected to the USB built-in port 11 in the data transmission device 01.

[0067] In some embodiments of the present invention, the built-in communication module 03 is a module with communication function, which is installed inside the electronic device 10 and may include USB WIFI (Wireless Fidelity), 4G module, etc. The built-in communication module 03 is connected to the USB built-in port 11 to realize the communication function between the electronic device 10 and the outside world.

[0068] Specifically, taking a smartphone as an example, when the SOC module 2 inside the smartphone is connected to the internal communication module 03 via the built-in USB port 11, the control unit 21 detects a low level on the VBUS pin and controls the switch 3 to connect to the built-in USB port 11 and disconnect from the Micro USB port 12 based on the level signal, thereby enabling the SOC module 2 to connect and conduct with the internal communication module 03. The SOC module 2 transmits data with the internal communication module 03 via the USB pin to enable communication between the smartphone and the outside world, such as connecting to a network via WIFI or conducting 4G network communication.

[0069] Figure 7 This is a flowchart of a method for switching data transmission paths according to an embodiment of the present invention.

[0070] In some embodiments of this invention, such as Figure 7 As shown, a method for switching data transmission paths is provided for a data transmission device 01. The data transmission device 01 includes a SOC module 2, a switching switch 3, and multiple data ports 1. The SOC module 2 includes a control unit 21 and a USB_ID pin and a VBUS pin connected to the control unit 21. The method for switching data transmission paths includes steps S1 and S2, as detailed below.

[0071] S1, acquires the level signals of the USB_ID pin and VBUS pin.

[0072] The program in the SOC module can acquire and detect the level signals of the USB_ID pin and VBUS pin during runtime. The USB_ID pin level signal includes a high level signal and a low level signal, and the VBUS pin level signal includes a high level signal and a low level signal.

[0073] S2 controls the connection status of the switching switch and multiple data ports according to the level signal.

[0074] In this embodiment, the SOC module analyzes and calculates the acquired level signals, and the control unit in the SOC module can control the switching action of the switch based on the detection result of the level signals. For example, the control unit can control the switch to disconnect from the built-in USB port and connect to the Micro USB port, or control the switch to disconnect from the Micro USB port and connect to the built-in USB port, etc.

[0075] According to the method for switching data transmission paths of the present invention, based on the data transmission device of the above embodiment, the data transmission device is provided with a switching switch. The method of the present invention can realize the switching of data transmission paths between the control unit and multiple USB port connected devices, such as built-in or external devices, by acquiring the level signals of the USB_ID pin and the VBUS pin and controlling the connection state of the switching switch with multiple data ports according to the level signals. This can reduce the development cost of USB pins and facilitate maintenance during subsequent use.

[0076] like Figure 8 The diagram shows a flowchart of a method for switching data transmission paths according to another embodiment of the present invention. The multiple data ports include a USB built-in port and a Micro USB port. Step S2 above controls the connection state of the switching switch and the multiple data ports according to the level signal, and includes at least step S201, as follows.

[0077] S201 determines that the VBUS pin is at a low level, controls the switch to connect to the built-in USB port and disconnect from the Micro USB port, so as to realize data transmission with the built-in module.

[0078] In some embodiments of the present invention, when the built-in USB port is connected to a 4G module or a built-in module such as USB WIFI, the VBUS pin detected by the SOC module is at a low level. At this time, the Micro USB port is floating, and the USB_ID pin is in an internal pull-up state. The default operating state of the SOC module is Host state, that is, the SOC module operates as a Host. The control unit controls the switching switch to connect to the built-in USB port and disconnect from the Micro USB port according to the detected level signal, so as to realize the SOC module controlling the operating state of the built-in module.

[0079] like Figure 9 The diagram shows a flowchart of a method for switching data transmission paths according to another embodiment of the present invention. In step S2 above, which controls the connection state of the switching switch and multiple data ports according to the level signal, it also includes at least step S202, as follows.

[0080] S202: Determine that the VBUS pin is at a high level and the USB_ID pin is at a high level, control the switch to disconnect from the built-in USB port and connect to the Micro USB port to enable data burning to the control unit.

[0081] In some embodiments of the present invention, when the Micro USB port is connected to a programming peripheral such as a computer or embedded computer, the SOC module detects that the VBUS pin is high and the USB_ID pin is also high, with the USB_ID pin in an internal pull-up state. At this time, the SOC module should operate as a Device, i.e., the SOC module's working state is Device state. The control unit controls a switch to disconnect from the internal USB port and connect to the Micro USB port based on the level signal, thereby enabling the SOC module to connect to the programming peripheral. The control unit can then program data from the programming peripheral to achieve functions such as downloading and upgrading the SOC module and accessing files.

[0082] like Figure 10 The diagram shows a flowchart of a method for switching data transmission paths according to another embodiment of the present invention. In step S2 above, which controls the connection state of the switching switch and multiple data ports according to the level signal, step S203 is also included, as follows.

[0083] S203 determines that the VBUS pin is at a high level and the USB_ID pin is at a low level, controls the power supply to the Micro USB port, and controls the switch to disconnect from the built-in USB port and connect to the Micro USB port to realize OTG data transmission.

[0084] In some embodiments of the present invention, when the Micro USB port is connected to the OTG data cable, the SOC module detects that the VBUS pin is high and the USB_ID pin is low, with the USB_ID pin in an external pull-down state. At this time, the SOC module operates as a host, controlling the switch to disconnect from the internal USB port and connect to the Micro USB port, thus connecting the SOC module to the OTG peripheral. The control unit controls the SOC module to supply power to the OTG peripheral via the Micro USB port based on the voltage level signal, putting the SOC module into OTG operating mode to achieve OTG data transmission.

[0085] In summary, the data transmission device 01 of this embodiment of the invention, by setting a switching switch 3, connects the switching switch 3 to the USB pin and GPIO pin of the control unit 21 in the SOC module 2, and sets both the built-in USB port and the Micro USB port to the switching switch 3, the switching switch 3 can selectively connect to multiple data ports 1. The SOC module 2 can detect the level signals output by the VBUS pin and the USB_ID pin, and determine the module or device connected to the built-in USB port or the Micro USB port based on the level signals, thereby determining the working state of the SOC module 2. By controlling the switching switch 3 to connect to multiple data ports 1 through the control unit 21, the data transmission path between the control unit and multiple USB ports (built-in or external) can be switched using one USB pin of the SOC module. This eliminates the need to add more USB ports or jumpers, reducing the development cost of USB pins and facilitating maintenance during subsequent use.

[0086] Other configurations and operations of the electronic device 10 according to embodiments of the present invention are known to those skilled in the art and will not be described in detail here.

[0087] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example.

[0088] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A data transmission device, characterized in that, include: Multiple data ports, including a built-in USB port and a Micro USB port, with the built-in USB port connecting to the built-in module; The SOC module includes a control unit, which has at least a USB pin, a GPIO pin, a USB_ID pin, and a VBUS pin. A switching switch is connected to the USB pin and the GPIO pin respectively, and the switching switch can be selectively connected to a plurality of the data ports; The control unit is used to acquire the level signals of the USB_ID pin and the VBUS pin, and control the connection status of the switching switch and the multiple data ports according to the level signals. Specifically, when the VBUS pin is determined to be low, the switch is controlled to connect to the built-in USB port and disconnect from the Micro USB port, so that the control unit can transmit data with the built-in module. When the VBUS pin is high, the switch is controlled to disconnect from the built-in USB port and connect to the Micro USB port. The control unit is then used to determine whether it communicates with the programming peripheral or with the OTG peripheral based on the level of the USB_ID pin.

2. The data transmission device according to claim 1, characterized in that, When the VBUS pin is high, the switch is disconnected from the internal USB port and connected to the Micro USB port. The control unit determines whether to communicate with the programming peripheral or with the OTG peripheral based on the level of the USB_ID pin, including: When the VBUS pin is high and the USB_ID pin is high, the switch is controlled to disconnect from the built-in USB port and connect to the Micro USB port, so that data can be transmitted between the control unit and the programming peripheral.

3. The data transmission device according to claim 1, characterized in that, When the VBUS pin is high, the switch is disconnected from the internal USB port and connected to the Micro USB port. The control unit determines whether to communicate with the programming peripheral or with the OTG peripheral based on the level of the USB_ID pin, including: When the VBUS pin is high and the USB_ID pin is low, the Micro USB port is powered on, and the switch is disconnected from the built-in USB port and connected to the Micro USB port to enable OTG data transmission between the control unit and the OTG peripheral.

4. An electronic device, characterized in that, include: Equipment body; The data transmission device according to any one of claims 1-3, wherein the data transmission device is disposed on the device body.

5. The electronic device according to claim 4, characterized in that, The electronic device includes a built-in communication module, which is connected to the built-in USB port in the data transmission device.

6. A method for switching data transmission paths, characterized in that, A data transmission device is used, the data transmission device including a SOC module, a switch, and multiple data ports, the multiple data ports including a built-in USB port and a Micro USB port, the built-in USB port being connected to a built-in module, the SOC module including a control unit and a USB_ID pin and a VBUS pin connected to the control unit, the method including: Acquire the level signals of the USB_ID pin and the VBUS pin; The switching switch is controlled to connect to multiple data ports according to the level signal. Specifically, when the VBUS pin is low, the switching switch is connected to the built-in USB port and disconnected from the Micro USB port to enable data transmission with the built-in module. When the VBUS pin is high, the switching switch is disconnected from the built-in USB port and connected to the Micro USB port. The level of the USB_ID pin determines whether the control unit communicates with the programming peripheral or with the OTG peripheral.

7. The method for switching data transmission paths according to claim 6, characterized in that, When the VBUS pin is high, the switch is disconnected from the internal USB port and connected to the Micro USB port. The control unit determines whether to communicate with the programming peripheral or with the OTG peripheral based on the level of the USB_ID pin, including: When the VBUS pin is high and the USB_ID pin is high, the switch is controlled to disconnect from the built-in USB port and connect to the Micro USB port, so as to enable data programming between the control unit and the programming peripheral.

8. The method for switching data transmission paths according to claim 6, characterized in that, When the VBUS pin is high, the switch is disconnected from the internal USB port and connected to the Micro USB port. The control unit determines whether to communicate with the programming peripheral or with the OTG peripheral based on the level of the USB_ID pin, including: When the VBUS pin is high and the USB_ID pin is low, the Micro USB port is powered on, and the switch is disconnected from the built-in USB port and connected to the Micro USB port to enable OTG data transmission between the control unit and the OTG peripheral.

Citation Information

Patent Citations

  • Method for switching master-slave state of electronic equipment and electronic equipment

    CN106066840A

  • Intelligent vehicle-mounted network connection terminal mainboard, intelligent vehicle-mounted network connection terminal and debugging method

    CN112416835A