201104398 六、發明說明: 【發明所屬之技術領域】 [οοοπ 本發明涉及一種動態分配通用串列匯流排(Universal Serial Bus ’ USB)埠電源的電子設備及方法° 【先前技術】 [匿]USB埠是一種4線序列埠’其包括兩個資料線(D+,D_) ,一個電源線(Vbus)和一個接地線(GND) °通常’具 有USB槔的電子設備可以為插入其的USB設備’例如·硬 碟等,提供電源。因此,上述USB設備在其内部不包括電 源的情況下也同樣可以工作。 [〇〇〇3] 目前,現行的USB埠標準規定每個USB埠允許提供的最大 電壓和電流分別為5V和500mA,所以當某一個USB設備電 流需求超過500mA時,使用者需要再接線至其他USB埠以 獲取額外的電流,給使用者造成諸多不便。 【發明内容】 * [0004] 本發明實施方式中的動態分配USB埠電源的電子設備,其 具有複數USB埠,其中’每個USB埠對應連接一個USB設 備,該電子設備包括總電流檢測電路、複數短路檢測電 路、複數中繼電路以及USB控制器。其中,總電流檢測電 路用於接收USB埠驅動電摩並傳送至usb璋,並檢測提供 給USB埠的總電流是否超過額定總電流,並輸出總電流檢 、'、、果知路檢測電路連接於總電流檢測電路與對應的 β皁之間,用於檢測插入其對應的USB埠中的USB設備 _ %路並輸出短路檢測結果。中繼電路對應連接於 檢測電路與USB埠之間,用於接通/切斷USB璋與其内 098125625 表單編號A0101 第4頁/共23頁 0982043829-0 201104398 部電路的連接。USB控制器與總電流檢測電路、複數短路 檢測電路以及複數中繼電路相連,用於根據總電流檢測 結果以及短路檢測結果輸出控制訊號,從而控制中繼電 路通斷對應的USB埠。 [0005] Ο [0006] [0007] 〇 本發明實施方式中的動態分配USB埠電源的方法,包括以 下步驟:接收USB設備插入訊號;判斷插入的USB設備是 否短路;如果沒有短路的話,判斷流過USB埠的總電流是 否大於額定總電流;以及如果沒有大於額定總電流的話 ,分配電源給相應的1383埠。 本發明中,電子設備利用總電流檢測電路以及複數短路 檢測電路檢測USB埠的總電流是否超過額定總電流以及檢 測每個插入的USB設備是否短路,從而控制中繼電路通斷 對應的USB埠,實現USB埠電源的動態分配。 【實施方式】 圖1為本發明動態分配通用串列匯流排( Universal Serial Bus,USB)電源的電子設備1的模組圖。其中, 電子設備1包括電源轉換電路11〇、總電流檢測電路120、 複數短路檢測電路131、132、133、134、USB控制器 140、複數中繼電路151、152、153、154以及複數USB 埠 161、162、163、164。其中 ’ USB埠 161、162、163 、164可以選擇連接USB設備21、22、23、24中的一個或 者複數個。本實施方式中,僅以四個USB墀為例予以說明 ,其他實施方式中,USB埠的數量可以不同。且,每個 USB埠都對應有一個短路檢測電路與中繼電路’因此’本 實施方式的電子設備1中短路檢測電路與中繼電路的數量 098125625 表單編號A0101 第5頁/共23頁 0982043829-0 201104398 均為四個。 [0008] [0009] 電源轉換電路1 1 〇用於將外部交流電源轉換為可驅動該等 USB埠161、162、163、164的電源,例如:5V。總電流 檢測電路120與電源轉換電路11〇相連,用於接收USB埠 驅動電愿並傳送至USB埠161、162、163、164,並檢測 供給USB埠161、162、163、164的總電流是否超過額定 總電流,並輸出總電流檢消丨結果。短路檢測電路131、 132、133、134連接於總電流檢測電路12〇與對應的USB 埠161、162、163、164之間’用於檢測插入其對應的 USB埠中的USB設備是否發生短路,盐輸斑短路檢測結果 β中繼電路151、152、153、154對應連接於短路檢測電 路 13卜 132、133、134與USB埠161、162、163、164 之間,用於切斷USB埠與電子設備1内部電路的連接,即 切斷某個USB埠與其對應的短路檢測電路131的連接。 USB控制器14〇與總電流檢判電路12〇、短路檢測電路131 、132、133、134以及中繼電路 151、152、153、154相 : :; . 連,用於根據總電流檢測結果以及短路檢測結果輸出控 制訊號,從而控制中繼電路151、1 52、153、154通斷 USB埠1 η、丨62 ' 163、164與其對應的内部電路的連接201104398 VI. Description of the Invention: [Technical Field of the Invention] [Omb] The present invention relates to an electronic device and method for dynamically allocating a universal serial bus (USB) power supply. [Prior Art] [Hidden] USB埠Is a 4-wire sequence 埠 'which includes two data lines (D+, D_), one power line (Vbus) and one ground line (GND) ° Usually 'electronic devices with USB ports can be plugged into their USB devices' eg · A hard disk, etc., provides power. Therefore, the USB device described above can also operate without including a power source inside. [〇〇〇3] At present, the current USB standard specifies that the maximum voltage and current allowed by each USB port are 5V and 500mA, respectively. Therefore, when the current demand of a USB device exceeds 500mA, the user needs to wire it to other devices. USB 埠 to get extra current, causing a lot of inconvenience to the user. SUMMARY OF THE INVENTION [0004] An electronic device for dynamically allocating a USB power source in an embodiment of the present invention has a plurality of USB ports, wherein each USB port is connected to a USB device, and the electronic device includes a total current detecting circuit. A complex short circuit detection circuit, a plurality of relay circuits, and a USB controller. Wherein, the total current detecting circuit is configured to receive the USB 埠 driving electric motor and transmit it to the usb 璋, and detect whether the total current supplied to the USB 超过 exceeds the rated total current, and output the total current check, ',, the kinetic road detecting circuit connection Between the total current detecting circuit and the corresponding β soap, it is used to detect the USB device _ % channel inserted in its corresponding USB port and output a short circuit detection result. The relay circuit is connected between the detection circuit and the USB port, and is used to connect/disconnect the USB port and the circuit of the 098125625 form number A0101 page 4/23 page 0982043829-0 201104398. The USB controller is connected to the total current detecting circuit, the complex short circuit detecting circuit and the plurality of relay circuits, and is configured to output a control signal according to the total current detecting result and the short circuit detecting result, thereby controlling the USB port corresponding to the relay circuit. [0005] A method for dynamically allocating a USB power supply in an embodiment of the present invention includes the steps of: receiving a USB device insertion signal; determining whether the inserted USB device is short-circuited; and if there is no short circuit, determining the flow Whether the total current through the USB port is greater than the rated total current; and if there is no greater than the rated total current, distribute the power to the corresponding 1383埠. In the present invention, the electronic device uses the total current detecting circuit and the complex short-circuit detecting circuit to detect whether the total current of the USB port exceeds the rated total current and detects whether each inserted USB device is short-circuited, thereby controlling the USB port corresponding to the relay circuit. To achieve dynamic allocation of USB power. [Embodiment] FIG. 1 is a block diagram of an electronic device 1 for dynamically allocating a universal serial bus (USB) power supply according to the present invention. The electronic device 1 includes a power conversion circuit 11A, a total current detecting circuit 120, a plurality of short circuit detecting circuits 131, 132, 133, 134, a USB controller 140, a plurality of relay circuits 151, 152, 153, 154, and a plurality of USB devices.埠161, 162, 163, 164. Wherein 'USB 161, 162, 163, 164 can optionally connect one or more of the USB devices 21, 22, 23, 24. In the present embodiment, only four USB ports are taken as an example. In other embodiments, the number of USB ports may be different. Moreover, each USB port corresponds to a short circuit detecting circuit and a relay circuit. Therefore, the number of short circuit detecting circuits and relay circuits in the electronic device 1 of the present embodiment is 098125625. Form No. A0101 Page 5 of 23 0982043829-0 201104398 are all four. [0009] The power conversion circuit 1 1 is for converting external AC power to a power source that can drive the USB ports 161, 162, 163, 164, for example, 5V. The total current detecting circuit 120 is connected to the power conversion circuit 11A for receiving the USB drive and transmitting to the USB ports 161, 162, 163, 164, and detecting whether the total current supplied to the USB ports 161, 162, 163, 164 is Exceeds the rated total current and outputs the total current checkout result. The short circuit detecting circuits 131, 132, 133, 134 are connected between the total current detecting circuit 12 and the corresponding USB ports 161, 162, 163, 164 for detecting whether a USB device inserted in the corresponding USB port is short-circuited. Salt spot short-circuit detection result The β-relay circuits 151, 152, 153, and 154 are connected between the short-circuit detecting circuit 13 132, 133, 134 and the USB ports 161, 162, 163, and 164 for cutting off the USB port. The connection with the internal circuit of the electronic device 1 is to cut off the connection of a certain USB port to its corresponding short circuit detecting circuit 131. The USB controller 14 is connected to the total current detecting circuit 12A, the short circuit detecting circuits 131, 132, 133, 134 and the relay circuits 151, 152, 153, 154: :; And the short-circuit detection result outputs a control signal, thereby controlling the connection of the relay circuit 151, 1 52, 153, 154 to the USB 埠 1 η, 丨 62 ' 163, 164 and its corresponding internal circuit.
。本實施方式中,節點vUSB與vusb,的電壓均大致等於5V 〇 請同時參閱圖2,所示為本發明USB埠動態分配電源的示 意圖。根據USB埠標準規定可知,每個USB埠允許提供的 最大電流為500mA,故,本實施方式中,USB埠161、162 、163、164的額定總電流即為4個USB蟑161、162、163 098125625 表單編號A0101 第6頁/共23頁 0982043829-0 201104398 、164的電流總和,即,2Α。由圖2可知,插入至USB埠 161、162、163的USB設備21、22、23所需的電流分別 為100mA·、300mA、800mA。由於USB設備23所需要的電 流超過USB璋標準所規定的最大電流(5〇〇mA),故,該 種USB設備被稱之為非標準USB設備《在傳統的方式中, 這種非標準USB設備就需要兩個以上的USB埠同時提供電 流。 [0010] ο ❹ 然而’在本實施方式中,當USB設備23插入至USB埠163 時,其對應的短路檢測電路133會檢測USB設備23是否短 路。如果發生短路,_路檢測電路133發送短路檢測訊號 至USB控制器140,則USB控制器140切斷USB璋163與電 子設備1内部電路的連接,並通知用卢移除插入的USB設 備23。當USB設備23移除後,USB控制器140重新啟動所 述USB埠163。如果沒有短路發生,總電流檢測電路120 同時也會檢測提供給USB埠161、162、163的總電流是否 超過額定總電流。如果超過額定總電流,則總電流檢測 電路120發出總電流檢測結果至USB控制器140,USB控制 器140同樣斷開USB埠163與電子設備1内部電路的連接, 並通知用戶移除插入的USB設備23。同樣,當USB設備23 移除後,USB控制器140重新啟動所述USB埠163。如果沒 有超過額定總電流,則電子設備1分配電源至USB埠163。 故,本實施方式中,非標準USB設備23僅需一個USB埠 163即可供電。 同樣地,當USB設備24插入至USB埠164時,短路檢測電 路134與總電流檢測電路120會進行同樣的檢測工作。也 098125625 表單編號A0101 第7頁/共23頁 0982043829-0 [0011] 201104398 就疋說’只有當USB设備24所需要的電流小於時, 電子设備1才有足夠的電源分配’反之,USB控制器140則 會按照預先設定好的規則切斷相應的USB埠,例如:最後 插入的USB埠(USB埠164),或者非標準USB埠(USB埠 163) ’與電子設備1内部的電路連接。當usb設備24移 除後,USB控制器140重新啟動所述USB埠164。 [0012] 由於短路檢測電路1 31、1 3 2、1 3 3、1 3 4與總電流檢測電 路120的内部電路均相同,故,本實施方式中僅以總電流 檢測電路12 0為例予以說明,如圖3所示。總電流檢測電 路12 0包括電流/電壓轉換電路121與寒壓比較電路12 2。 其中,電流/電壓轉換電路121用於將檢測到的電流訊號 轉換為電壓訊號’其包括電容C1、複數電阻Rl、R2、R3 、R4、R5以及運算放大器A1。電阻R1與電容C1並行連接 於總電流檢測電路120的輸入端(5V)與其輸出端(節點 VD1,e)之間’電阻R2串連於運算放大器A1的負極輸入端 與節點VMS之間,電阻R3串連於運算放大器A1正極輸入 端與5V之間,電阻R4連接於運算放大器A1的輸出端與負 極輸入端之間,電阻R5連接於運算放大器A1正極輸入端 與接地端之間。其中,電阻R2、R3、R4、R5與運算放大 器A1組成一個典型的放大電路,其放大係數取決於電阻 R4於R2的比值。且,運算放大器A1的輸出端輸出一個代 表感測到的電流大小的電壓訊號。 電壓比較電路122用於將電流/電壓轉換電路121輸出的電 壓訊號與參考電壓做比較,並輸出比較訊號至USB控制器 140,其包括兩個電BR6、R7以及比較器A2。其中,比 098125625 表單編號A0101 第8頁/共23頁 0982043829-0 [0013] 201104398 較器Α2的正極輸入端與運算放大器Α1的輪出端相連,其 負極輸入端通過電阻R6接地,並作為參考電壓端,其輸 出端與USB控制器140相連’並輪出比較訊號。電阻只7連 接於比較器A2的電源端與負極輸入端之間。本實施方式 中,電阻R6、R7組成分壓電路,用於分壓比較器μ電源 端的電源電S(3.3V) ’電阻R6上的分壓作為比較器A2 的參考電壓,即,0. 8V。 · <··· [0014] Ο 本實施方式中,當USB設備插入其對應的USB埠時,由於 負載電容效應會產生瞬間的突波電流,如果不予以抑制 的活’總電流檢測電路12〇與短路檢測電路Μι、Μ〗、 133、134則會誤動作’故,電容ci甩於抑制mb設備插 入其對應埠時所產生的突波電流(lnrush cUrrent)。 又,由於總電流檢測電路12〇的輸出電壓大致等於其輸入 的電壓’即’5V,也就是說,總電流檢細電路丨2〇的輸入 與輸出電壓壓差較小,故電阻R1選取阻值_小的電阻, 例如:0.1Ω。具體工作原理如下: 〇 [0015] 當USB設備插入其對應埠時,電容C1相當於短路,則5V提 供的電源全部供給電容C1充電,則無電流流經電阻R1, 相應地’電流/電壓轉換電路121無輸出,故,總電流檢 測電路120會忽略所述的瞬間突波電流。同樣地,短路檢 測電路131、132、133、134也不工作。由於電容C1的充 電時間可以調整為與突波電流出現瞬間的時間相匹配, 則當電子設備1正常工作時,電容C1充電飽和,因此,此 時會有電流流經電阻R1。 若USB埠161、162、163、164的總電流未超過額定總電 098125625 表單編號A0101 第9頁/共23頁 0982043829-0 [0016] 201104398 流時,流經電阻R1的電流較小,則電阻R1上的分壓較小 ,該分壓通過運算放大器A1運算後輸出一個電壓訊號至 電壓比較電路122。本實施方式中,運算放大器A1的放大 倍數為0.4。在電壓比較電路122中,比較器A2正極輸入 端接收到運算放大器A1輸出的電壓訊號,由於此時所述 電壓訊號小於負極參考電壓訊號,因此,比較器A2輸出 低電平總電流檢測訊號,例如:0V,至USB控制器140。 此時,USB控制器140根據接收到的低電平總電流檢測訊 號控制電子設備1分配電源至相應的USB埠。 [0017] 若USB埠161、162、163、164的總電流超過額定總電流 時,流經電阻R1的電流較大,則電阻R1上的分壓較大, 該分壓通過運算放大器A1運算後輸出一個電壓訊號至電 壓比較電路122。在電壓比較電路122中,比較器A2正極 輸入端接收到運算放大器A1輸出的電壓訊號,由於此時 所述電壓訊號大於負極參考電壓訊號,因此,比較器A2 輸出高電平總電流檢測訊號,例如:3. 3V,至USB控制器 140。此時,USB控制器140根據接收到的高電平總電流 檢測訊號控制相應的中繼電路切斷對應的USB埠。 [0018] 本實施方式中,短路檢測電路131、132、133、134的内 部電路架構與總電流檢測電路120的内部電路架構大致相 同,區別在於:電流/電壓轉換電路中,5V替換為節 D U Ο 點,VDT,。節點替換為節點。二者工作原理也完全相. In this embodiment, the voltages of the nodes vUSB and vusb are both equal to 5V. Referring to FIG. 2 at the same time, the USB power dynamic distribution power supply of the present invention is shown. According to the USB standard, the maximum current allowed by each USB port is 500mA. Therefore, in this embodiment, the rated total current of the USB ports 161, 162, 163, and 164 is 4 USB ports 161, 162, and 163. 098125625 Form No. A0101 Page 6 of 23 page 0982043829-0 201104398 The sum of the currents of 164, ie, 2Α. As can be seen from Fig. 2, the currents required for the USB devices 21, 22, and 23 inserted into the USB ports 161, 162, and 163 are 100 mA·, 300 mA, and 800 mA, respectively. Since the current required by the USB device 23 exceeds the maximum current (5 mA) specified by the USB standard, such a USB device is referred to as a non-standard USB device. In a conventional manner, such a non-standard USB The device requires more than two USB ports to supply current simultaneously. [0010] ο However, in the present embodiment, when the USB device 23 is inserted into the USB port 163, its corresponding short circuit detecting circuit 133 detects whether or not the USB device 23 is short-circuited. If a short circuit occurs, the _ path detecting circuit 133 sends a short circuit detecting signal to the USB controller 140, and the USB controller 140 disconnects the USB port 163 from the internal circuit of the electronic device 1, and notifies the USB device 23 that the inserted device is removed. When the USB device 23 is removed, the USB controller 140 restarts the USB port 163. If no short circuit occurs, the total current detecting circuit 120 also detects whether the total current supplied to the USB ports 161, 162, 163 exceeds the rated total current. If the rated total current is exceeded, the total current detecting circuit 120 sends a total current detection result to the USB controller 140, and the USB controller 140 also disconnects the USB port 163 from the internal circuit of the electronic device 1 and notifies the user to remove the inserted USB. Device 23. Also, when the USB device 23 is removed, the USB controller 140 restarts the USB port 163. If the rated total current is not exceeded, the electronic device 1 distributes the power to the USB port 163. Therefore, in the present embodiment, the non-standard USB device 23 requires only one USB port 163 to supply power. Similarly, when the USB device 24 is inserted into the USB port 164, the short detection circuit 134 performs the same detection operation as the total current detecting circuit 120. Also 098125625 Form No. A0101 Page 7 / Total 23 Page 0992043829-0 [0011] 201104398 Just say 'Only when the current required by USB device 24 is less, electronic device 1 has enough power to distribute'. Otherwise, USB The controller 140 cuts off the corresponding USB port according to a preset rule, for example, the last inserted USB port (USB port 164), or the non-standard USB port (USB port 163) 'connects with the circuit inside the electronic device 1 . When the usb device 24 is removed, the USB controller 140 restarts the USB port 164. [0012] Since the short circuit detecting circuits 1 31, 1 3 2, 1 3 3, and 1 3 4 are the same as the internal circuits of the total current detecting circuit 120, in the present embodiment, only the total current detecting circuit 120 is taken as an example. Description, as shown in Figure 3. The total current detecting circuit 12 includes a current/voltage converting circuit 121 and a cold voltage comparing circuit 12 2 . The current/voltage conversion circuit 121 is configured to convert the detected current signal into a voltage signal 'which includes a capacitor C1, a plurality of resistors R1, R2, R3, R4, R5 and an operational amplifier A1. The resistor R1 and the capacitor C1 are connected in parallel between the input terminal (5V) of the total current detecting circuit 120 and the output terminal (node VD1, e). The resistor R2 is connected in series between the negative input terminal of the operational amplifier A1 and the node VMS. R3 is connected in series between the positive input terminal of the operational amplifier A1 and 5V, the resistor R4 is connected between the output terminal of the operational amplifier A1 and the negative input terminal, and the resistor R5 is connected between the positive input terminal of the operational amplifier A1 and the ground terminal. Among them, the resistors R2, R3, R4, and R5 and the operational amplifier A1 constitute a typical amplifying circuit, and the amplification factor depends on the ratio of the resistor R4 to R2. Moreover, the output of the operational amplifier A1 outputs a voltage signal representing the magnitude of the sensed current. The voltage comparison circuit 122 is configured to compare the voltage signal output by the current/voltage conversion circuit 121 with a reference voltage, and output a comparison signal to the USB controller 140, which includes two electric BR6, R7 and a comparator A2. Wherein, ratio 098125625 Form No. A0101 Page 8 / Total 23 Page 0982043829-0 [0013] 201104398 The positive input of Comparator 2 is connected to the output of operational amplifier Α1, and the negative input is grounded via resistor R6 and serves as a reference. The voltage terminal has an output connected to the USB controller 140' and rotates the comparison signal. The resistor 7 is only connected between the power supply terminal and the negative input terminal of the comparator A2. In this embodiment, the resistors R6 and R7 form a voltage dividing circuit for dividing the power supply S (3.3V) of the comparator power supply terminal. The voltage division on the resistor R6 is used as the reference voltage of the comparator A2, that is, 0. 8V. [0014] In the present embodiment, when the USB device is inserted into its corresponding USB port, an instantaneous surge current is generated due to the load capacitance effect, and if not, the live 'total current detecting circuit 12 is not suppressed. 〇 and short-circuit detection circuits Μι, Μ, 133, 134 will malfunction. Therefore, the capacitance ci 甩 is to suppress the rush current generated by the mb device when it is inserted into its corresponding 埠 (crush). Moreover, since the output voltage of the total current detecting circuit 12A is substantially equal to the voltage of its input 'that is, '5V, that is, the voltage difference between the input and output voltages of the total current detecting circuit 丨2〇 is small, so the resistor R1 selects the resistance. Value _ small resistance, for example: 0.1 Ω. The specific working principle is as follows: 〇[0015] When the USB device is inserted into its corresponding 埠, the capacitor C1 is equivalent to a short circuit, then the power supply provided by 5V is all supplied to the capacitor C1 for charging, then no current flows through the resistor R1, correspondingly 'current/voltage conversion The circuit 121 has no output, so the total current detecting circuit 120 ignores the instantaneous surge current. Similarly, the short circuit detecting circuits 131, 132, 133, 134 also do not operate. Since the charging time of the capacitor C1 can be adjusted to match the time when the surge current occurs, when the electronic device 1 is operating normally, the capacitor C1 is charged and saturated, and therefore, a current flows through the resistor R1. If the total current of the USB ports 161, 162, 163, 164 does not exceed the rated total power 098125625 Form No. A0101 Page 9 / Total 23 page 0982043829-0 [0016] 201104398 When the current flows through the resistor R1 is small, then the resistance The divided voltage on R1 is small, and the divided voltage is outputted by the operational amplifier A1 to output a voltage signal to the voltage comparison circuit 122. In the present embodiment, the amplification factor of the operational amplifier A1 is 0.4. In the voltage comparison circuit 122, the positive input terminal of the comparator A2 receives the voltage signal output by the operational amplifier A1. Since the voltage signal is smaller than the negative reference voltage signal, the comparator A2 outputs a low-level total current detection signal. For example: 0V, to the USB controller 140. At this time, the USB controller 140 controls the electronic device 1 to distribute the power to the corresponding USB port based on the received low level total current detection signal. [0017] If the total current of the USB ports 161, 162, 163, 164 exceeds the rated total current, the current flowing through the resistor R1 is large, and the divided voltage on the resistor R1 is large, and the divided voltage is calculated by the operational amplifier A1. A voltage signal is output to the voltage comparison circuit 122. In the voltage comparison circuit 122, the positive input terminal of the comparator A2 receives the voltage signal output by the operational amplifier A1. Since the voltage signal is greater than the negative reference voltage signal at this time, the comparator A2 outputs a high-level total current detection signal. For example: 3. 3V, to the USB controller 140. At this time, the USB controller 140 controls the corresponding relay circuit to cut off the corresponding USB port according to the received high level total current detection signal. [0018] In the present embodiment, the internal circuit architecture of the short circuit detecting circuits 131, 132, 133, and 134 is substantially the same as the internal circuit structure of the total current detecting circuit 120, except that in the current/voltage converting circuit, 5V is replaced by a node DU. Ο point, VDT,. The node is replaced with a node. The working principle of the two is also completely
D U O DUO 同,故在此不再描述。 [0019] 由於本發明中,中繼電路151、152、153、154内部電路 架構完全相同,故,僅以中繼電路151為例予以說明,如 098125625 表單編號A0101 第10頁/共23頁 0982043829-0 201104398 [0020] Ο [0021]D U O DUO is the same, so it will not be described here. [0019] Since the internal circuit architectures of the relay circuits 151, 152, 153, and 154 are completely the same in the present invention, only the relay circuit 151 is taken as an example, such as 098125625, Form No. A0101, Page 10 of 23 Page 0902043829-0 201104398 [0020] 002 [0021]
GG
[0022] 圖4所示。其中,中繼電路151包括二個電阻R8、R9、電 晶體Q1、晶片U1。電晶體qi為npn型電晶體,其基極通 過電阻R8與USB控制器140相連,其發射極接地。本實施 方式中,晶片III具有五個引腳,其中,引腳1連接3.3V的 電壓源,引腳2懸空,引腳3與短路檢測電路13丨相連’引 腳4與USB埠161相連,引腳5通過電阻R9與電晶體Q1的集 電極相連。 常態時(總電流檢測電路12 0以及短路檢測電路131輸出 的檢測訊號均為正常時),晶片U1的引腳3與引腳4相連 ,也就是說,常態時短、路檢測電路131與USB埠161相接 通,電子設備1會對USB埠161進行供電^ 當總電流檢測電路120以及短路檢測電路131輪出的檢測 訊號均為異常時’ USB控制器140輸出一傭除能(disable) 訊號 ’例如 ,高電平訊號 ,至電晶體 Q1 , 此時電 晶體Q1導通’將這個除能訊號放大後輸出至晶片U1的引 腳5。從而引腳1與引聊5之間的線揭(未示出)產生磁力 '>ί: ' f H ., 將晶片U1的引腳3速接至與引腳2,則中繼電路151將USB 埠161與電子設備1内部電路切斷。本實施方式中,中繼 電路151為高電平觸發,在本發明其他實施方式中,中繼 電路151也可以為低電平觸發。 圖5所示為本發明動態分配USB電源的方法流程圖。其中 ,在步驟S510中,USB控制器140接收USB設備插入USB 璋的訊號。步驟s520中,USB控制器140判斷該插入的 USB設備是否短路。如果短路的話’執行步驟S521 ’ USB 控制器140輸出除能訊號,並通知用戶移除插入的USB設 098125625 表單編號A0101 第11頁/共23 1 09820438Έ9-0 201104398 備。接著’執行步驟S550,USB控制器140重新啟動所述 USB設備插入的USB埠。如果沒有短路的話,繼續步驟 S530,USB控制器140繼續判斷流經所有USB埠的總電流 是否超過額定總電流。如果超過額定總電流的話’執行 步驟S531,USB控制器140輸出除能訊號’並按照預先設 定的規則通知用戶移除相應的USB設備,例如:移除最後 插入的USB設備或者移除非標準的USB設備。同樣地,接 著執行步驟S550。如果沒有超過額定總電流的話,繼續 步驟S540,USB控制器140控制電子設備1分配電源給插 f) 入的USB埠。 ' [0023] 本發明中,電子設備1利用總.電流檢測電路120以及複數 短路檢測電路131、132、133、134檢測USB埠的總電流 是否超過額定總電流以及檢測每個插入的USB設備是否短 路,從而控制中繼電路151、152、153、154通斷對應的 USB埠161、162、163、164,實現USB埠第源的動態分 配。 [0024] 綜上所述,本發明符合發明專剎要件,爰依法提出專利 ϋ 申請。惟,以上所述者僅為本發明之較佳實施例,舉凡 熟悉本案技藝之人士,在爰依本案發明精神所作之等效 修飾或變化,皆應包含於以下之申請專利範圍内。 【圖式簡單說明】 [0025] 圖1所示為本發明動態分配USB埠電源的電子設備的模組 圖; [0026] 圖2所示為本發明USB埠動態分配電源的示意圖; 098125625 表單編號A0101 第12頁/共23頁 0982043829-0 201104398 [0027] 圖3所示為本發明圖1中總電流檢測電路的具體電路圖; 以及[0022] FIG. The relay circuit 151 includes two resistors R8 and R9, a transistor Q1, and a wafer U1. The transistor qi is an npn-type transistor, the base of which is connected to the USB controller 140 via a resistor R8, and its emitter is grounded. In this embodiment, the chip III has five pins, wherein the pin 1 is connected to a voltage source of 3.3V, the pin 2 is suspended, and the pin 3 is connected to the short circuit detecting circuit 13A. The pin 4 is connected to the USB port 161. Pin 5 is connected to the collector of transistor Q1 via resistor R9. In the normal state (when the total current detecting circuit 120 and the detection signal output by the short-circuit detecting circuit 131 are normal), the pin 3 of the chip U1 is connected to the pin 4, that is, the normal time is short, the path detecting circuit 131 and the USB port are connected. When the 161 phase is turned on, the electronic device 1 supplies power to the USB port 161. When the detection signals of the total current detecting circuit 120 and the short circuit detecting circuit 131 are abnormal, the USB controller 140 outputs a commission disabling signal. For example, a high level signal, to the transistor Q1, at which time the transistor Q1 is turned on, the amplified signal is amplified and output to the pin 5 of the wafer U1. Thus, the line between pin 1 and chat 5 (not shown) generates a magnetic force '> ί: ' f H ., the pin 3 of the wafer U1 is connected to pin 2, and the relay circuit 151 The USB port 161 is disconnected from the internal circuit of the electronic device 1. In the present embodiment, the relay circuit 151 is a high level trigger. In another embodiment of the present invention, the relay circuit 151 may also be a low level trigger. FIG. 5 is a flow chart showing a method for dynamically allocating USB power according to the present invention. Wherein, in step S510, the USB controller 140 receives the signal that the USB device is plugged into the USB port. In step s520, the USB controller 140 determines whether the inserted USB device is short-circuited. If it is short-circuited, 'Step S521' is executed. The USB controller 140 outputs the disable signal and notifies the user to remove the inserted USB device 098125625 Form No. A0101 Page 11 / Total 23 1 09820438 Έ 9-0 201104398. Next, in step S550, the USB controller 140 restarts the USB port inserted by the USB device. If there is no short circuit, proceeding to step S530, the USB controller 140 continues to determine whether the total current flowing through all of the USB ports exceeds the rated total current. If the rated total current is exceeded, 'YES step S531, the USB controller 140 outputs the disable signal' and informs the user to remove the corresponding USB device according to a preset rule, for example, removing the last inserted USB device or removing the non-standard USB device. Similarly, step S550 is performed. If the rated total current is not exceeded, the process proceeds to step S540, and the USB controller 140 controls the electronic device 1 to distribute the power to the USB port that is inserted. [0023] In the present invention, the electronic device 1 detects whether the total current of the USB port exceeds the rated total current and detects whether each inserted USB device is detected by the total current detecting circuit 120 and the complex short detecting circuits 131, 132, 133, and 134. Short circuit, thereby controlling the relay circuits 151, 152, 153, 154 to turn on and off the corresponding USB ports 161, 162, 163, 164 to realize dynamic allocation of the USB source. [0024] In summary, the present invention complies with the requirements of the invention, and patents are filed according to law. The above description is only the preferred embodiment of the present invention, and equivalent modifications or variations made by those skilled in the art will be included in the following claims. BRIEF DESCRIPTION OF THE DRAWINGS [0025] FIG. 1 is a block diagram of an electronic device for dynamically allocating a USB power supply according to the present invention; [0026] FIG. 2 is a schematic diagram of a USB port dynamic power distribution according to the present invention; 098125625 Form number A0101 page 12 / 23 pages 0992043829-0 201104398 [0027] FIG. 3 is a specific circuit diagram of the total current detecting circuit of FIG. 1 of the present invention;
[0028] [0029] [0030] [0031] [0032] [0033] 圖4所示為本發明圖1中中繼電路的具體電路圖; 圖5所示為本發明動態分配USB埠電源的方法流程圖。 【主要元件符號說明】 電子設備 1 電源轉換電路 總電流檢測電路 短路檢測電路 110 120 131、132、133 134 [0034] 中繼電路 154 151、152、153、 ❹ [0035] USB埠 161 > ,162 > 163 ' 164 1。'. χ . ;· -/ - : .--- -...V八“、::: ; [0036] USB控制器 140 [0037] USB設備 2卜 22、23、24 [0038] 電流/電壓轉換電路 121 [0039] 電壓比較電路 122 [0040] 電容 C1 [0041] 電阻 Rl 、 R2 、 R3 、 R4 、 R5、R6、R7、R8、R9 表單編號A0101 第13頁/共23頁 098125625 0982043829-0 201104398 [0042] 邏輯元件 Al、A2 [0043] 晶片 U1 [0044] 電晶體 Q1 098125625 表單編號A0101 第14頁/共23頁[0033] FIG. 4 is a specific circuit diagram of the relay circuit of FIG. 1 according to the present invention; FIG. 5 is a diagram showing a method for dynamically allocating a USB power supply according to the present invention; flow chart. [Description of main component symbols] Electronic device 1 Power conversion circuit Total current detection circuit Short circuit detection circuit 110 120 131, 132, 133 134 [0034] Relay circuit 154 1511, 152, 153, ❹ [0035] USB 埠 161 > ,162 > 163 ' 164 1. '. χ . ;· -/ - : .--- -...V 八",::: ; [0036] USB controller 140 [0037] USB device 2 22 22, 23, 24 [0038] Current / Voltage Conversion Circuit 121 [0039] Voltage Comparison Circuit 122 [0040] Capacitor C1 [0041] Resistors Rl, R2, R3, R4, R5, R6, R7, R8, R9 Form No. A0101 Page 13 of 23 098125625 0982043829- 0 201104398 [0042] Logic Element A1, A2 [0043] Wafer U1 [0044] Transistor Q1 098125625 Form No. A0101 Page 14 of 23
0982043829-00982043829-0