WO2023195435A1 - Usb connection detection device and usb connection detection method - Google Patents

Usb connection detection device and usb connection detection method Download PDF

Info

Publication number
WO2023195435A1
WO2023195435A1 PCT/JP2023/013754 JP2023013754W WO2023195435A1 WO 2023195435 A1 WO2023195435 A1 WO 2023195435A1 JP 2023013754 W JP2023013754 W JP 2023013754W WO 2023195435 A1 WO2023195435 A1 WO 2023195435A1
Authority
WO
WIPO (PCT)
Prior art keywords
usb
voltage
terminal
vbus
connection
Prior art date
Application number
PCT/JP2023/013754
Other languages
French (fr)
Japanese (ja)
Inventor
莉奈 牧田
Original Assignee
スター精密株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by スター精密株式会社 filed Critical スター精密株式会社
Publication of WO2023195435A1 publication Critical patent/WO2023195435A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof

Definitions

  • the present invention relates to a USB connection detection device and a USB connection detection method, and is particularly suitable for use in a device and method for detecting that a USB-equipped device is connected via a USB cable.
  • USB Universal Serial Bus
  • type A type A
  • type B type B
  • type C type C
  • USB-A has a VBUS terminal for power supply, D- and D+ terminals for data transfer, and a GND terminal for grounding, and is widely used in, for example, personal computers and their peripheral devices.
  • USB-B has an ID terminal to recognize whether it operates as a host or a device, and it can be used as a host or a device depending on the purpose. It is widely used in certain smartphones and digital cameras.
  • USB-C was created with the purpose of enabling the connection of a host and a device with a connector with a single structure, and includes a CC terminal for configuration and a Super Speed terminal to increase communication speed. It has several terminals that USB-A and USB-B do not have. USB-C was developed to solve the problems of USB-A and USB-B, and is likely to become more popular in the future.
  • USB-A and USB-B connection is detected by monitoring the state of the voltage applied to the D- or D+ terminal.
  • the USB-A connector of an electronic device equipped with a USB-A connector hereinafter referred to as a USB-A equipped device
  • the USB-A connector of an electronic device equipped with a USB-B connector hereinafter referred to as a USB-B equipped device
  • USB-C connection is detected by monitoring the state of the voltage applied to the CC terminal.
  • the state of the CC terminal when not connected is determined by the USB-C port type.
  • Port types include those that function as a source host (DFP: Downstream Facing Port) by default, those that function as a sink device (UFP: Upstream Facing Port) by default, and the DRP (DRP) that has both source and sink capabilities. dual-role-power), function only as a source host, or function only as a sink device.
  • the port type at the time of connection is a source/host USB-C equipped device
  • the port type at the time of connection is a sink device.
  • the CC terminal of the source/host USB-C equipped device becomes High
  • the CC terminal of the sink device USB-C equipped device becomes Low, indicating that the connection has been made. be done.
  • power is supplied from the USB-C equipped device on the source side to the USB-C equipped device on the sink side via the VBUS terminal.
  • USB-C is designed with consideration to connection compatibility with USB-A and USB-B, which have been widely used up until now.
  • connection compatibility is not guaranteed for all combinations, and there is a problem in that connections may not be detected.
  • USB-C equipped device when connecting a USB-C equipped device and a USB-A equipped device, from the perspective of the USB-C equipped device, the USB-A equipped device will appear as if it were a USB-C equipped device with the CC terminal set to High. appear. Therefore, if the port type when a USB-C equipped device is connected is either sink device or DRP, by monitoring the CC terminal, it is possible to determine whether a USB-C equipped device whose port type is source or host is connected. It is possible to detect a connection with a USB-A equipped device.
  • USB-C equipped device when connecting a USB-C equipped device is source/host, both the USB-C equipped device and the USB-A equipped device will act as source/host, so the USB-C equipped device will be connected to the CC terminal. Even if I monitor it, I cannot detect a connection with a USB-A equipped device.
  • the USB-B equipped device looks like a USB-C equipped device with the CC terminal set to Low. appear. Therefore, if the port type when a USB-C equipped device is connected is either source/host or DRP, by monitoring the CC terminal, it is possible to determine whether a USB-C equipped device whose port type is a sink device is connected. It is possible to detect a connection with a USB-B equipped device. However, if the port type when the USB-C equipped device is connected is a sink device, the USB-C equipped device cannot detect the connection with the USB-B equipped device even if it monitors the CC terminal.
  • USB-C When connecting devices equipped with USB-C, it is possible to detect the connection by monitoring the CC terminals. However, if the port type of one USB-C equipped device is DRP and the other USB-C equipped device does not support quick charging USB-PD (Power Delivery), the DRP type USB-C equipped device There is a problem in that it is not possible to fix whether the device operates as a source host or as a sink device.
  • Patent Document 2 there is also known a technique that allows a user to intentionally switch at any timing whether an electronic device functions as a source or a sink (see, for example, Patent Document 2).
  • the electronic device described in Patent Document 2 displays a notification screen on the display unit indicating whether the electronic device itself is functioning as a source or a sink in relation to a connected electronic device.
  • the user who confirms this notification screen can switch the source/sink of the electronic device by operating the touch panel or operation buttons.
  • the technology described in Patent Document 2 is only capable of switching source/sink according to the user's wishes in a state where two USB-equipped devices are already connected and both are operating as a source or sink. It is not a technology related to connection detection.
  • the present invention has been made to solve the above-mentioned problems, and makes it possible to detect connections in more combinations when connecting Type C USB-equipped devices with other USB-equipped devices.
  • the purpose is to
  • the present invention has a type C port type that defaults to a source/host USB device when detecting a connection between the device itself and another device that is a USB device. , monitors the voltage of the VBUS terminal for power supply of the own machine, determines whether another machine is connected according to the monitored voltage, and also monitors the voltage of the CC terminal for the configuration of the own machine and the other machine. monitors the voltage of the CC terminal for configuration, and determines whether another device is connected according to the monitored voltage. When the connection of another device is detected by monitoring the voltage of the VBUS terminal, the port type of the device is automatically switched from source/host to sink device.
  • the voltage of the VBUS terminal is It is possible to detect the connection of other devices by confirming that the level is high.
  • the port type of the device is automatically switched from source host to sink device, so power supply and communication operations can be performed without problems with the type A USB device acting as the source host. be able to.
  • the voltage at the CC terminal of the device will be It is possible to detect the connection of another device by confirming that the voltage at the CC terminal of the other device is high and the voltage at the CC terminal of the other device is low.
  • the other device Connections can be detected in any of the cases of type A, type B, and type C, and connections can be detected in more combinations.
  • FIG. 1 is a diagram showing a USB-equipped device (own device) on which the USB connection detection device of the present embodiment is mounted and another USB-equipped device (other device) connected thereto;
  • FIG. 1 is a diagram illustrating an example of the hardware configuration of a USB-C equipped device in which a USB connection detection device according to the present embodiment is installed.
  • FIG. 2 is a block diagram showing an example of a functional configuration of a USB connection detection device according to the present embodiment.
  • 3 is a flowchart illustrating an example of the operation of the USB connection detection device according to the present embodiment.
  • FIG. 3 is a diagram for explaining a function of reducing the size of the font to save paper usage.
  • FIG. 1 shows a USB-equipped device (hereinafter referred to as own device) on which the USB connection detection device of this embodiment is installed and another USB-equipped device connected to this device (hereinafter referred to as other device). It is a diagram.
  • the USB-equipped device 100C on which the USB connection detection device of the present embodiment is installed is a DFP USB-C-equipped device with type C and port type that functions as a source/host by default. Any type A USB-A equipped device 101A, type B USB-B equipped device 101B, or type C USB-C equipped device 101C can be connected to the USB-C equipped device 100C. In particular, this embodiment is characterized in that connection with the type A USB-A equipped device 101A can be detected.
  • FIG. 2 is a diagram illustrating a configuration example including hardware of a USB-C equipped device 100C in which the USB connection detection device of this embodiment is mounted.
  • the USB-C equipped device 100C of this embodiment includes a dual-core microcomputer having two CPU cores. Two operating systems (OS) run under each CPU core. Furthermore, communication interfaces such as SPI (Serial Peripheral Interface) and UART (Universal Asynchronous Receiver/Transmitter), ADC (Analog to Digital Converter), and various drivers operate under each OS. A USB driver is one of these various drivers.
  • the USB connection detection device of this embodiment is realized by the operation of this USB driver.
  • FIG. 3 is a block diagram showing an example of the functional configuration of the USB connection detection device 10 according to the present embodiment.
  • the USB connection detection device 10 of this embodiment includes a VBUS monitoring section 11, a CC monitoring section 12, and a port type switching section 13 as functional configurations.
  • the USB connection detection device 10 of this embodiment uses these functional blocks 11 to 13 to connect a USB-C equipped device 100C (in the following description, may be referred to as own device 100C) in which the USB connection detection device 10 is installed. ) and another device, which is either the USB-A equipped device 101A, the USB-B equipped device 101B, or the USB-C equipped device 101C.
  • the above functional blocks 11 to 13 are realized by operating a USB driver program stored in a storage medium such as RAM, ROM, hard disk, or semiconductor memory. Note that the functional blocks 11 to 13 can also be configured by hardware or a DSP (Digital Signal Processor).
  • a USB driver program stored in a storage medium such as RAM, ROM, hard disk, or semiconductor memory.
  • the functional blocks 11 to 13 can also be configured by hardware or a DSP (Digital Signal Processor).
  • the VBUS monitoring unit 11 monitors the voltage of the power supply VBUS terminal of the USB connector 20 of the device 100C, and determines whether the USB-A equipped device 101A is connected according to the monitored voltage.
  • the USB-A equipped device 101A is connected as another device to the own device 100C
  • power is supplied from the USB-A equipped device 101A to the own device 100C via the VBUS terminal, so the voltage of the VBUS terminal becomes High. (high level). Therefore, the VBUS monitoring unit 11 monitors the voltage of the VBUS terminal, and when the monitored voltage is High, detects that the USB-A equipped device 101A is connected.
  • the VBUS monitoring unit 11 periodically checks the voltage of the VBUS terminal, and detects that the USB-A equipped device 101A is connected when the voltage is High. Note that although it is expressed here as "USB-A equipped device 101A is connected,” it is only necessary to detect that another device is connected to the own device 100C, and the USB type of the other device connected is It is not necessary to specify that it is type A.
  • the CC monitoring unit 12 monitors the voltage of the CC terminal for configuration of the USB connector 20 of the own device 100C and the voltage of the CC terminal for configuration of other devices, and determines whether the other device is connected according to the monitored voltage. Determine whether or not it has been done.
  • the CC monitoring unit 12 checks the voltage of the CC terminal when the connection of another device (USB-A equipped device 101A) is not detected by the VBUS monitoring unit 11, and determines whether or not another device is connected according to the voltage. Determine.
  • the own device 100C is a USB-C equipped device with the default port type as source/host
  • the voltage of the CC terminal of the own device 100C is pulled up to High (high level).
  • the USB-B equipped device 101B is connected to this own device 100C as another device, the USB-B equipped device 101B does not have a CC terminal when viewed from the own device 100C. It looks like a USB-C device with a low terminal.
  • the voltage of the CC terminal of the USB-C equipped device 101C is Low (low level). is pulled down.
  • the CC monitoring unit 12 confirms that the voltage of the CC terminal of the own device 100C is High and the voltage of the CC terminal of the other device is Low, and then checks the other device (USB-B equipped device 101B or USB-C equipped device 101B). It is possible to detect that any of the devices 101C) is connected.
  • the CC monitoring unit 12 only needs to be able to detect that another device is connected to the own device 100C, and it is necessary to specify that the USB type of the connected device is type B or type C. It's not a thing.
  • the port type switching unit 13 automatically switches the port type of the own device 100C from the source host to the sink device when the VBUS monitoring unit 11 detects the connection of another device.
  • the connection of another device is detected by the VBUS monitoring unit 11, since the other device is the USB-A equipped device 101A, both the own device 100C and the other device's USB-A equipped device 101A try to operate as the source host. . In this state, it is not possible to supply power via the VBUS terminal or to communicate via the D- and D+ terminals (not shown in FIG. 3). Therefore, the port type switching unit 13 automatically switches the port type of the self-device 100C from source/host to sink/device, thereby making it possible to supply power and communicate with the USB-A equipped device 101A. do.
  • the port type switching unit 13 automatically switches the port type of the self-device 100C from source/host to sink/device, thereby making it possible to supply power and communicate with the USB-A equipped device 101A. do.
  • FIG. 4 is a flowchart showing an example of the operation of the USB connection detection device 10 according to the present embodiment configured as described above. The flowchart shown in FIG. 4 is executed periodically at a constant cycle while the USB connection detection device 10 is powered on.
  • the VBUS monitoring unit 11 determines whether the voltage at the VBUS terminal is High (step S1). Here, if the voltage of the VBUS terminal is High, the VBUS monitoring unit 11 detects that another device (USB-A equipped device 101A) is connected to the own device 100C (step S2). Then, the port type switching unit 13 automatically switches the port type of the device 100C from the source host to the sink device (step S3). This completes the operation of the flowchart shown in FIG.
  • step S1 if it is determined in step S1 that the voltage of the VBUS terminal is not High, that is, if the connection of another device is not detected by the VBUS monitoring section 11, the CC monitoring section 12 detects the voltage at the CC terminal of the own device 100C. It is determined whether the voltage at the CC terminal of the other device is High and the voltage at the CC terminal of the other device is Low (step S4). When the voltage of the CC terminal is in this state, the CC monitoring unit 12 detects that another device (USB-B equipped device 101B or USB-C equipped device 101C) is connected to the own device 100C. Detected (step S5). This completes the operation of the flowchart shown in FIG.
  • the CC monitoring unit 12 determines that no other device is connected to the own device 100C (step S6), and the The operation of the flowchart shown ends. For example, if no other device is connected to the device 100C, the pull-up voltage of the CC terminal of the device 100C is visible, so the voltage at the CC terminal will be High.
  • the USB connection detection device 10 of the present embodiment when the own device is type C and the default port type is the source/host USB-C equipped device 100C, the other device is type A.
  • the USB-A equipped device 101A When the USB-A equipped device 101A is connected, it is possible to detect the connection of another device by confirming that the voltage at the VBUS terminal is at a high level.
  • the port type of own device 100C is automatically switched from source host to sink device, so power supply and communication operations can be performed with type A USB-A equipped device 101A acting as source host. It can be executed without any problem.
  • connection with other devices is disconnected after the port type of own device 100C is automatically switched from source/host to sink device, that is, if the voltage of the VBUS terminal is no longer at a high level, It is a good idea to change the port type of the device 100C back to the source host again and prepare for the next connection. At that time, by monitoring the voltage of the VBUS terminal again, it becomes possible to perform the same connection monitoring as described above.
  • the other device is the type B USB-B device 101B or the type C USB-C device 101C ( If the port type is sink device or DRP) is connected, the voltage of the CC terminal of own device 100C is high level, and the voltage of the CC terminal of the other device (USB-B equipped device 101B or USB-C equipped device 101C) is connected. It is possible to detect the connection of other devices by confirming that the voltage is at a low level.
  • the USB-C equipped device 100C (own device) of the source/host with type C and the port type by default is connected to the other USB equipped devices 101A to 101C (other devices).
  • the connection can be detected regardless of whether the other device is type A, type B, or type C, and connections can be detected in more combinations.
  • the port type of the own USB-C equipped device 100C is not DRP but source/host, even if a USB-C equipped device that is not compatible with quick charging USB-PD is connected as another device, The problem that it is not possible to fix whether the device 100C operates as a source host or a sink device does not occur.
  • the CC monitoring unit 12 determines that the voltage of the CC terminal of the own machine 100C is High and the voltage of the CC terminal of the other machine is not Low, the other machine
  • the present invention is not limited to this. For example, if it is confirmed that the voltage of the CC terminal of own machine 100C is High and the voltage of the CC terminal of other machine is also High, then the voltage of the other machine (USB- The port type of the device 100C may be automatically switched from the source host to the sink device upon detecting that the device 100C is connected.
  • the own device is a USB-C equipped device 100C of type C and the port type is source/host by default, even if another device functions only as a source/host of type C, the own device 100C can function as a sink device, so it can be connected without any problems.
  • the voltage of the CC terminal may be set to a low level.
  • USB-C equipped device 100C on which the USB connection detection device 10 of the present embodiment is installed and the other USB-equipped devices 101A to 101C connected to the USB-C equipped device 100C are different types of electronic devices. It's okay.
  • a receipt printer can be used as the USB-C equipped device 100C, and a host device such as a POS terminal equipped with USB-A can be connected to this.
  • the USB connection detection device 10 installed in the receipt printer can detect the connection with the host device by checking the voltage of the VBUS terminal. After the connection is detected, the host device can supply power to the receipt printer and transmit a predetermined control signal to control the operation of the receipt printer.
  • a receipt printer has the following functions, and the host device can control the operation of this function.
  • a mode may be provided in which a line of a character portion (colored dot portion) is reduced in the vertical direction (paper feeding direction) by a predetermined calculation.
  • a reduction mode may be used in which lines in space portions (colorless dot portions) are thinned out in the vertical direction (paper feeding direction).
  • there may be a mode in which both reductions in FIGS. 5(a) and 5(b) are used together.
  • the 3rd, 6th, 9th, 16th, 18th, and 19th lines are thinned out by a predetermined calculation, and the 11th and 12th lines are thinned out. Reduction is achieved by compositing into one line.
  • the baseline shown in the 20th line of Figure 5(b) is such that even if there are characters of different sizes in a string of characters in one line, by aligning their positions, the conversion will not look strange. It's good to do that.
  • Standard printing function using trigger button This is a function that stores standard images (images of tamper-proof labels, store logo labels, etc.) in the printer in advance, and prints the standard images by pressing the trigger button provided on the printer. For example, a stylized image can be sent from a host device to a printer for storage.
  • multiple functions may be assigned to the trigger button. For example, you can assign three functions to a trigger button, and print a logo + full paper cut (first function), print a logo + partially cut paper (second function), and print a logo + paper cut (second function).
  • Simple paper feeding (third function) may be settable. For example, when the trigger button is pressed once, the first function is executed, when the trigger button is pressed twice in succession, the second function is executed, and when the trigger button is pressed three times in succession, the second function is executed. performs the third function. Further, all of the first to third functions may be executed when the trigger button is continuously pressed and held for a predetermined period of time or more.
  • the trigger button may be enabled/disabled by operating a user interface displayed on the printer panel. For example, if the trigger button is set to be disabled, paper is fed by pressing the trigger button. On the other hand, when the trigger button is set to be valid, any one of the above-mentioned first function, second function, or third function is executed depending on the operating state of the trigger button.
  • USB connection detection device 11
  • VBUS monitoring section 12
  • Port type switching section 100C USB-C equipped device (own device) 101A USB-A equipped device (other device) 101B USB-B equipped device (other device) 101C USB-C equipped device (other devices)

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)
  • Power Sources (AREA)

Abstract

The present invention makes it possible to detect the connection of a USB-mounted apparatus with more combinations. This USB connection detection device comprises: a VBUS monitoring unit 11 which determines whether another USB-mounted apparatus (another machine) is connected, according to the voltage of a VBUS terminal of a USB-C mounted apparatus (host machine) which is of type C and has a port type of source/host; a CC monitoring unit 12 which determines whether another machine is connected, according to the voltage of a CC terminal of the host machine and the other machine; and a port type switching unit 13 which automatically switches the port type of the host machine into a sync device when the connection of the other machine has been detected by the monitoring of the voltage of the VBUS terminal, wherein it is possible to detect the connection of a USB-A mounted apparatus by monitoring the voltage of the VBUS terminal, it is possible to perform power supply and communication by switching the port type into sync/device, and it is possible to detect the connection of a USB-B mounted apparatus or a USB-C mounted apparatus by monitoring the CC terminal.

Description

USB接続検知装置およびUSB接続検知方法USB connection detection device and USB connection detection method
 本発明は、USB接続検知装置およびUSB接続検知方法に関し、特に、USB搭載機器がUSBケーブルを介して接続されたことを検知するための装置および方法に用いて好適なものである。 The present invention relates to a USB connection detection device and a USB connection detection method, and is particularly suitable for use in a device and method for detecting that a USB-equipped device is connected via a USB cable.
 現在、シリアル通信インタフェースの1つであるUSB(Universal Serial Bus)が多くの電子機器に搭載されている。USBケーブルを介して2つの電子機器のUSBコネクタ間を接続すると、ソース側の機器からシンク側の機器に電源が供給されるため、シンク側の機器にACアダプタ等を介して電源を供給することが不要である。USBには、タイプA、タイプBおよびタイプCの3つのタイプが存在する。以下では、これらUSBの3つのタイプをそれぞれUSB-A、USB-B、USB-Cと表記する。 Currently, a USB (Universal Serial Bus), which is one of the serial communication interfaces, is installed in many electronic devices. When connecting the USB connectors of two electronic devices via a USB cable, power is supplied from the source device to the sink device, so power must be supplied to the sink device via an AC adapter, etc. is not necessary. There are three types of USB: type A, type B, and type C. Below, these three types of USB will be referred to as USB-A, USB-B, and USB-C, respectively.
 USB-Aは、電源供給用のVBUS端子、データ転送用のD-端子とD+端子、および接地用のGND端子を有するものであり、例えばパーソナルコンピュータやその周辺機器等に広く使われている。USB-Bは、USB-Aの4つの端子に加え、ホストまたはデバイスの何れとして動作するかを認識するためのID端子を有するものであり、用途によってホストになったりデバイスになったりすることのあるスマートフォンやデジタルカメラ等に広く使われている。 The USB-A has a VBUS terminal for power supply, D- and D+ terminals for data transfer, and a GND terminal for grounding, and is widely used in, for example, personal computers and their peripheral devices. In addition to the four terminals of USB-A, USB-B has an ID terminal to recognize whether it operates as a host or a device, and it can be used as a host or a device depending on the purpose. It is widely used in certain smartphones and digital cameras.
 USB-Cは、単一の構造のコネクタでホストおよびデバイスの接続を可能にすることを目的として作られたものであり、コンフィギュレーション用のCC端子や、通信速度を上げるためのSuper Speed端子などを含めてUSB-A,Bにはない幾つかの端子を有している。USB-Cは、USB-A,Bの問題点を解消するために開発されたものであり、今後ますます普及していく可能性がある。 USB-C was created with the purpose of enabling the connection of a host and a device with a connector with a single structure, and includes a CC terminal for configuration and a Super Speed terminal to increase communication speed. It has several terminals that USB-A and USB-B do not have. USB-C was developed to solve the problems of USB-A and USB-B, and is likely to become more popular in the future.
 USBでは、2つの電子機器をUSBケーブルで接続すると、接続されたことが自動で検知され、通信が可能な状態となる。USB-AおよびUSB-Bでは、D-端子またはD+端子に印加される電圧の状態を監視することによって接続が検知される。例えば、USB-Aコネクタを搭載した電子機器(以下、USB-A搭載機器という)のUSB-Aコネクタと、USB-Bコネクタを搭載した電子機器(以下、USB-B搭載機器という)のUSB-BコネクタとをUSBケーブルを介して接続すると、USB-A搭載機器からUSB-B搭載機器にVBUS端子を介して電源が供給され、これに応じてUSB-B搭載機器のD+端子がHighにプルアップされることにより、接続されたことが検知される。 With USB, when two electronic devices are connected with a USB cable, the connection is automatically detected and communication becomes possible. For USB-A and USB-B, connection is detected by monitoring the state of the voltage applied to the D- or D+ terminal. For example, the USB-A connector of an electronic device equipped with a USB-A connector (hereinafter referred to as a USB-A equipped device) and the USB-A connector of an electronic device equipped with a USB-B connector (hereinafter referred to as a USB-B equipped device) When connected to the B connector via a USB cable, power is supplied from the USB-A device to the USB-B device via the VBUS terminal, and in response, the D+ terminal of the USB-B device is pulled to High. When the connection is uploaded, it is detected that the connection has been made.
 一方、USB-Cでは、CC端子に印加される電圧の状態を監視することによって接続が検知される。非接続時のCC端子の状態は、USB-Cのポートタイプによって決まる。ポートタイプとは、デフォルトではソース・ホスト(DFP:Downstream Facing Port)として機能するもの、デフォルトではシンク・デバイス(UFP:Upstream Facing Port)として機能するもの、ソースとシンクの両方の能力を持つDRP(Dual-Role-Power)、ソース・ホストのみとして機能するもの、シンク・デバイスのみとして機能するものの何れかである。例えば、USB-Cコネクタを搭載した電子機器(以下、USB-C搭載機器という)のうち、接続時のポートタイプがソース・ホストのUSB-C搭載機器と、接続時のポートタイプがシンク・デバイスのUSB-C搭載機器を接続すると、ソース・ホストのUSB-C搭載機器のCC端子がHigh、シンク・デバイスのUSB-C搭載機器のCC端子がLowとなることにより、接続されたことが検知される。接続が検知されると、ソース側のUSB-C搭載機器からシンク側のUSB-C搭載機器にVBUS端子を介して電源が供給される。 On the other hand, with USB-C, connection is detected by monitoring the state of the voltage applied to the CC terminal. The state of the CC terminal when not connected is determined by the USB-C port type. Port types include those that function as a source host (DFP: Downstream Facing Port) by default, those that function as a sink device (UFP: Upstream Facing Port) by default, and the DRP (DRP) that has both source and sink capabilities. dual-role-power), function only as a source host, or function only as a sink device. For example, among electronic devices equipped with a USB-C connector (hereinafter referred to as USB-C equipped devices), the port type at the time of connection is a source/host USB-C equipped device, and the port type at the time of connection is a sink device. When a USB-C equipped device is connected, the CC terminal of the source/host USB-C equipped device becomes High, and the CC terminal of the sink device USB-C equipped device becomes Low, indicating that the connection has been made. be done. When the connection is detected, power is supplied from the USB-C equipped device on the source side to the USB-C equipped device on the sink side via the VBUS terminal.
 USB-Cは、これまで多く使われてきたUSB-A,Bとの接続互換性も考慮して設計されている。しかしながら、全ての組み合わせで接続互換性が保証されているわけではなく、接続を検知できない場合があるという問題があった。 USB-C is designed with consideration to connection compatibility with USB-A and USB-B, which have been widely used up until now. However, connection compatibility is not guaranteed for all combinations, and there is a problem in that connections may not be detected.
 例えば、USB-C搭載機器とUSB-A搭載機器とを接続する場合、USB-C搭載機器から見て、USB-A搭載機器はCC端子がHighのUSB-C搭載機器であるかのように見える。そのため、USB-C搭載機器の接続時のポートタイプがシンク・デバイスまたはDRPの何れかであれば、CC端子を監視することにより、ポートタイプがソース・ホストのUSB-C搭載機器が接続されたかのようにUSB-A搭載機器との接続を検知することが可能である。しかしながら、USB-C搭載機器の接続時のポートタイプがソース・ホストの場合、USB-C搭載機器とUSB-A搭載機器との双方がソース・ホストとして振る舞うため、USB-C搭載機器はCC端子を監視してもUSB-A搭載機器との接続を検知することができない。 For example, when connecting a USB-C equipped device and a USB-A equipped device, from the perspective of the USB-C equipped device, the USB-A equipped device will appear as if it were a USB-C equipped device with the CC terminal set to High. appear. Therefore, if the port type when a USB-C equipped device is connected is either sink device or DRP, by monitoring the CC terminal, it is possible to determine whether a USB-C equipped device whose port type is source or host is connected. It is possible to detect a connection with a USB-A equipped device. However, if the port type when connecting a USB-C equipped device is source/host, both the USB-C equipped device and the USB-A equipped device will act as source/host, so the USB-C equipped device will be connected to the CC terminal. Even if I monitor it, I cannot detect a connection with a USB-A equipped device.
 また、USB-C搭載機器とUSB-B搭載機器とを接続する場合、USB-C搭載機器から見て、USB-B搭載機器はCC端子がLowのUSB-C搭載機器であるかのように見える。そのため、USB-C搭載機器の接続時のポートタイプがソース・ホストまたはDRPの何れかであれば、CC端子を監視することにより、ポートタイプがシンク・デバイスのUSB-C搭載機器が接続されたかのようにUSB-B搭載機器との接続を検知することが可能である。しかしながら、USB-C搭載機器の接続時のポートタイプがシンク・デバイスの場合は、USB-C搭載機器はCC端子を監視してもUSB-B搭載機器との接続を検知することができない。 Also, when connecting a USB-C equipped device and a USB-B equipped device, from the perspective of the USB-C equipped device, the USB-B equipped device looks like a USB-C equipped device with the CC terminal set to Low. appear. Therefore, if the port type when a USB-C equipped device is connected is either source/host or DRP, by monitoring the CC terminal, it is possible to determine whether a USB-C equipped device whose port type is a sink device is connected. It is possible to detect a connection with a USB-B equipped device. However, if the port type when the USB-C equipped device is connected is a sink device, the USB-C equipped device cannot detect the connection with the USB-B equipped device even if it monitors the CC terminal.
 USB-C搭載機器どうしを接続する場合であれば、CC端子の監視によって接続を検知することは可能である。しかしながら、一方のUSB-C搭載機器のポートタイプがDRPで、他方のUSB-C搭載機器が急速充電のUSB-PD(Power Delivery)に非対応の場合は、DRPタイプのUSB-C搭載機器がソース・ホストまたはシンク・デバイスの何れで動作するかを固定できないという問題がある。 When connecting devices equipped with USB-C, it is possible to detect the connection by monitoring the CC terminals. However, if the port type of one USB-C equipped device is DRP and the other USB-C equipped device does not support quick charging USB-PD (Power Delivery), the DRP type USB-C equipped device There is a problem in that it is not possible to fix whether the device operates as a source host or as a sink device.
 なお、従来、USBポートのVBUS端子電圧が高レベルであればUSBポートにホスト機器が接続されている場合に対応した処理を行う一方、VBUS端子電圧が低レベルであればUSBポートにホスト機器が接続されていない場合に対応した処理を行うようにしたデータ処理装置が知られている(例えば、特許文献1参照)。しかしながら、この特許文献1に記載の技術では、VBUS端子電圧の低レベルが検出された場合には、実際にはUSBポートに何らかのUSB搭載機器が接続されていてもそれを検知することができないという問題がある。 Conventionally, if the VBUS terminal voltage of the USB port is at a high level, processing corresponding to the case where a host device is connected to the USB port is performed, whereas if the VBUS terminal voltage is at a low level, the process corresponding to the case where the host device is connected to the USB port is performed. A data processing device is known that performs processing corresponding to a case where the device is not connected (for example, see Patent Document 1). However, with the technology described in Patent Document 1, if a low level of VBUS terminal voltage is detected, it cannot be detected even if some USB device is actually connected to the USB port. There's a problem.
 また、電子機器をソースとして機能させるか、またはシンクとして機能させるかを、ユーザが任意のタイミングで意図的に切り替えることができるようにした技術も知られている(例えば、特許文献2参照)。この特許文献2に記載の電子機器は、自分自身が接続先の電子機器との関係でソースとして機能しているかシンクとして機能しているかを示す通知画面を表示部に表示する。この通知画面を確認したユーザは、タッチパネルや操作ボタンを操作することにより、電子機器のソース/シンクを切り替えることが可能である。しかしながら、この特許文献2に記載の技術は、既に2つのUSB搭載機器が接続されて両者がソースまたはシンクとして動作している状態において、ユーザの希望に応じてソース/シンクを切り替えることができるのみであり、接続の検知に関する技術ではない。 Additionally, there is also known a technique that allows a user to intentionally switch at any timing whether an electronic device functions as a source or a sink (see, for example, Patent Document 2). The electronic device described in Patent Document 2 displays a notification screen on the display unit indicating whether the electronic device itself is functioning as a source or a sink in relation to a connected electronic device. The user who confirms this notification screen can switch the source/sink of the electronic device by operating the touch panel or operation buttons. However, the technology described in Patent Document 2 is only capable of switching source/sink according to the user's wishes in a state where two USB-equipped devices are already connected and both are operating as a source or sink. It is not a technology related to connection detection.
特開2009-116724号公報JP2009-116724A 特許6900232号公報Patent No. 6900232
 本発明は、以上のような問題を解決するために成されたものであり、タイプCのUSB搭載機器と他のUSB搭載機器とを接続する場合に、より多くの組み合わせで接続を検知できるようにすることを目的とする。 The present invention has been made to solve the above-mentioned problems, and makes it possible to detect connections in more combinations when connecting Type C USB-equipped devices with other USB-equipped devices. The purpose is to
 上記した課題を解決するために、本発明では、タイプCでポートタイプがデフォルトでソース・ホストのUSB搭載機器である自機と他のUSB搭載機器である他機との接続を検知する際に、自機の電源供給用のVBUS端子の電圧を監視し、当該監視した電圧に応じて他機が接続されたか否かを判定するとともに、自機のコンフィギュレーション用のCC端子の電圧および他機のコンフィギュレーション用のCC端子の電圧を監視し、当該監視した電圧に応じて他機が接続されたか否かを判定する。そして、VBUS端子の電圧の監視により他機の接続が検知された場合には、自機のポートタイプをソース・ホストからシンク・デバイスに自動的に切り替えるようにしている。 In order to solve the above-mentioned problems, the present invention has a type C port type that defaults to a source/host USB device when detecting a connection between the device itself and another device that is a USB device. , monitors the voltage of the VBUS terminal for power supply of the own machine, determines whether another machine is connected according to the monitored voltage, and also monitors the voltage of the CC terminal for the configuration of the own machine and the other machine. monitors the voltage of the CC terminal for configuration, and determines whether another device is connected according to the monitored voltage. When the connection of another device is detected by monitoring the voltage of the VBUS terminal, the port type of the device is automatically switched from source/host to sink device.
 上記のように構成した本発明によれば、タイプCでポートタイプがデフォルトでソース・ホストの自機に対して他機としてタイプAのUSB搭載機器が接続された場合は、VBUS端子の電圧が高レベルであることを確認して他機の接続を検知することが可能である。この場合、自機のポートタイプがソース・ホストからシンク・デバイスに自動的に切り替えられるので、ソース・ホストとして振る舞うタイプAのUSB搭載機器との間で電源供給および通信の動作を問題なく実行することができる。一方、タイプCでポートタイプがデフォルトでソース・ホストの自機に対して他機としてタイプBのUSB搭載機器またはタイプCのUSB搭載機器が接続された場合は、自機のCC端子の電圧が高レベル、他機のCC端子の電圧が低レベルであることを確認して他機の接続を検知することが可能である。以上のように、本発明によれば、タイプCでポートタイプがデフォルトでソース・ホストのUSB搭載機器(自機)と他のUSB搭載機器(他機)とを接続する場合に、他機がタイプA、タイプBおよびタイプCの何れの場合であっても接続を検知することができ、より多くの組み合わせで接続を検知することができる。 According to the present invention configured as described above, when a USB-equipped device of type A is connected as another device to the source/host device with type C and port type as default, the voltage of the VBUS terminal is It is possible to detect the connection of other devices by confirming that the level is high. In this case, the port type of the device is automatically switched from source host to sink device, so power supply and communication operations can be performed without problems with the type A USB device acting as the source host. be able to. On the other hand, if the port type is default for type C and a type B USB device or type C USB device is connected to the source/host device as another device, the voltage at the CC terminal of the device will be It is possible to detect the connection of another device by confirming that the voltage at the CC terminal of the other device is high and the voltage at the CC terminal of the other device is low. As described above, according to the present invention, when connecting a source/host USB-equipped device (own device) with a port type of type C by default and another USB-equipped device (other device), the other device Connections can be detected in any of the cases of type A, type B, and type C, and connections can be detected in more combinations.
本実施形態のUSB接続検知装置が実装されるUSB搭載機器(自機)およびこれに接続される他のUSB搭載機器(他機)を示す図である。1 is a diagram showing a USB-equipped device (own device) on which the USB connection detection device of the present embodiment is mounted and another USB-equipped device (other device) connected thereto; FIG. 本実施形態のUSB接続検知装置が実装されるUSB-C搭載機器のハードウェア構成例を示す図である。1 is a diagram illustrating an example of the hardware configuration of a USB-C equipped device in which a USB connection detection device according to the present embodiment is installed. 本実施形態によるUSB接続検知装置の機能構成例を示すブロック図である。FIG. 2 is a block diagram showing an example of a functional configuration of a USB connection detection device according to the present embodiment. 本実施形態によるUSB接続検知装置の動作例を示すフローチャートである。3 is a flowchart illustrating an example of the operation of the USB connection detection device according to the present embodiment. フォントを小さくして用紙の使用量を節約する機能を説明するための図である。FIG. 3 is a diagram for explaining a function of reducing the size of the font to save paper usage.
 以下、本発明の一実施形態を図面に基づいて説明する。図1は、本実施形態のUSB接続検知装置が実装されるUSB搭載機器(以下、これを自機という)およびこれに接続される他のUSB搭載機器(以下、これを他機という)を示す図である。 Hereinafter, one embodiment of the present invention will be described based on the drawings. FIG. 1 shows a USB-equipped device (hereinafter referred to as own device) on which the USB connection detection device of this embodiment is installed and another USB-equipped device connected to this device (hereinafter referred to as other device). It is a diagram.
 本実施形態のUSB接続検知装置が実装されるUSB搭載機器100Cは、タイプCでポートタイプがデフォルトでソース・ホストとして機能するDFPのUSB-C搭載機器である。USB-C搭載機器100Cには、タイプAのUSB-A搭載機器101A、タイプBのUSB-B搭載機器101BまたはタイプCのUSB-C搭載機器101Cの何れも接続することが可能である。特に、本実施形態では、タイプAのUSB-A搭載機器101Aとの接続を検知可能にした点に特徴を有する。 The USB-equipped device 100C on which the USB connection detection device of the present embodiment is installed is a DFP USB-C-equipped device with type C and port type that functions as a source/host by default. Any type A USB-A equipped device 101A, type B USB-B equipped device 101B, or type C USB-C equipped device 101C can be connected to the USB-C equipped device 100C. In particular, this embodiment is characterized in that connection with the type A USB-A equipped device 101A can be detected.
 図2は、本実施形態のUSB接続検知装置が実装されるUSB-C搭載機器100Cのハードウェアを含む構成例を示す図である。図2に示すように、本実施形態のUSB-C搭載機器100Cは、CPUコアを2つ有するデュアルコアマイコンを備えている。それぞれのCPUコアのもとで2つのオペレーティングシステム(OS)が動作する。また、それぞれのOSのもとで、SPI(Serial Peripheral Interface)やUART(Universal Asynchronous Receiver/Transmitter)などの通信インタフェース、ADC(Analog to Digital Converter)および各種ドライバが動作する。この各種ドライバの1つとして、USBドライバが存在する。本実施形態のUSB接続検知装置は、このUSBドライバの動作によって実現されるものである。 FIG. 2 is a diagram illustrating a configuration example including hardware of a USB-C equipped device 100C in which the USB connection detection device of this embodiment is mounted. As shown in FIG. 2, the USB-C equipped device 100C of this embodiment includes a dual-core microcomputer having two CPU cores. Two operating systems (OS) run under each CPU core. Furthermore, communication interfaces such as SPI (Serial Peripheral Interface) and UART (Universal Asynchronous Receiver/Transmitter), ADC (Analog to Digital Converter), and various drivers operate under each OS. A USB driver is one of these various drivers. The USB connection detection device of this embodiment is realized by the operation of this USB driver.
 図3は、本実施形態によるUSB接続検知装置10の機能構成例を示すブロック図である。図3に示すように、本実施形態のUSB接続検知装置10は、機能構成として、VBUS監視部11、CC監視部12およびポートタイプ切替部13を備えている。本実施形態のUSB接続検知装置10は、これらの機能ブロック11~13により、当該USB接続検知装置10が実装されたUSB-C搭載機器100C(以下の説明において、自機100Cと記すこともある)と、USB-A搭載機器101A、USB-B搭載機器101BまたはUSB-C搭載機器101Cの何れかである他機との接続を検知する。 FIG. 3 is a block diagram showing an example of the functional configuration of the USB connection detection device 10 according to the present embodiment. As shown in FIG. 3, the USB connection detection device 10 of this embodiment includes a VBUS monitoring section 11, a CC monitoring section 12, and a port type switching section 13 as functional configurations. The USB connection detection device 10 of this embodiment uses these functional blocks 11 to 13 to connect a USB-C equipped device 100C (in the following description, may be referred to as own device 100C) in which the USB connection detection device 10 is installed. ) and another device, which is either the USB-A equipped device 101A, the USB-B equipped device 101B, or the USB-C equipped device 101C.
 上記機能ブロック11~13は、RAMやROM、ハードディスクまたは半導体メモリ等の記憶媒体に記憶されたUSBドライバのプログラムが動作することによって実現される。なお、上記機能ブロック11~13は、ハードウェアまたはDSP(Digital Signal Processor)により構成することも可能である。 The above functional blocks 11 to 13 are realized by operating a USB driver program stored in a storage medium such as RAM, ROM, hard disk, or semiconductor memory. Note that the functional blocks 11 to 13 can also be configured by hardware or a DSP (Digital Signal Processor).
 VBUS監視部11は、自機100CのUSBコネクタ20が有する電源供給用のVBUS端子の電圧を監視し、当該監視した電圧に応じてUSB-A搭載機器101Aが接続されたか否かを判定する。自機100Cに対する他機としてUSB-A搭載機器101Aが接続されると、USB-A搭載機器101Aから自機100Cに対してVBUS端子を介して電源が供給されるため、VBUS端子の電圧がHigh(高レベル)になる。そこで、VBUS監視部11は、VBUS端子の電圧を監視し、当該監視した電圧がHighであった場合に、USB-A搭載機器101Aが接続されたことを検知する。 The VBUS monitoring unit 11 monitors the voltage of the power supply VBUS terminal of the USB connector 20 of the device 100C, and determines whether the USB-A equipped device 101A is connected according to the monitored voltage. When the USB-A equipped device 101A is connected as another device to the own device 100C, power is supplied from the USB-A equipped device 101A to the own device 100C via the VBUS terminal, so the voltage of the VBUS terminal becomes High. (high level). Therefore, the VBUS monitoring unit 11 monitors the voltage of the VBUS terminal, and when the monitored voltage is High, detects that the USB-A equipped device 101A is connected.
 例えば、VBUS監視部11は、VBUS端子の電圧を定期的に確認し、当該電圧がHighの場合にUSB-A搭載機器101Aが接続されたことを検知する。なお、ここでは「USB-A搭載機器101Aが接続された」と表現しているが、自機100Cに対して他機が接続されたことを検知できればよく、接続された他機のUSBタイプがタイプAであることまで特定することを必要とするものではない。 For example, the VBUS monitoring unit 11 periodically checks the voltage of the VBUS terminal, and detects that the USB-A equipped device 101A is connected when the voltage is High. Note that although it is expressed here as "USB-A equipped device 101A is connected," it is only necessary to detect that another device is connected to the own device 100C, and the USB type of the other device connected is It is not necessary to specify that it is type A.
 CC監視部12は、自機100CのUSBコネクタ20が有するコンフィギュレーション用のCC端子の電圧および他機のコンフィギュレーション用のCC端子の電圧を監視し、当該監視した電圧に応じて他機が接続されたか否かを判定する。ここでCC監視部12は、VBUS監視部11により他機(USB-A搭載機器101A)の接続が検知されない場合に、CC端子の電圧を確認し、当該電圧に応じて他機の接続の有無を判定する。 The CC monitoring unit 12 monitors the voltage of the CC terminal for configuration of the USB connector 20 of the own device 100C and the voltage of the CC terminal for configuration of other devices, and determines whether the other device is connected according to the monitored voltage. Determine whether or not it has been done. Here, the CC monitoring unit 12 checks the voltage of the CC terminal when the connection of another device (USB-A equipped device 101A) is not detected by the VBUS monitoring unit 11, and determines whether or not another device is connected according to the voltage. Determine.
 ここで、自機100Cはポートタイプがデフォルトでソース・ホストのUSB-C搭載機器であるから、自機100CのCC端子の電圧はHigh(高レベル)にプルアップされている。この自機100Cに対して他機としてUSB-B搭載機器101Bが接続された場合、USB-B搭載機器101BにCC端子は存在しないので、自機100Cから見てUSB-B搭載機器101BはCC端子がLowのUSB-C搭載機器であるかのように見える。また、自機100Cに対して他機としてポートタイプがシンク・デバイスまたはDRPのUSB-C搭載機器101Cが接続された場合、当該USB-C搭載機器101CのCC端子の電圧はLow(低レベル)にプルダウンされている。 Here, since the own device 100C is a USB-C equipped device with the default port type as source/host, the voltage of the CC terminal of the own device 100C is pulled up to High (high level). When the USB-B equipped device 101B is connected to this own device 100C as another device, the USB-B equipped device 101B does not have a CC terminal when viewed from the own device 100C. It looks like a USB-C device with a low terminal. Additionally, if a USB-C equipped device 101C with a sink device or DRP port type is connected to the own device 100C, the voltage of the CC terminal of the USB-C equipped device 101C is Low (low level). is pulled down.
 よって、CC監視部12は、自機100CのCC端子の電圧がHigh、他機のCC端子の電圧がLowであることを確認して、他機(USB-B搭載機器101BまたはUSB-C搭載機器101Cの何れか)が接続されたことを検知することが可能である。CC監視部12においても、自機100Cに対して他機が接続されたことを検知できればよく、接続された他機のUSBタイプがタイプBまたはタイプCであることまで特定することを必要とするものではない。 Therefore, the CC monitoring unit 12 confirms that the voltage of the CC terminal of the own device 100C is High and the voltage of the CC terminal of the other device is Low, and then checks the other device (USB-B equipped device 101B or USB-C equipped device 101B). It is possible to detect that any of the devices 101C) is connected. The CC monitoring unit 12 only needs to be able to detect that another device is connected to the own device 100C, and it is necessary to specify that the USB type of the connected device is type B or type C. It's not a thing.
 ポートタイプ切替部13は、VBUS監視部11により他機の接続が検知された場合に、自機100Cのポートタイプをソース・ホストからシンク・デバイスに自動的に切り替える。VBUS監視部11により他機の接続が検知された場合、その他機はUSB-A搭載機器101Aであるから、自機100Cも他機のUSB-A搭載機器101Aもソース・ホストとして動作しようとする。このままでは、VBUS端子を介して電源を供給することもD-,D+端子(図3では図示せず)を介して通信をすることもできない。そこで、ポートタイプ切替部13が自機100Cのポートタイプをソース・ホストからシンク・デバイスに自動的に切り替えることにより、USB-A搭載機器101Aとの間で電源の供給および通信が可能な状態にする。なお、USB-A搭載機器101Aとの間で電源の供給および通信が可能な状態にする方法としては、VBUS端子に対してD+端子をプルアップし、続けて自機100Cがデバイスとして通信を継続すればよい。 The port type switching unit 13 automatically switches the port type of the own device 100C from the source host to the sink device when the VBUS monitoring unit 11 detects the connection of another device. When the connection of another device is detected by the VBUS monitoring unit 11, since the other device is the USB-A equipped device 101A, both the own device 100C and the other device's USB-A equipped device 101A try to operate as the source host. . In this state, it is not possible to supply power via the VBUS terminal or to communicate via the D- and D+ terminals (not shown in FIG. 3). Therefore, the port type switching unit 13 automatically switches the port type of the self-device 100C from source/host to sink/device, thereby making it possible to supply power and communicate with the USB-A equipped device 101A. do. In addition, as a method to enable power supply and communication with the USB-A equipped device 101A, pull up the D+ terminal with respect to the VBUS terminal, and then continue communication with the own device 100C as a device. do it.
 図4は、上記のように構成した本実施形態によるUSB接続検知装置10の動作例を示すフローチャートである。図4に示すフローチャートは、USB接続検知装置10の電源がオンとなっている間、一定の周期で定期的に実行される。 FIG. 4 is a flowchart showing an example of the operation of the USB connection detection device 10 according to the present embodiment configured as described above. The flowchart shown in FIG. 4 is executed periodically at a constant cycle while the USB connection detection device 10 is powered on.
 まず、VBUS監視部11は、VBUS端子の電圧がHighか否かを判定する(ステップS1)。ここで、VBUS端子の電圧がHighであった場合、VBUS監視部11は、自機100Cに対して他機(USB-A搭載機器101A)が接続されたことを検知する(ステップS2)。そして、ポートタイプ切替部13は、自機100Cのポートタイプをソース・ホストからシンク・デバイスに自動的に切り替える(ステップS3)。これにより、図4に示すフローチャートの動作が終了する。 First, the VBUS monitoring unit 11 determines whether the voltage at the VBUS terminal is High (step S1). Here, if the voltage of the VBUS terminal is High, the VBUS monitoring unit 11 detects that another device (USB-A equipped device 101A) is connected to the own device 100C (step S2). Then, the port type switching unit 13 automatically switches the port type of the device 100C from the source host to the sink device (step S3). This completes the operation of the flowchart shown in FIG.
 一方、上記ステップS1においてVBUS端子の電圧がHighではないと判定された場合、すなわち、VBUS監視部11により他機の接続が検知されなかった場合、CC監視部12は、自機100CのCC端子の電圧がHighで、他機のCC端子の電圧がLowであるか否かを判定する(ステップS4)。CC端子の電圧がこのような状態になっている場合、CC監視部12は、自機100Cに対して他機(USB-B搭載機器101BまたはUSB-C搭載機器101C)が接続されたことを検知する(ステップS5)。これにより、図4に示すフローチャートの動作が終了する。 On the other hand, if it is determined in step S1 that the voltage of the VBUS terminal is not High, that is, if the connection of another device is not detected by the VBUS monitoring section 11, the CC monitoring section 12 detects the voltage at the CC terminal of the own device 100C. It is determined whether the voltage at the CC terminal of the other device is High and the voltage at the CC terminal of the other device is Low (step S4). When the voltage of the CC terminal is in this state, the CC monitoring unit 12 detects that another device (USB-B equipped device 101B or USB-C equipped device 101C) is connected to the own device 100C. Detected (step S5). This completes the operation of the flowchart shown in FIG.
 一方、CC端子の電圧が上述の状態になっていないと判定された場合、CC監視部12は、自機100Cに対して他機が接続されていないと判断し(ステップS6)、図4に示すフローチャートの動作が終了する。なお、例として自機100Cに対して他機が接続されていない場合、自機100CのCC端子のプルアップ電圧が見えるため、CC端子の電圧はHighを示すこととなる。 On the other hand, if it is determined that the voltage at the CC terminal is not in the above-mentioned state, the CC monitoring unit 12 determines that no other device is connected to the own device 100C (step S6), and the The operation of the flowchart shown ends. For example, if no other device is connected to the device 100C, the pull-up voltage of the CC terminal of the device 100C is visible, so the voltage at the CC terminal will be High.
 以上詳しく説明したように、本実施形態のUSB接続検知装置10によれば、タイプCでポートタイプがデフォルトでソース・ホストのUSB-C搭載機器100Cである自機に対して他機としてタイプAのUSB-A搭載機器101Aが接続された場合は、VBUS端子の電圧が高レベルであることを確認して他機の接続を検知することが可能である。この場合、自機100Cのポートタイプがソース・ホストからシンク・デバイスに自動的に切り替えられるので、ソース・ホストとして振る舞うタイプAのUSB-A搭載機器101Aとの間で電源供給および通信の動作を問題なく実行することができる。 As explained in detail above, according to the USB connection detection device 10 of the present embodiment, when the own device is type C and the default port type is the source/host USB-C equipped device 100C, the other device is type A. When the USB-A equipped device 101A is connected, it is possible to detect the connection of another device by confirming that the voltage at the VBUS terminal is at a high level. In this case, the port type of own device 100C is automatically switched from source host to sink device, so power supply and communication operations can be performed with type A USB-A equipped device 101A acting as source host. It can be executed without any problem.
 なお、自機100Cのポートタイプがソース・ホストからシンク・デバイスに自動的に切り替えられた後に他機との接続が切断された場合、すなわち、VBUS端子の電圧が高レベルでなくなった場合は、再び自機100Cのポートタイプをソース・ホストに戻し、次の接続に備えるとよい。その際も再びVBUS端子の電圧監視を行うことで、前述同様の接続監視を行うことが可能となる。 In addition, if the connection with other devices is disconnected after the port type of own device 100C is automatically switched from source/host to sink device, that is, if the voltage of the VBUS terminal is no longer at a high level, It is a good idea to change the port type of the device 100C back to the source host again and prepare for the next connection. At that time, by monitoring the voltage of the VBUS terminal again, it becomes possible to perform the same connection monitoring as described above.
 一方、タイプCでポートタイプがデフォルトでソース・ホストのUSB-C搭載機器100Cである自機に対して他機としてタイプBのUSB-B搭載機器101BまたはタイプCのUSB-C搭載機器101C(ポートタイプがシンク・デバイスまたはDRPのもの)が接続された場合は、自機100CのCC端子の電圧が高レベル、他機(USB-B搭載機器101BまたはUSB-C搭載機器101C)のCC端子の電圧が低レベルであることを確認して他機の接続を検知することが可能である。 On the other hand, for the own device whose type C port type is the source/host USB-C device 100C by default, the other device is the type B USB-B device 101B or the type C USB-C device 101C ( If the port type is sink device or DRP) is connected, the voltage of the CC terminal of own device 100C is high level, and the voltage of the CC terminal of the other device (USB-B equipped device 101B or USB-C equipped device 101C) is connected. It is possible to detect the connection of other devices by confirming that the voltage is at a low level.
 以上のように、本実施形態によれば、タイプCでポートタイプがデフォルトでソース・ホストのUSB-C搭載機器100C(自機)と他のUSB搭載機器101A~101C(他機)とを接続する場合に、他機がタイプA、タイプBおよびタイプCの何れの場合であっても接続を検知することができ、より多くの組み合わせで接続を検知することができる。また、自機のUSB-C搭載機器100CのポートタイプがDRPではなくソース・ホストであるから、急速充電のUSB-PDに非対応のUSB-C搭載機器が他機として接続された場合でも、自機100Cがソース・ホストまたはシンク・デバイスの何れで動作するかを固定できないという問題は生じない。 As described above, according to the present embodiment, the USB-C equipped device 100C (own device) of the source/host with type C and the port type by default is connected to the other USB equipped devices 101A to 101C (other devices). In this case, the connection can be detected regardless of whether the other device is type A, type B, or type C, and connections can be detected in more combinations. In addition, since the port type of the own USB-C equipped device 100C is not DRP but source/host, even if a USB-C equipped device that is not compatible with quick charging USB-PD is connected as another device, The problem that it is not possible to fix whether the device 100C operates as a source host or a sink device does not occur.
 なお、上記実施形態では、自機100CのCC端子の電圧がHighで、他機のCC端子の電圧がLowではないとCC監視部12により判定された場合に、自機100Cに対して他機が接続されていないと判断する例について説明したが、これに限定されない。例えば、自機100CのCC端子の電圧がHigh、他機のCC端子の電圧もHighであることが確認された場合に、自機100Cに対して他機(ポートタイプがソース・ホストのUSB-C搭載機器)が接続されたことを検知し、自機100Cのポートタイプをソース・ホストからシンク・デバイスに自動的に切り替えるようにしてもよい。自機が、タイプCでポートタイプがデフォルトでソース・ホストのUSB-C搭載機器100Cであるため、他機がタイプCのうちのソース・ホストのみとして機能するものであっても、自機100Cがシンク・デバイスとして機能できるため問題なく接続可能である。なお、自機100Cのポートタイプをソース・ホストからシンク・デバイスに切り替える方法としては、CC端子の電圧を低レベルにすればよい。 In the above embodiment, when the CC monitoring unit 12 determines that the voltage of the CC terminal of the own machine 100C is High and the voltage of the CC terminal of the other machine is not Low, the other machine Although an example has been described in which it is determined that the terminal is not connected, the present invention is not limited to this. For example, if it is confirmed that the voltage of the CC terminal of own machine 100C is High and the voltage of the CC terminal of other machine is also High, then the voltage of the other machine (USB- The port type of the device 100C may be automatically switched from the source host to the sink device upon detecting that the device 100C is connected. Since the own device is a USB-C equipped device 100C of type C and the port type is source/host by default, even if another device functions only as a source/host of type C, the own device 100C can function as a sink device, so it can be connected without any problems. Note that, as a method of switching the port type of the device 100C from source/host to sink/device, the voltage of the CC terminal may be set to a low level.
 なお、本実施形態のUSB接続検知装置10を実装したUSB-C搭載機器100Cと、当該USB-C搭載機器100Cに接続される他のUSB搭載機器101A~101Cは、どのような電子機器であってもよい。一例として、USB-C搭載機器100Cとしてレシートプリンタを用い、これにUSB-Aを搭載したPOS端末等のホスト装置を接続することが可能である。この場合、レシートプリンタに実装されたUSB接続検知装置10は、VBUS端子の電圧を確認してホスト装置との接続を検知することが可能である。接続が検知された後は、ホスト装置からレシートプリンタに電源を供給し、所定の制御信号を送信してレシートプリンタの動作を制御することが可能となる。 Note that the USB-C equipped device 100C on which the USB connection detection device 10 of the present embodiment is installed and the other USB-equipped devices 101A to 101C connected to the USB-C equipped device 100C are different types of electronic devices. It's okay. As an example, a receipt printer can be used as the USB-C equipped device 100C, and a host device such as a POS terminal equipped with USB-A can be connected to this. In this case, the USB connection detection device 10 installed in the receipt printer can detect the connection with the host device by checking the voltage of the VBUS terminal. After the connection is detected, the host device can supply power to the receipt printer and transmit a predetermined control signal to control the operation of the receipt printer.
 例えば、レシートプリンタは以下のような機能を有し、ホスト装置はこの機能の動作を制御することが可能である。 For example, a receipt printer has the following functions, and the host device can control the operation of this function.
(1)印字する際のフォントを小さくして用紙の使用量を節約する機能
 これは、プリンタの設定ユーティリティを用いてあらかじめ文字フォントの高さを縮小する設定にしておくことで、印刷アプリケーションを変更することなく、用紙を節約できるようにする機能である。図5(a)に示すように、所定の演算により文字部分(有色ドット部分)のラインを縦方向(紙送り方向)に縮小するモードを備えてもよい。また、図5(b)に示すように、スペース部分(無色ドット部分)のラインを縦方向(紙送り方向)に間引くように削除を行う縮小するモードであってもよい。さらに図5(a)、図5(b)の両方の縮小を併用するモードがあってもよい。
(1) Function to reduce paper usage by reducing the size of the font when printing This function allows you to save paper without having to As shown in FIG. 5A, a mode may be provided in which a line of a character portion (colored dot portion) is reduced in the vertical direction (paper feeding direction) by a predetermined calculation. Alternatively, as shown in FIG. 5B, a reduction mode may be used in which lines in space portions (colorless dot portions) are thinned out in the vertical direction (paper feeding direction). Furthermore, there may be a mode in which both reductions in FIGS. 5(a) and 5(b) are used together.
 図5(a)の場合、所定の演算により、例えば3行目、6行目、9行目、16行目、18行目および19行目が間引かれ、11行目と12行目は1行に合成されることで縮小を行っている。また、図5(b)の20行目で示されるベースラインは、一行中に並ぶ文字列の中にサイズの異なる文字があった場合でも、その位置を揃えることで、違和感がないように変換するとよい。 In the case of FIG. 5(a), for example, the 3rd, 6th, 9th, 16th, 18th, and 19th lines are thinned out by a predetermined calculation, and the 11th and 12th lines are thinned out. Reduction is achieved by compositing into one line. In addition, the baseline shown in the 20th line of Figure 5(b) is such that even if there are characters of different sizes in a string of characters in one line, by aligning their positions, the conversion will not look strange. It's good to do that.
(2)トリガボタンによる定型印刷機能
 これは、定型画像(開封防止ラベルや店舗ロゴラベル等の画像)をプリンタにあらかじめ保存し、プリンタに備え付けられるトリガボタンを押すと定型画像を印刷する機能である。例えば、定型画像をホスト装置からプリンタに送信して保存することが可能である。
(2) Standard printing function using trigger button This is a function that stores standard images (images of tamper-proof labels, store logo labels, etc.) in the printer in advance, and prints the standard images by pressing the trigger button provided on the printer. For example, a stylized image can be sent from a host device to a printer for storage.
 なお、トリガボタンに複数の機能を割り当てるようにしてもよい。例えば、トリガボタンに3つの機能を割り当て、それぞれに対して、ロゴの印刷+用紙のフルカット(第1の機能)、ロゴの印刷+用紙のパーシャルカット(第2の機能)、ロゴの印刷+単なる紙送り(第3の機能)を設定可能にしてもよい。例えば、トリガボタンを1回押下したときは第1の機能を実行し、トリガボタンを連続して2回押下したときは第2の機能を実行し、トリガボタンを連続して3回押下したときは第3の機能を実行する。また、トリガボタンを所定時間以上連続して長押しした場合に第1~第3の機能を全て実行するようにしてもよい。 Note that multiple functions may be assigned to the trigger button. For example, you can assign three functions to a trigger button, and print a logo + full paper cut (first function), print a logo + partially cut paper (second function), and print a logo + paper cut (second function). Simple paper feeding (third function) may be settable. For example, when the trigger button is pressed once, the first function is executed, when the trigger button is pressed twice in succession, the second function is executed, and when the trigger button is pressed three times in succession, the second function is executed. performs the third function. Further, all of the first to third functions may be executed when the trigger button is continuously pressed and held for a predetermined period of time or more.
 また、プリンタのパネルに表示されるユーザインタフェースの操作により、トリガボタンの有効/無効を切り替えられるようにしてもよい。例えば、トリガボタンを無効に設定した場合は、トリガボタンの押下により紙送りを行う。一方、トリガボタンを有効に設定した場合は、トリガボタンの操作状態に応じて上述した第1の機能、第2の機能、第3の機能の何れかを実行する。 Furthermore, the trigger button may be enabled/disabled by operating a user interface displayed on the printer panel. For example, if the trigger button is set to be disabled, paper is fed by pressing the trigger button. On the other hand, when the trigger button is set to be valid, any one of the above-mentioned first function, second function, or third function is executed depending on the operating state of the trigger button.
 その他、上記実施形態は、何れも本発明を実施するにあたっての具体化の一例を示したものに過ぎず、これによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明はその要旨、またはその主要な特徴から逸脱することなく、様々な形で実施することができる。 In addition, the above-mentioned embodiments are merely examples of implementation of the present invention, and the technical scope of the present invention should not be construed to be limited thereby. That is, the present invention can be implemented in various forms without departing from its gist or main features.
 10 USB接続検知装置
 11 VBUS監視部
 12 CC監視部
 13 ポートタイプ切替部
 100C USB-C搭載機器(自機)
 101A USB-A搭載機器(他機)
 101B USB-B搭載機器(他機)
 101C USB-C搭載機器(他機)
10 USB connection detection device 11 VBUS monitoring section 12 CC monitoring section 13 Port type switching section 100C USB-C equipped device (own device)
101A USB-A equipped device (other device)
101B USB-B equipped device (other device)
101C USB-C equipped device (other devices)

Claims (6)

  1.  タイプCでポートタイプがデフォルトでソース・ホストのUSB搭載機器である自機において他のUSB搭載機器である他機との接続を検知する装置であって、
     上記自機の電源供給用のVBUS端子の電圧を監視し、当該監視した電圧に応じて上記他機が接続されたか否かを判定するVBUS監視部と、
     上記自機のコンフィギュレーション用のCC端子の電圧および上記他機のコンフィギュレーション用のCC端子の電圧を監視し、当該監視した電圧に応じて上記他機が接続されたか否かを判定するCC監視部と、
     上記VBUS監視部により上記他機の接続が検知された場合に、上記自機のポートタイプをソース・ホストからシンク・デバイスに自動的に切り替えるポートタイプ切替部とを備えたことを特徴とするUSB接続検知装置。
    A device that detects a connection between a device that is a USB-equipped device of type C and whose port type is a source/host by default and another device that is another USB-equipped device,
    a VBUS monitoring unit that monitors the voltage of the VBUS terminal for power supply of the own machine and determines whether the other machine is connected according to the monitored voltage;
    CC monitoring that monitors the voltage of the CC terminal for configuration of the own machine and the voltage of the CC terminal for configuration of the other machine, and determines whether the other machine is connected according to the monitored voltage. Department and
    A USB device comprising: a port type switching section that automatically switches the port type of the own device from a source host to a sink device when the VBUS monitoring section detects connection of the other device. Connection detection device.
  2.  上記VBUS監視部は、上記VBUS端子の電圧を定期的に確認し、当該電圧が高レベルの場合に上記他機が接続されたことを検知し、
     上記CC監視部は、上記VBUS監視部により上記他機の接続が検知されない場合に、上記CC端子の電圧を確認し、当該電圧に応じて上記他機の接続の有無を判定することを特徴とする請求項1に記載のUSB接続検知装置。
    The VBUS monitoring unit periodically checks the voltage of the VBUS terminal, detects that the other device is connected when the voltage is at a high level,
    The CC monitoring unit is characterized in that when the VBUS monitoring unit does not detect the connection of the other device, the CC monitoring unit checks the voltage of the CC terminal, and determines whether or not the other device is connected according to the voltage. The USB connection detection device according to claim 1.
  3.  上記ポートタイプ切替部は、上記自機のCC端子の電圧および上記他機のCC端子の電圧が何れも高レベルであることが上記CC監視部により検知された場合に、上記自機のポートタイプをソース・ホストからシンク・デバイスに自動的に切り替えることを特徴とする請求項1または2に記載のUSB接続検知装置。 The port type switching section changes the port type of the own device when the CC monitoring section detects that the voltage of the CC terminal of the own device and the voltage of the CC terminal of the other device are both at a high level. 3. The USB connection detection device according to claim 1, wherein the USB connection detection device automatically switches from a source host to a sink device.
  4.  タイプCでポートタイプがデフォルトでソース・ホストのUSB搭載機器である自機において他のUSB搭載機器である他機との接続を検知する方法であって、
     上記自機のUSBドライバが、電源供給用のVBUS端子の電圧を監視し、当該監視した電圧に応じて上記他機が接続されたか否かを判定するとともに、上記自機のコンフィギュレーション用のCC端子の電圧および上記他機のコンフィギュレーション用のCC端子の電圧を監視し、当該監視した電圧に応じて上記他機が接続されたか否かを判定する監視ステップと、
     上記監視ステップにおいて上記VBUS端子の電圧に基づき上記他機の接続が検知された場合に、上記自機のUSBドライバが、上記自機のポートタイプをソース・ホストからシンク・デバイスに自動的に切り替えるポートタイプ切替ステップとを有することを特徴とするUSB接続検知方法。
    A method for detecting a connection between a device that is a USB-equipped device of type C and whose port type is a source/host by default and another device that is another USB-equipped device,
    The USB driver of the own machine monitors the voltage of the VBUS terminal for power supply, and determines whether the other machine is connected according to the monitored voltage, and the CC for configuration of the own machine. a monitoring step of monitoring the voltage of the terminal and the voltage of the CC terminal for configuration of the other device, and determining whether or not the other device is connected according to the monitored voltage;
    If connection of the other device is detected based on the voltage of the VBUS terminal in the monitoring step, the USB driver of the device automatically switches the port type of the device from source/host to sink/device. A USB connection detection method comprising: a port type switching step.
  5.  上記監視ステップは、
     上記USBドライバのVBUS監視部により上記VBUS端子の電圧を定期的に確認し、当該電圧が高レベルの場合に上記他機が接続されたことを検知する第1のステップと、
     上記VBUS監視部により上記他機の接続が検知されない場合に、上記USBドライバのCC監視部により上記CC端子の電圧を確認し、当該電圧に応じて上記他機の接続の有無を判定する第2のステップとを有することを特徴とする請求項4に記載のUSB接続検知方法。
    The above monitoring step is
    A first step of periodically checking the voltage of the VBUS terminal by a VBUS monitoring unit of the USB driver, and detecting that the other device is connected when the voltage is at a high level;
    If the connection of the other device is not detected by the VBUS monitoring section, the CC monitoring section of the USB driver checks the voltage of the CC terminal, and determines whether or not the other device is connected according to the voltage. 5. The USB connection detection method according to claim 4, further comprising the steps of:
  6.  上記ポートタイプ切替ステップでは、上記自機のCC端子の電圧および上記他機のCC端子の電圧が何れも高レベルであることが上記監視ステップにおいて検知された場合にも、上記自機のポートタイプをソース・ホストからシンク・デバイスに自動的に切り替えることを特徴とする請求項4または5に記載のUSB接続検知方法。
     
    In the port type switching step, even if it is detected in the monitoring step that the voltage of the CC terminal of the own machine and the voltage of the CC terminal of the other machine are both at a high level, the port type of the own machine 6. The USB connection detection method according to claim 4, further comprising automatically switching from a source host to a sink device.
PCT/JP2023/013754 2022-04-06 2023-04-03 Usb connection detection device and usb connection detection method WO2023195435A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2022063298A JP2023154165A (en) 2022-04-06 2022-04-06 USB connection detection device and USB connection detection method
JP2022-063298 2022-04-06

Publications (1)

Publication Number Publication Date
WO2023195435A1 true WO2023195435A1 (en) 2023-10-12

Family

ID=88242988

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2023/013754 WO2023195435A1 (en) 2022-04-06 2023-04-03 Usb connection detection device and usb connection detection method

Country Status (2)

Country Link
JP (1) JP2023154165A (en)
WO (1) WO2023195435A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016015005A (en) * 2014-07-02 2016-01-28 レノボ・シンガポール・プライベート・リミテッド Portable device, cable assembly, and usb system
JP2019121084A (en) * 2017-12-28 2019-07-22 キヤノン株式会社 Electronic apparatus, control method and program
JP2020087149A (en) * 2018-11-29 2020-06-04 ルネサスエレクトロニクス株式会社 Controller, control method, and control program
JP2021068323A (en) * 2019-10-25 2021-04-30 ルネサスエレクトロニクス株式会社 Electronic device and its power incoming control method
US20210203168A1 (en) * 2019-12-31 2021-07-01 Texas Instruments Incorporated Dual role port automatic role reversal prevention

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016015005A (en) * 2014-07-02 2016-01-28 レノボ・シンガポール・プライベート・リミテッド Portable device, cable assembly, and usb system
JP2019121084A (en) * 2017-12-28 2019-07-22 キヤノン株式会社 Electronic apparatus, control method and program
JP2020087149A (en) * 2018-11-29 2020-06-04 ルネサスエレクトロニクス株式会社 Controller, control method, and control program
JP2021068323A (en) * 2019-10-25 2021-04-30 ルネサスエレクトロニクス株式会社 Electronic device and its power incoming control method
US20210203168A1 (en) * 2019-12-31 2021-07-01 Texas Instruments Incorporated Dual role port automatic role reversal prevention

Also Published As

Publication number Publication date
JP2023154165A (en) 2023-10-19

Similar Documents

Publication Publication Date Title
US7765344B2 (en) Apparatus and method for dynamically providing hub or host operations
TW444165B (en) Hot plug and play universal serial bus switch device and control method
US6321340B1 (en) Cable manager system and computer therewith
EP1111572B1 (en) Display apparatus
US11223734B2 (en) Information processing apparatus, method of controlling information processing apparatus, and non-transitory computer-readable recording medium
CN101622612A (en) Detecting connection to a USB host or hub without using an extra status input
JP3610424B2 (en) Electronic equipment and interface circuit
JP2003263245A (en) Usb device
JP2003195987A (en) Display device, power source supply method to usb device and connecting cable
EP1277105A1 (en) Video graphic adaptor for driving sub-monitor of dual monitor using usb port
US6763408B1 (en) Interface switching device and terminal using the same
US20070206019A1 (en) Computer having removable input/output device
US6930655B2 (en) Display monitor has stand-alone mode and PC peripheral mode
WO2023195435A1 (en) Usb connection detection device and usb connection detection method
TW459197B (en) Print port control device that is able to connect multiple devices and the control method
JP2020121456A (en) Information processing device, method for controlling information processing device, and program
US9106097B2 (en) Connection device for connecting between electrical devices
CN113742160B (en) Interface connection device, system and method thereof
JP2007094659A (en) Electronic apparatus and power saving control method
CN209170528U (en) A kind of signal processing apparatus
JP2002202835A (en) Electronic equipment and connecting method for electronic equipment
JP2020016927A (en) Information processing device, and control method and program of information processing device
JP2001067157A (en) Computer system, its peripheral equipment and computer, controlling method, and storage medium
CN220290437U (en) Display device
JP6807006B1 (en) Function expansion device and information processing system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23784721

Country of ref document: EP

Kind code of ref document: A1