[go: up one dir, main page]

TW201107991A - Electronic device capable of switching between a USB master and a USB slave mode automatically - Google Patents

Electronic device capable of switching between a USB master and a USB slave mode automatically Download PDF

Info

Publication number
TW201107991A
TW201107991A TW98128644A TW98128644A TW201107991A TW 201107991 A TW201107991 A TW 201107991A TW 98128644 A TW98128644 A TW 98128644A TW 98128644 A TW98128644 A TW 98128644A TW 201107991 A TW201107991 A TW 201107991A
Authority
TW
Taiwan
Prior art keywords
slave
master
electronic device
usb
pin
Prior art date
Application number
TW98128644A
Other languages
Chinese (zh)
Inventor
Wei Huo
Zhong-Wei Du
Original Assignee
Hon Hai Prec Ind Co Ltd
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 Hon Hai Prec Ind Co Ltd filed Critical Hon Hai Prec Ind Co Ltd
Priority to TW98128644A priority Critical patent/TW201107991A/en
Publication of TW201107991A publication Critical patent/TW201107991A/en

Links

Landscapes

  • Information Transfer Systems (AREA)
  • Power Sources (AREA)

Abstract

An electronic device, includes a USB interface, a processing unit, a master-slave select trigger circuit, a control unit, a selection circuit and a switch circuit. The master-slave select trigger circuit, including an input port, a first output port and a second output port. The master-slave select trigger circuit is used to detect the type of external electronic devices connected to the USB interface, if the external electronic device is a main device, the first and second output port output a slave trigger signal, the control unit controls the switch circuit to turn off and the selection circuit selects the processing unit into slave mode when them receives the slave trigger signal; if the external electronic device is the slave device, the first and second output port output a main trigger signal, the control unit to control the switch circuit turn on and the selection circuit select the processing unit into master mode when them receives the main trigger signal.

Description

201107991 六、發明說明: 【發明所屬之技術領域】 [0001]本發明涉及一種USB電子裝置,特別涉及一種可自動切換 USB主從設備模式的電子裝置。 【先前技術】 _2]自從USB標準在1994年由inte卜麗、Micr〇s〇ft等多 家公司聯合提出後,經過多年的發展,USB介面已大量應 用於電子裝置中,成為電子設備的標準介面之一。 [0003]眾所周知,目前’不少電子裝置通過哪介面和不同外部 電子設備進行連搔以交換數據時,需要根據所接入的外 部電子裝置的類型選擇工作在肋^ (主設備模式)或 DEVICE (從設備模式)狀態,以電子相框為例當電子 相框通過USB介面與電腦連接時,該電子相框作為電滕的 從設備被電腦控制’而與U盤連接時又作為主設備控⑽ 盤。這樣’當電子裝置與外部電子裝置通卿8介面連接 時,例如電子相棍與電腦或U盤連帛時,電子裝置就需要 根據所連接的外部電作置來自動選擇處於主設備模式 或從設備模式。 國⑽,目前’已有的USB的主狀備模式切換電路結構較 為祕’個電子元H件比鮮1子元將的過多不 但造成製造成本增加而且增加電量的消耗。 【發明内容】 [0005] 有鑒於此,有必要提供_ 種具有簡早USB主從設備模式切 換電路的電子裝置,可根據不同外部裝置類型,電子裝 098128644 置自動、仃從叹備松式的切換,該主從設備模式切換 表單編號騰1 S 4 _ 18胃 ' 胃 0982049184-0 201107991 [0006] [0007] Ο [0008] Ο [0009] [0010] 電路簡單有效,減少了電子元器件的使用,從而減少製 造成本。 為解決本發明問題的技術問題,本發明公共開一種可自 動切換USB主從設備模式的電子裝置,用於一電子裝置主 從設備模式的切換,該電子裝置包括一USB介面、一處理 單元以及一電源,該USB介面包括一 USB電源引腳、一 USB數據引腳。 該可自動切換USB主從設備模式還包括一主從選擇觸發電 路、一開關電路、一控制單元以及一選擇電路。 該主從選擇觸發電路,包括一輸入端、一第一輸出端以 及一第二輸出端,該輸入端與該USB電源引腳連接,該第 一輸出端與控制單元連接以及該第二輸出端與選擇電路 連接。該主從選擇觸發電路用於偵測通過USB介面與該電 子裝置的連接的外部電子裝置類型,當偵測該外部電子 裝置為主設備時,則通過第一、第二輸出端發出從觸發 信號,當偵測該外部電子裝置為從設備時,則通過第一 、第二輸出端發出主觸發信號》 該開關電路連接與該電子裝置電源與該USB電源引腳之間 〇 該控制單元還與該開關電路連接,用於接收第一輸出端 輸出的觸發信號,當該觸發信號為從觸發信號時,則該 開關控制單元控制該開關單元截止,切斷該電子裝置電 源與該USB電源引腳的連接,當該處觸發信號為主觸發信 號時,則該開關控制單元控制該開關單元導通,該電子 098128644 表單編號A0101 第5頁/共18頁 0982049184-0 201107991 裝置電源對該USB電源引腳供電。 [0011] [0012] [0013] 098128644 該選擇電路用於根據接收來自第二輸出端的觸發信號來 選擇處理單元的主從設備模式,當該觸發信號為從觸發 信號時,該處理單元的從設備引腳與該USB數據引腳連接 ,该處理單元控制該電子裝置工作在從設備模式,當該 觸發信號為主觸發信號時,該處理單元控制的主設備引 腳與該USB數據引腳連接,該處理單元控制該電子裝置工 作在主設備模式。 與現有技術相比,本發明主從選擇觸發電路結構簡單, 減少電子器件的使用,減少USB主從設備摸式切換電路的 製造成本,減少USB主從設備模式切換:電路的功耗。 【實施方式】 如圖1所示’為可自動切換USB主從設備模式的電子裝置 的功能模組圖。該電子裝置i包括一USB主從模式切換電 路10、一USB介面20,其中,在本實施方式中,該uSB介 面20可為Mini USB介面或類型A或類型B的USB介面。當 該電子裝置1通過該USB介面20與外部電子裝置2連接時, 該USB主從模式切換電路1〇判斷外部電子裝置2的類型, 並當外部裝置2為主設備例如電腦時,USB主從模式切換 電路10切換該電子裝置!工作在從設備模式,當該USB主 從模式切換電路1〇判斷該外部電子裝置2為從設備例如U 盤時’該USB主從模式切換電路1〇〇切換該電子裝置1工作 在主設備模式。 該USB主從模式切換電路1〇包括一主從選擇觸發電路1〇1 、一控制單元102、一選擇電路103以及一開關電路1〇4 表單編號A0101 第6頁/共18頁 0982049184-0 [0014] 201107991 [0015] Ο [0016]201107991 VI. Description of the Invention: [Technical Field] The present invention relates to a USB electronic device, and more particularly to an electronic device capable of automatically switching a mode of a USB master-slave device. [Prior Art] _2] Since the USB standard was jointly proposed by inte Bu Li, Micr〇s〇ft and other companies in 1994, after years of development, the USB interface has been widely used in electronic devices, becoming the standard for electronic devices. One of the interfaces. [0003] It is well known that at present, when many electronic devices are connected to different external electronic devices to exchange data, it is necessary to select working in the ribs (main device mode) or DEVICE according to the type of external electronic devices that are connected. (From the device mode) state, taking the electronic photo frame as an example, when the electronic photo frame is connected to the computer through the USB interface, the electronic photo frame is controlled by the computer as the slave device of the electric device, and is also used as the main device control (10) disk when connected with the U disk. Thus, when the electronic device is connected to the external electronic device, for example, when the electronic phase stick is connected to the computer or the USB flash drive, the electronic device needs to automatically select the master device mode according to the connected external power. Device mode. In the country (10), the existing USB main mode switching circuit structure is more secretive. The number of electronic components H is higher than that of the fresh one, which not only increases the manufacturing cost but also increases the consumption of power. SUMMARY OF THE INVENTION [0005] In view of this, it is necessary to provide an electronic device with a simple USB master-slave mode switching circuit, which can be automatically switched according to different external device types. , the master-slave mode switch form number 腾 1 S 4 _ 18 stomach ' stomach 0982049184-0 201107991 [0006] [0007] Ο [0008] Ο [0009] [0010] The circuit is simple and effective, reducing the use of electronic components , thereby reducing manufacturing costs. In order to solve the technical problem of the present invention, the present invention generally provides an electronic device capable of automatically switching a USB master-slave mode for switching an electronic device master-slave mode, the electronic device including a USB interface, a processing unit, and A power supply, the USB interface includes a USB power pin and a USB data pin. The automatically switchable USB master-slave mode further includes a master-slave selection trigger circuit, a switch circuit, a control unit, and a selection circuit. The master-slave selection trigger circuit includes an input terminal, a first output terminal and a second output terminal, the input terminal being connected to the USB power supply pin, the first output terminal being connected to the control unit and the second output terminal Connect to the selection circuit. The master-slave selection trigger circuit is configured to detect an external electronic device type connected to the electronic device through the USB interface. When the external electronic device is detected as the main device, the slave trigger signal is sent through the first and second output terminals. When detecting that the external electronic device is a slave device, sending a main trigger signal through the first and second output terminals, the switch circuit is connected between the power supply of the electronic device and the USB power pin, and the control unit is further The switch circuit is connected to receive a trigger signal outputted by the first output end. When the trigger signal is a slave trigger signal, the switch control unit controls the switch unit to be turned off, and the power of the electronic device and the USB power pin are cut off. Connection, when the trigger signal is the main trigger signal, then the switch control unit controls the switch unit to be turned on, the electronic 098128644 Form No. A0101 Page 5 / 18 pages 0992049184-0 201107991 Device power supply to the USB power pin powered by. [0013] 00128644 The selection circuit is configured to select a master-slave mode of the processing unit according to the trigger signal received from the second output terminal, and when the trigger signal is a slave trigger signal, the slave device of the processing unit a pin is connected to the USB data pin, the processing unit controls the electronic device to operate in a slave mode, and when the trigger signal is a main trigger signal, the master device pin controlled by the processing unit is connected to the USB data pin, The processing unit controls the electronic device to operate in a master mode. Compared with the prior art, the master-slave selection trigger circuit of the invention has a simple structure, reduces the use of the electronic device, reduces the manufacturing cost of the USB master-slave mode switching circuit, and reduces the USB master-slave mode switching: the power consumption of the circuit. [Embodiment] As shown in Fig. 1, a functional module diagram of an electronic device capable of automatically switching a USB master-slave mode is shown. The electronic device i includes a USB master-slave mode switching circuit 10 and a USB interface 20. In this embodiment, the uSB interface 20 can be a Mini USB interface or a Type A or Type B USB interface. When the electronic device 1 is connected to the external electronic device 2 through the USB interface 20, the USB master-slave mode switching circuit 1 determines the type of the external electronic device 2, and when the external device 2 is a main device such as a computer, the USB master-slave The mode switching circuit 10 switches the electronic device! Working in the slave mode, when the USB master-slave mode switching circuit 1 determines that the external electronic device 2 is a slave device such as a USB flash drive, the USB master-slave mode switching circuit 1 switches the electronic device 1 to operate in the master device mode. . The USB master-slave mode switching circuit 1 includes a master-slave selection trigger circuit 1〇1, a control unit 102, a selection circuit 103, and a switch circuit 1〇4 form number A0101 page 6/18 pages 0982049184-0 [ 0014] 201107991 [0015] Ο [0016]

GG

[0017] 。該USB介面20包括一電源引腳201以及數據引腳202。 該主從選擇觸發電路1〇1包括一輸入端1〇11、一第一輸出 端1012、一第二輸出端1〇13,該輸入端1〇11與該USB介 面20的電源引腳201連接。該第一輸出端1〇12與該控制 單元102連接’該第二輸出端1〇13與該選擇電路103連接 該電子裝置1還包括一處理單元30以及一電源4〇。該處理 單元40包括一從設僙控制引腳3〇1以及一主設備控制引腳 302 〇[0017]. The USB interface 20 includes a power pin 201 and a data pin 202. The master-slave selection trigger circuit 1〇1 includes an input terminal 11〇, a first output terminal 1012, and a second output terminal 1〇13. The input terminal 1〇11 is connected to the power pin 201 of the USB interface 20. . The first output terminal 〇12 is connected to the control unit 102. The second output terminal 〇13 is connected to the selection circuit 103. The electronic device 1 further includes a processing unit 30 and a power supply unit 〇. The processing unit 40 includes a slave control pin 3〇1 and a master device control pin 302.

該主從選擇觸發電路101用於侦測與該電子裝置丨通過USB ,. ^ , 介面20連接的外部電子裝置2的類型。當該主從選擇觸發 電路101偵測到與該輪入填1011連接的電源引腳2〇1為高 電平時’該主從選擇觸發電路101判斷該外部電子裝置2 為主設備,通過第_、第二輸出端發出從觸發信號。當 該主從選擇觸發電路101偵測到與該輸入端1〇丨丨連接的電 源引腳201為低電平時,該主從選擇觸發電路1〇1判斷該 外部電子裝置2為.從設.備’通過第一、第二輸出端發出主 觸發信號。 該控制單元102同時還與該開關電路1〇4連接,該開關電 路104同時連接於該電源40與USB電源引腳2〇1之間。當 該控制單元102接收到第一輸出端發出的從觸發信號時, β玄控制早元1 〇 2控制該開關電路1 〇 4截止,切斷該電源4 〇 與該USB電源引腳201的連接。當該控制單元102接收到 第一輸出端發出的主觸發信號時,該控制單元102控制該 開關電路104導通,該電源40對該USB電源引腳2〇1供電 098128644 表單編號A0101 第7頁/共18頁 0982049184-0 201107991 [0018] 該選擇電路103,與該第二輸出端1〇13連接,用於根據接 收來自第二輸出端發出的觸發信號來選擇該處理單元3〇 的從設備控制引腳3〇1或主設備控制引腳302與USB介面 20的數據引腳202連接。當該選擇電路1〇3接收到該第二 輸出端1013發出的從觸發信號時,該選擇電路1〇3控制將 該處理單元30的從設備控制引腳3〇1與該USB介面20的數 據引腳202連接。當該選擇電路1〇3接收到該第二輸出端 1013發出的主觸發信號時,該選擇電路控制將該處理單 . ... ....... 元30的主設備控制弓丨腳302與面㈣的數據引腳 202連接。 :$ 广 [0019] 從而,當與該電子裝置1的USB介面20連接的外部電子裝 置為主設備時,該電子裝置1不對該USB介面20的電源引 腳201供電,同時該處理單元30的從設備控制引腳301與 該USB介面20的數據引腳202的連接,該電子裝置1工作 ... 在從設備模式。當與該電子裝置1的介面20連接的外 部電子裝置為從設備時’該電子裝置1對該USB介面30的 電源引腳201供電,同時該處理單元40的主設備控制引腳 302與該USB介面20的數據引腳202的連接,該電子裝置1 工作在主設備模式。 [0020] 如圖2所示,為可自動切換USB主從設備模式的電子裝置 的具體電路圖。在本實施方式中’該主從選擇觸發電路 101包括第一電阻R1、第二電阻R2以及一第三電阻R3 ’ 該第一電阻R1與該第二電阻R2的連接節點a構成該主從選 擇觸發電路101的輸入端1011 ’該第—電阻R1遠離該第 098128644 表單編號A0101 第8頁/共18頁 0982049184-0 201107991 [0021] Ο [0022] [0023] Ο [0024] [0025] 二電阻R2端Β構成該主從選擇觸發電路101的第一輸出端 1012,第二電阻R2與該第 > 電阻Μ的連接點C構成該主 從選擇觸發電路10的第二輸出端1013 ° 該控制單元102為一高電屮導通開關’包括一控制端,一 第一導通端以及一第二導通端。在本實施方式中,該控 制開關102以一ΝΡΝ三極管Q1為例進行說明,其中該控制 端 '第一導通端以及第二導通端分別對應該ΝΡΝ三極管Qi 的基極、發射極以及集電極。在其他實施方式中,該控 制單元10 2可為NMOS管。 該NPN三極管的基極與該第一輸出端1012連接,發射極接 地,集電極與開關電路104的一控制端連接> 在本實施方式中,該開關電路104為一高電平導通開關電 路’包括該控制端、一第一導通端以及_一第二導通端。 該控制端與該控制單元1〇2的第二導通端連接,該第—導 通端與該電源60連接,該第二導通端與該:USB電源引腳 201連接。在本實施方式中,該開關電路1〇4為NMOS管, 在其他實施方式中,該開關電路104可為NPN三極管。 在本實施方式中’該處理單元30的從設備控制引腳301包 括Device D+、Device D—兩個引腳’主設備控制引腳 302包括Host D+、Host D—兩個引腳。該USB介面20的 數據引腳202包括— j)+以及一 ρ 一引腳。 該選擇電路103具體為一雙刀雙擲開關,包括一控制端與 該第二輸入端1013連接,兩個公共端分別與USB介面20 的數據引腳D+以及])—連接,四個接觸端分別與處理單元 098128644 表單編號A0101 第9頁/共18頁 0982049184-0 201107991 30的從設備引腳301中的Device D+、Device D —引腳 以及主設備引腳302中的Host D+、Host D 一引腳連接 〇 [0026] 當該電子裝置1通過該USB介面20與作為主設備的外部電 子裝置2連接時。該USB介面20的USB電源引腳2〇1從該外 部電子裝置2獲得一高電平,從而與該電源引腳2〇1連 接的輸入端1011也處於高電平◦該第一輸出端1012通過 電阻R1與該輸入端1011連接而處於高電平,該NPN三極 管Q1的控制端接收到該高電平信號後,使得該N P N三極管 Q1導通。該開關電路ί 04的控制端通過該導通的N P N三極 管Q1而處於低電平,從而該開關電路1〇4截北,該電源4〇 至電源引腳201的電流路徑被切斷。 [0027] 當該輸入端1011處於高電平時,該第二輪出端1〇13也通 過該電阻R2、R3的分壓作用而處於高電平,該選擇電路 103選擇該處理單元3〇的Device D+、Device D—引腳 分別與該USB介面2〇的d+、D—引腳進行連接。 [0028] 從而該USB介面20外接主設備時,該電子裝置丨不對該 USB介面20的電源引腳201供電而選擇由外部主機設備供 電’同時將處理單元30的Device D+、Device D—引腳 分別與該USB介面20的D+、D—引腳連接,該電子裝置i 處於從設備模式。 當5亥電子裝置1通過该USB介面20與作為從設備的外部電 子裝置連接時。該USB介面20的USB電源引腳2〇丨處於一 低電平’從而與該USB電源引腳201連接的輸入端1〇11也 098128644 表單編號A0101 第10頁/共18頁 0982049184-0 [0029] 201107991 處於低電平。該第—輸出端1012通過電阻R1與該輸入端 】〇11連接而處於低電平,該ΝΡΝ三極管Q1的控制端接收 到該低電平後,使得該NPN三級管Q1截止。從而開關電路 104的控制端處於高電平,開關電路1〇4導通,該電源4〇 與電源引腳201連接。 [0030] Ο [0031] [0032] 〇 [0033] 當該輸入端1011處於低電平時’該第二輸出端1〇13也通 過該電阻R2、R3的分壓作用而處於低電平,該選擇電路 1〇3選擇該處理單元3〇的Host D+、Host D—引腳與該 USB介面的D+、D—引腳進行連揍。 從而該USB介面20外接從設備時’該電子裝置1對電源引 腳201供電,同時該選擇電路103選擇該處理單元3〇的 Host D+ ' Host D一引腳與5玄USB引腳的.D+、D —~引腳進 行連接,該電子設備處於主設備模式。^ 【圖式簡單說明】 圖1為可自動切換USB主從設備模式的電子裝置的功能模 組圖。 卜 圖2為圖1所示可自動切換USB主從設備模式的電子裝置的 具體電路圖。 【主要元件符號說明】 _ [0034] USB主從模式 切換電路 10 USB介面 — 20 ~ 處理單元 30 電源 40 主從選擇觸發 101 控制單元 102 電路 _ .表單編號A0101 第11頁/共18頁 0982049184-0 098128644 201107991 選擇電路 103 開關電路 104 電源引腳 201 數據?丨腳 202 主設備控制引 302 從設備控制引 301 腳 腳 外部電子裝置 2 輸入端 1011 第一輸出端 1012 第二輸出端 1013 電阻 R1/R2/R3/R4 NPN三極管 Q1 從設備控制引 Device D+/ 主設備控制引 Host D+/ 腳 Device D— 腳 Host D — 098128644 表單編號A0101 第12頁/共18頁 0982049184-0The master-slave selection trigger circuit 101 is configured to detect the type of the external electronic device 2 connected to the electronic device via the USB, . . . , interface 20. When the master-slave selection trigger circuit 101 detects that the power pin 2〇1 connected to the wheelfill 1011 is at a high level, the master-slave selection trigger circuit 101 determines that the external electronic device 2 is the master device, and passes the The second output sends a slave trigger signal. When the master-slave selection trigger circuit 101 detects that the power pin 201 connected to the input terminal 1 is low level, the master-slave selection trigger circuit 1〇1 determines that the external electronic device 2 is a slave device. The device sends a main trigger signal through the first and second outputs. The control unit 102 is also connected to the switch circuit 1〇4, and the switch circuit 104 is simultaneously connected between the power source 40 and the USB power pin 2〇1. When the control unit 102 receives the slave trigger signal sent by the first output terminal, the β-axis control early element 1 〇 2 controls the switch circuit 1 〇 4 to be turned off, and the connection of the power source 4 〇 to the USB power pin 201 is cut off. . When the control unit 102 receives the main trigger signal sent by the first output terminal, the control unit 102 controls the switch circuit 104 to be turned on, and the power source 40 supplies power to the USB power pin 2〇1 098128644 Form No. A0101 Page 7/ A total of 18 pages 0992049184-0 201107991 [0018] The selection circuit 103 is connected to the second output terminal 13 13 for selecting the slave device control of the processing unit 3 according to receiving a trigger signal from the second output terminal. Pin 3.1 or the master control pin 302 is coupled to the data pin 202 of the USB interface 20. When the selection circuit 1〇3 receives the slave trigger signal from the second output terminal 1013, the selection circuit 1〇3 controls the data of the slave device control pin 3〇1 of the processing unit 30 and the USB interface 20. Pin 202 is connected. When the selection circuit 1〇3 receives the main trigger signal sent by the second output terminal 1013, the selection circuit controls the master device of the processing unit 30. 302 is connected to the data pin 202 of the face (four). Therefore, when the external electronic device connected to the USB interface 20 of the electronic device 1 is the main device, the electronic device 1 does not supply power to the power pin 201 of the USB interface 20, and the processing unit 30 From the connection of the device control pin 301 to the data pin 202 of the USB interface 20, the electronic device 1 operates... in the slave device mode. When the external electronic device connected to the interface 20 of the electronic device 1 is a slave device, the electronic device 1 supplies power to the power pin 201 of the USB interface 30, and the master device control pin 302 of the processing unit 40 and the USB device The data pin 202 of the interface 20 is connected, and the electronic device 1 operates in the master mode. [0020] As shown in FIG. 2, it is a specific circuit diagram of an electronic device that can automatically switch the USB master-slave mode. In the present embodiment, the master-slave selection trigger circuit 101 includes a first resistor R1, a second resistor R2, and a third resistor R3'. The connection node a of the first resistor R1 and the second resistor R2 constitutes the master-slave selection. Input terminal 1011 of trigger circuit 101 'The first resistor R1 is away from the 098128644 Form No. A0101 Page 8 / 18 pages 0992049184-0 201107991 [0021] Ο [0022] [0024] [0025] [0025] The R2 terminal Β constitutes the first output terminal 1012 of the master-slave selection trigger circuit 101, and the connection point C of the second resistor R2 and the second resistor Μ constitutes the second output terminal 1013 of the master-slave selection trigger circuit 10 The unit 102 is a high-voltage turn-on switch 'including a control terminal, a first conductive terminal and a second conductive terminal. In the present embodiment, the control switch 102 is described by taking a triode Q1 as an example. The control terminal 'the first conduction end and the second conduction end respectively correspond to the base, the emitter and the collector of the triode Qi. In other embodiments, the control unit 102 can be an NMOS transistor. The base of the NPN transistor is connected to the first output terminal 1012, the emitter is grounded, and the collector is connected to a control terminal of the switch circuit 104. In the embodiment, the switch circuit 104 is a high-level switch circuit. 'Includes the control terminal, a first conduction terminal, and a second conduction terminal. The control terminal is connected to the second conductive terminal of the control unit 102, and the first conductive terminal is connected to the power supply 60, and the second conductive terminal is connected to the USB power supply pin 201. In the present embodiment, the switch circuit 1〇4 is an NMOS transistor. In other embodiments, the switch circuit 104 can be an NPN transistor. In the present embodiment, the slave device control pin 301 of the processing unit 30 includes Device D+, Device D - two pins. The master device control pin 302 includes two pins, Host D+ and Host D. The data pin 202 of the USB interface 20 includes -j)+ and a ρ-pin. The selection circuit 103 is specifically a double-pole double-throw switch, and includes a control terminal connected to the second input terminal 1013. The two common terminals are respectively connected to the data pins D+ and ]) of the USB interface 20, and the four contact terminals are respectively connected. Device D+, Device D — pin in slave pin 301 and master D+, Host D in master device pin 302 of processing unit 098128644 Form number A0101 page 9/18 page 0982049184-0 201107991 30 Pin Connection [0026] When the electronic device 1 is connected to the external electronic device 2 as a master device through the USB interface 20. The USB power pin 2〇1 of the USB interface 20 obtains a high level from the external electronic device 2, so that the input terminal 1011 connected to the power pin 2〇1 is also at a high level, the first output terminal 1012. The resistor R1 is connected to the input terminal 1011 to be at a high level. After receiving the high level signal, the control terminal of the NPN transistor Q1 turns on the NPN transistor Q1. The control terminal of the switching circuit ί 04 is at a low level through the turned-on N P N transistor Q1, so that the switching circuit 1〇4 is cut off, and the current path of the power supply 4 to the power supply pin 201 is cut off. [0027] When the input terminal 1011 is at a high level, the second wheel terminal 1〇13 is also at a high level by the voltage dividing action of the resistors R2 and R3, and the selection circuit 103 selects the processing unit 3〇. The Device D+ and Device D- pins are respectively connected to the d+ and D- pins of the USB interface. [0028] When the USB interface 20 is externally connected to the host device, the electronic device does not supply power to the power pin 201 of the USB interface 20 and is selected to be powered by the external host device. Meanwhile, the Device D+, Device D-pin of the processing unit 30 is selected. Connected to the D+, D- pins of the USB interface 20, respectively, the electronic device i is in the slave mode. When the 5H electronic device 1 is connected through the USB interface 20 to an external electronic device as a slave device. The USB power pin 2 of the USB interface 20 is at a low level, so that the input terminal connected to the USB power pin 201 is also 098128644. Form number A0101 Page 10/18 pages 0982049184-0 [0029 ] 201107991 is at a low level. The first output terminal 1012 is connected to the input terminal 〇11 through the resistor R1 and is at a low level. After the control terminal of the ΝΡΝ transistor Q1 receives the low level, the NPN tertiary tube Q1 is turned off. Therefore, the control terminal of the switch circuit 104 is at a high level, the switch circuit 1〇4 is turned on, and the power source 4〇 is connected to the power pin 201. [0033] [0033] When the input terminal 1011 is at a low level, the second output terminal 1〇13 is also at a low level by the voltage division of the resistors R2 and R3. The selection circuit 1〇3 selects the Host D+ and Host D− pins of the processing unit 3〇 to be connected to the D+ and D− pins of the USB interface. Therefore, when the USB interface 20 is externally connected to the slave device, the electronic device 1 supplies power to the power pin 201, and the selection circuit 103 selects the Host D+ 'Host D pin of the processing unit 3〇 and the .D+ of the 5 Xuan USB pin. The D —~ pin is connected and the electronic device is in master mode. ^ [Simple description of the diagram] Figure 1 is a functional block diagram of an electronic device that can automatically switch between USB master and slave modes. FIG. 2 is a specific circuit diagram of the electronic device capable of automatically switching the USB master-slave mode shown in FIG. 1. [Main component symbol description] _ [0034] USB master-slave mode switching circuit 10 USB interface - 20 ~ Processing unit 30 Power supply 40 Master-slave selection trigger 101 Control unit 102 Circuit_. Form No. A0101 Page 11 of 18 0982049184- 0 098128644 201107991 Select Circuit 103 Switch Circuit 104 Power Pin 201 Data?丨 202 202 Master device control reference 302 Slave device control 301 pin External electronic device 2 Input terminal 1011 First output terminal 1012 Second output terminal 1013 Resistor R1/R2/R3/R4 NPN transistor Q1 Slave device control Device D+/ Master device control Host D+/ Foot Device D—Foot Host D — 098128644 Form No. A0101 Page 12 of 18 0982049184-0

Claims (1)

201107991 七、申請專利範圍: 1 . 一種可自動切換USB主從設備模式的電子裝置,用於一電 子裝置主從設備模式的切換,該電子裝置包括一USB介面 、一處理單元以及一電源,該USB介面包括一電源引腳以 及一數據引腳,其改進在於,該可自動切換USB主從設備 模式的電子裝置還包括: 一主從選擇觸發電路,包括一輸入端、一第一輸出端以及 一第二輸出端,該輸入端與該USB介面的電源引腳連接, 當該主從選擇觸發電路偵測與該輸入端連接的USB介面電 〇 源引腳為低電平時,判斷該外部電子裝置為從設備,並通 過第一、第二輸出端發出主觸發信號,當該主從選擇觸發 電路偵測與該輸入端連接的USB介面電源引腳為高電平時 « ;; v /:,:1¾1¾ :Ϊ:· ·:··Γ·:..........:· .: ,判斷該外部電子裝置為主設備,第一、第二輸出端發出 從觸發信號; 一開關電路,連接於該電子裝置電源與該USB電源引腳之 間; Q 一控制單元,與該第一輸出端以及該開關電路分別連接, 用於接收第一輸出端輸出的觸發信號,當該觸發信號為從 觸發信號時,則該開關控制單元控制該開關單元截止,切 斷該電子裝置電源與該USB電源引腳的連接,當該觸發信 號為主觸發信號時,該控制單元控制該開關單元導通,該 電子裝置電源對該USB電源引腳供電; 一選擇電路,與該第二輸出端連接,用於根據接收自第二 輸出端的觸發信號來選擇處理單元的主從設備模式,當該 觸發信號為從觸發信號時,該處理單元的從設備引腳與該 098128644 表單編號A0101 第13頁/共18頁 0982049184-0 201107991 USB數據引腳連接,該處理單元控制該電子裝置工作在從 設備模式,當該觸發信號為主觸發信號時,該處理單元的 主設備引腳與該USB數據引腳連接,該處理單元控制該電 子裝置工作在主設備模式。 2 .如申請專利範圍第1項所述之可自動切換USB主從設備模 式的電子裝置,其中該主從選擇觸發電路包括一第一電阻 、一第二電阻以及一第三電阻,該第一電阻與該第二電阻 的連接節點為該主從選擇觸發電路的輸入端,該第一電阻 遠離與該第二電阻端為主從選擇觸發電路的第一輸出端, 該第二電阻與該第三電阻的連接節點為主從選擇觸發電路 的第二輸出端。 3 .如申請專利範圍第2項所述之可自動切換USB主從設備模 式的電子裝置,其中該控制單元為一高電平導通開關,包 括一控制端、一第一導通端以及一第二導通端,該控制端 與該主從選擇觸發電路的第一輸出端連接,該第一導通端 接地,該第二導通端與該開關單元連接。 4 .如申請專利範圍第3項所述之可自動切換USB主從設備模 式的電子裝置,其中該開關電路為一高電平導通開關,包 括一控制端、一第一導通端以及一第二導通端,該控制端 與該開關第二導通端,該第一導通端與該電源連接,該第 二導通端與該USB電源引腳連接,其中,該開關單元的控 制端還通過一第四電阻與該電源連接。 5 .如申請專利範圍第4項所述之可自動切換USB主從設備模 式的電子裝置,其中該電子裝置與主機設備連接時,該主 機設備通過該USB介面提供一高電平信號至主從選擇觸發 電路的輸入端,該第一輸出端通過該第一電阻與該輸入端 098128644 表單編號A0101 第14頁/共18頁 0982049184-0 201107991201107991 VII. Patent application scope: 1. An electronic device capable of automatically switching the mode of the USB master-slave device for switching the master-slave mode of an electronic device, the electronic device comprising a USB interface, a processing unit and a power source, The USB interface includes a power pin and a data pin, and the improvement is that the electronic device capable of automatically switching the USB master-slave mode further includes: a master-slave selection trigger circuit, including an input terminal, a first output terminal, and a second output end, the input end is connected to a power pin of the USB interface, and when the master-slave selection trigger circuit detects that the USB interface power supply pin connected to the input terminal is low level, determining the external electronic The device is a slave device and sends a main trigger signal through the first and second output terminals. When the master-slave selection trigger circuit detects that the USB interface power supply pin connected to the input terminal is high level « ;; v /:, :13⁄413⁄4 :Ϊ:· ·:··Γ·:..........:·.: , judge that the external electronic device is the master device, and the first and second outputs emit a slave trigger signal; Switch circuit Connected between the power supply of the electronic device and the USB power supply pin; a control unit is respectively connected to the first output end and the switch circuit, and is configured to receive a trigger signal outputted by the first output end, when the trigger signal is When the trigger signal is received, the switch control unit controls the switch unit to be turned off, and disconnects the power supply of the electronic device from the USB power pin. When the trigger signal is the main trigger signal, the control unit controls the switch unit to be turned on. The electronic device power supply powers the USB power pin; a selection circuit is coupled to the second output terminal for selecting a master-slave mode of the processing unit according to the trigger signal received from the second output terminal, when the trigger signal is When the slave signal is triggered, the slave device pin of the processing unit is connected to the USB data pin of the 098128644 form number A0101 page 13 / 18 pages 0992049184-0 201107991, the processing unit controls the electronic device to operate in the slave mode, When the trigger signal is the main trigger signal, the main device pin of the processing unit is connected to the USB data pin, where Unit controls the electronic device operates in the master mode. 2. The electronic device capable of automatically switching a USB master-slave mode as described in claim 1, wherein the master-slave selection trigger circuit comprises a first resistor, a second resistor, and a third resistor, the first a connection node of the resistor and the second resistor is an input end of the master-slave selection trigger circuit, and the first resistor is away from a first output end of the second resistor terminal as a master-slave selection trigger circuit, the second resistor and the first resistor The connection node of the three resistors is the second output terminal of the master-slave selection trigger circuit. 3. The electronic device capable of automatically switching the USB master-slave mode as described in claim 2, wherein the control unit is a high-level switch, including a control terminal, a first conductive terminal, and a second The control terminal is connected to the first output end of the master-slave selection trigger circuit, the first conductive terminal is grounded, and the second conductive terminal is connected to the switch unit. 4. The electronic device capable of automatically switching the USB master-slave mode as described in claim 3, wherein the switch circuit is a high-level switch, including a control terminal, a first conductive terminal, and a second a conduction end, the control end and the second conduction end of the switch, the first conduction end is connected to the power source, the second conduction end is connected to the USB power supply pin, wherein the control end of the switch unit further passes a fourth A resistor is connected to the power source. 5. The electronic device capable of automatically switching a USB master-slave mode as described in claim 4, wherein when the electronic device is connected to the host device, the host device provides a high level signal to the master-slave through the USB interface. Selecting an input terminal of the trigger circuit, the first output terminal passes the first resistor and the input terminal 098128644. Form number A0101 page 14 / 18 pages 0992049184-0 201107991 Ο 8 . 連接從而也獲得一高電平,該控制單元的控制端處於高電 平而使得該控制單元導通,該開關電路的控制端通過該導 通的控制單元接地而處於低電平,該開關電路截止;當該 電子裝置與主機設備連接時,該輸入端處於低電平,從而 該通過第一電阻與該輸入端連接的第一輸出端也處於低電 平,該控制單元的控制端處於低電平而使得該控制單元截 止’該開關電路的控制端通過該第四電阻與該電源連接而 獲得一高電平,從而使得該開關電路導通。 如申請專利範圍第2項所述之可自動切換USB主從設備模 式的電子裝置,其中該選擇電路為一雙刀雙擲開關電路, 包括一控制端,該控制端與該主從選擇觸發電路的第二輸 出端連接,當該控制端接收到主觸發信號時,該雙刀雙擲 開關電路將該主機USB數據引腳與該處理單元的主設備控 制引腳連接,當該控制開關接收到從觸發信號時,該雙刀 雙擲開關電路將該從機USB數據引腳與該處理單元的從設 備數據引腳連接。 如申請專利範圍第6項所述之可自動切換USB主從設備模 式的電子裝置,其中該處理單元的主控制引腳與USB數據 引腳連接後,該處理單元工作在主設備模式,即’將該電 子裝置作為主設備,而將該通過USB數據引腳連接的外部 電子裝置作為從設備,該處理單元的從控制引腳與USB數 據引腳連接後,該處理單元工作在從設備模式,即,將該 電子裝置作為從設備’而將該通過USB數據引腳連接的外 部電子裝置作為主設備° 如申請專利範圍第3項所述之可自動切換USB主從設備模 式的電子裝置,其中該控制單元為一NM0S管或一NPN三極 098128644 表單编號A0101 第15頁/共18頁 0982049184-0 201107991 管。 9 .如申請專利範圍第4項所述之可自動切換USB主從設備模 式的電子裝置,其中該開關電路為一NM0S管或一NPN三極 管0 098128644 表單編號A0101 第16頁/共18頁 0982049184-0Ο 8. The connection thus also obtains a high level, the control terminal of the control unit is at a high level to cause the control unit to be turned on, and the control terminal of the switch circuit is at a low level through the conductive control unit being grounded, the switch The circuit is cut off; when the electronic device is connected to the host device, the input terminal is at a low level, so that the first output terminal connected to the input terminal through the first resistor is also at a low level, and the control end of the control unit is at a low level The low level causes the control unit to turn off. The control terminal of the switch circuit obtains a high level by connecting the fourth resistor to the power source, thereby causing the switch circuit to be turned on. The electronic device capable of automatically switching the USB master-slave mode, as described in claim 2, wherein the selection circuit is a double-pole double-throw switch circuit, including a control terminal, the control terminal and the master-slave selection trigger circuit The second output terminal is connected. When the control terminal receives the main trigger signal, the double-pole double-throw switch circuit connects the host USB data pin to the main device control pin of the processing unit, and when the control switch receives The slave double throw switch circuit connects the slave USB data pin to the slave data pin of the processing unit when the trigger signal is received. The electronic device capable of automatically switching the USB master-slave mode, as described in claim 6, wherein the processing unit operates in the master mode after the main control pin of the processing unit is connected to the USB data pin, that is, The electronic device is used as a master device, and the external electronic device connected through the USB data pin is used as a slave device. After the slave control pin of the processing unit is connected to the USB data pin, the processing unit operates in the slave device mode. That is, the electronic device is used as the slave device, and the external electronic device connected through the USB data pin is used as the master device. The electronic device capable of automatically switching the USB master-slave device mode as described in claim 3, wherein The control unit is an NM0S tube or an NPN three-pole 098128644 form number A0101 page 15 / 18 pages 0982049184-0 201107991 tube. 9. The electronic device capable of automatically switching the USB master-slave mode as described in claim 4, wherein the switch circuit is an NM0S tube or an NPN transistor 0 098128644 Form No. A0101 Page 16 of 18 0982049184- 0
TW98128644A 2009-08-26 2009-08-26 Electronic device capable of switching between a USB master and a USB slave mode automatically TW201107991A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW98128644A TW201107991A (en) 2009-08-26 2009-08-26 Electronic device capable of switching between a USB master and a USB slave mode automatically

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW98128644A TW201107991A (en) 2009-08-26 2009-08-26 Electronic device capable of switching between a USB master and a USB slave mode automatically

Publications (1)

Publication Number Publication Date
TW201107991A true TW201107991A (en) 2011-03-01

Family

ID=44835475

Family Applications (1)

Application Number Title Priority Date Filing Date
TW98128644A TW201107991A (en) 2009-08-26 2009-08-26 Electronic device capable of switching between a USB master and a USB slave mode automatically

Country Status (1)

Country Link
TW (1) TW201107991A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092793A (en) * 2011-11-01 2013-05-08 联想(北京)有限公司 Switching method and electronic terminal
CN103346448A (en) * 2013-07-20 2013-10-09 青岛歌尔声学科技有限公司 Universal serial bus (USB) line system
CN103460158A (en) * 2011-04-01 2013-12-18 松下电器产业株式会社 Interface relay device and interface relay method
CN103792855A (en) * 2012-10-31 2014-05-14 绿智慧流科技公司 Switching apparatus
TWI475392B (en) * 2012-05-29 2015-03-01 Acer Inc Dual mode electronic device, electronic system and master terminal judging method
CN107196409A (en) * 2016-03-14 2017-09-22 浙江正泰电器股份有限公司 The intelligent controller of breaker

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103460158A (en) * 2011-04-01 2013-12-18 松下电器产业株式会社 Interface relay device and interface relay method
CN103092793A (en) * 2011-11-01 2013-05-08 联想(北京)有限公司 Switching method and electronic terminal
CN103092793B (en) * 2011-11-01 2016-03-02 联想(北京)有限公司 A kind of changing method and electric terminal
TWI475392B (en) * 2012-05-29 2015-03-01 Acer Inc Dual mode electronic device, electronic system and master terminal judging method
CN103792855A (en) * 2012-10-31 2014-05-14 绿智慧流科技公司 Switching apparatus
CN103346448A (en) * 2013-07-20 2013-10-09 青岛歌尔声学科技有限公司 Universal serial bus (USB) line system
CN107196409A (en) * 2016-03-14 2017-09-22 浙江正泰电器股份有限公司 The intelligent controller of breaker
CN107196409B (en) * 2016-03-14 2024-02-23 浙江正泰电器股份有限公司 Intelligent controller of circuit breaker

Similar Documents

Publication Publication Date Title
US8095714B2 (en) Electronic device capable of automatically switching between a master mode and a slave mode
TWI468920B (en) Electronic device with power consumption detection function
TW201107991A (en) Electronic device capable of switching between a USB master and a USB slave mode automatically
US7917782B2 (en) Computer device having display device capable of being automatically turned off or turned on according to switch motion of host
JP2018160245A (en) Power-up control circuit and mobile battery
US20110169521A1 (en) Testing system for power supply unit
WO2018040381A1 (en) Reversible plugging-recognizing power supply device and smart charging device
US20120290853A1 (en) Indicator light control circuuit
US20080203818A1 (en) Double power sources switching circuit
TW201906237A (en) Power supply charging path switching circuit and electronic device thereof
TW201344409A (en) Electronic device
CN108650755B (en) Linear constant-current driving chip and multi-chip parallel LED lighting driving circuit
CN222073142U (en) Interface multiplexing circuit
US8996894B2 (en) Method of booting a motherboard in a server upon a successful power supply to a hard disk driver backplane
TWI540419B (en) Electronic device
CN206364915U (en) The control circuit and television set of television set
CN112104224A (en) Power supply circuit and control chip, control circuit and control method thereof
TW201301013A (en) Electrical device
TW201216566A (en) Circuit for swapping a memory card in an electronic device
CN108631377B (en) Power-on control circuit and mobile power supply device using the same
TWI468921B (en) Server and booting method thereof
TW201105001A (en) Electronic device capable of indicating charge state
US20120173863A1 (en) Electronic device
TW201530302A (en) Circuit of on/off switch test
TW201342992A (en) Constant current drive circuit for LED