TWI857498B - Usb slave device and power quality detection method thereof - Google Patents
Usb slave device and power quality detection method thereof Download PDFInfo
- Publication number
- TWI857498B TWI857498B TW112106348A TW112106348A TWI857498B TW I857498 B TWI857498 B TW I857498B TW 112106348 A TW112106348 A TW 112106348A TW 112106348 A TW112106348 A TW 112106348A TW I857498 B TWI857498 B TW I857498B
- Authority
- TW
- Taiwan
- Prior art keywords
- usb
- slave device
- quality detection
- power
- power quality
- Prior art date
Links
Images
Landscapes
- Power Sources (AREA)
Abstract
Description
本發明是有關於電源檢測領域,特別是一種USB從屬設備及其電源品質檢測方法。 The present invention relates to the field of power detection, in particular to a USB slave device and a power quality detection method thereof.
當使用低於產品規格要求或是不符合USB規範的USB供電裝置對USB從屬設備供電,將導致USB從屬設備發生無預期的斷電、重開機或是無法使用產品的特定功能狀況發生,造成使用者誤認為USB從屬設備損壞。 When a USB power supply that is lower than the product specification requirements or does not comply with the USB specification is used to power a USB slave device, it will cause the USB slave device to unexpectedly lose power, restart, or become unable to use certain functions of the product, causing the user to mistakenly believe that the USB slave device is damaged.
為增加使用者體驗以及減少不必要的返修成本,有必要在USB從屬設備中增加電源品質檢測機制。 In order to improve user experience and reduce unnecessary repair costs, it is necessary to add a power quality detection mechanism to USB slave devices.
有鑑於此,本發明的目的在於提供一種USB從屬設備及其電源品質檢測方法,可以在以USB供電的USB從屬設備中提供電源品質檢測。 In view of this, the purpose of the present invention is to provide a USB slave device and a power quality detection method thereof, which can provide power quality detection in a USB slave device powered by USB.
本發明一實施例提供一種USB從屬設備,包括控制器、電源品質檢測電路及周邊模塊,其中,該電源品質檢測電路,用於檢測USB供電設備提供的電流;該周邊模塊,用於控制各功能的致能與禁能,其中,該周邊模塊預設致能執行電源品質檢測方法所需的最少功能,並禁能剩餘的功能;以及該控制器,用於執行該電源品質檢測方法,該電源品質檢測方法包括以下步驟:建立與該USB供電設備的連接關係;致能該電源品質檢測電路;判斷是否未重新開 機達預設時間閾值;當判斷未重新開機達預設時間閾值,通知該周邊模塊致能所有的功能;以及當判斷重新開機,提示使用者更換該USB供電設備。 An embodiment of the present invention provides a USB slave device, including a controller, a power quality detection circuit and a peripheral module, wherein the power quality detection circuit is used to detect the current provided by the USB power supply device; the peripheral module is used to control the enabling and disabling of each function, wherein the peripheral module is preset to enable the minimum functions required to execute the power quality detection method and disable the remaining functions; and the controller, Used to execute the power quality detection method, the power quality detection method includes the following steps: establishing a connection relationship with the USB power supply device; enabling the power quality detection circuit; judging whether the device has not been restarted for a preset time threshold; when judging that the device has not been restarted for a preset time threshold, notifying the peripheral module to enable all functions; and when judging that the device has been restarted, prompting the user to replace the USB power supply device.
本發明一實施例還提供一種電源品質檢測方法,應用於USB從屬設備,其中,該USB從屬設備的周邊模塊預設致能執行電源品質檢測方法所需的最少功能,並禁能剩餘的功能,該方法包括以下步驟:建立與該USB供電設備的連接關係;致能USB從屬設備的電源品質檢測電路;判斷是否未重新開機達預設時間閾值;當判斷未重新開機達預設時間閾值,通知USB從屬設備的周邊模塊致能所有的功能;以及當判斷重新開機,提示使用者更換該USB供電設備。 An embodiment of the present invention also provides a power quality detection method, which is applied to a USB slave device, wherein the peripheral module of the USB slave device is preset to enable the minimum functions required to execute the power quality detection method and disable the remaining functions. The method includes the following steps: establishing a connection relationship with the USB power supply device; enabling the power quality detection circuit of the USB slave device; determining whether the device has not been restarted for a preset time threshold; when it is determined that the device has not been restarted for a preset time threshold, notifying the peripheral module of the USB slave device to enable all functions; and when it is determined that the device has been restarted, prompting the user to replace the USB power supply device.
利用上述USB從屬設備及其電源品質檢測方法,可以檢測USB供電設備的供電能力,減少USB從屬設備無預期的功能失常或是斷電重開機的風險。 By using the above-mentioned USB slave device and its power quality detection method, the power supply capability of the USB power supply device can be detected, thereby reducing the risk of unexpected malfunction or power failure and restart of the USB slave device.
100:USB從屬設備 100:USB slave device
110:控制器 110: Controller
120:電源品質檢測電路 120: Power quality detection circuit
121:開關元件 121: Switching components
122:負載 122: Load
130:周邊模塊 130: Peripheral module
200:USB供電設備 200: USB power supply equipment
S201~S205:步驟 S201~S205: Steps
圖1為根據本發明一實施例的USB從屬設備的方塊圖。 Figure 1 is a block diagram of a USB slave device according to an embodiment of the present invention.
圖2為根據本發明一實施例的USB從屬設備的電源品質檢測方法的流程圖。 Figure 2 is a flow chart of a method for detecting power quality of a USB slave device according to an embodiment of the present invention.
藉由以下對具體實施例詳細的描述結合附圖,將可輕易的瞭解上述內容及此項發明之諸多優點。 Through the following detailed description of the specific embodiments combined with the attached drawings, it will be easy to understand the above content and the many advantages of this invention.
請參閱圖1,所示為本發明一實施例的USB從屬設備100的方塊圖。USB從屬設備100是指必須由USB供電設備200供電的設備;USB供電設備200是指具有USB端口,能主動供電給USB從屬設備100的設備,如圖1所示,其中,USB供電設備200與USB從屬設備100通過USB端口連接。在一例中,USB供電設備200包括電腦、平板、智慧電視以及USB充電器等。USB從屬設備100包括控制
器110、電源品質檢測電路120以及周邊模塊130。控制器110包括微控制器(Microcontroller Unit,MCU),用於執行電源品質檢測方法及控制USB從屬設備100的運行。電源品質檢測電路120包括開關元件121及負載122,用於檢測USB供電設備200是否能提供所要求的額定電流,其中,開關元件121包括MOS管或電源開關積體電路,負載122包括複數電阻。周邊模塊130,用於控制各功能的致能與禁能,其中,各功能包括軟體模塊以及硬體元件,例如:記憶卡、藍牙、WiFi以及揚聲器等。
Please refer to FIG. 1, which is a block diagram of a
在本實施例中,當USB從屬設備100在雛形階段(Prototype)時,根據規格書及軟體功能預估整機的耗電電流值,亦即額定電流;當USB從屬設備100進入試產後,依據軟體預設致能的複數功能,測量並確認所需的最小耗電電流值。根據的電源額定電流選擇滿足規則需求的開關元件,並根據預設的電源額定電流及最小耗電電流值選擇適合的負載組成。
In this embodiment, when the
在一實施中,周邊模塊130僅預設致能執行電源品質檢測所需的最少功能,例如,用於讀寫數據的存儲器、用於與USB供電設備200進行雙向通訊的通訊介面。例如,當USB從屬設備100為智慧電視盒時,預設致能的功能包括高畫質多媒體介面、存儲器及藍牙等功能。
In one implementation, the
請參閱圖2,所示為本發明一實施例中USB從屬設備的電源品質檢測方法的流程圖。在本實施例中,該電源品質檢測方法由USB從屬設備的控制器執行。 Please refer to Figure 2, which is a flow chart of a power quality detection method of a USB slave device in an embodiment of the present invention. In this embodiment, the power quality detection method is executed by a controller of the USB slave device.
步驟S201,建立與USB供電設備的連接關係。 Step S201, establish a connection with the USB power supply device.
在一實施例中,USB從屬設備與USB供電設備建立連接關係後,獲取USB供電設備的產品識別碼PID與供應商識別碼VID,根據所述PID與所述VID判斷USB供電設備是否為指定設備。當判斷USB供電設備為指定設備時,直接執行步驟S204。在一例中,當USB從屬設備根據PID與VID,確定USB供電設備為USB從屬設備出廠所附的變壓器時,可跳過電源品質檢測的相關步驟,直 接使用。當USB從屬設備無法獲取USB供電設備的PID與VID時,則繼續執行電源品質檢測的相關步驟。 In one embodiment, after the USB slave device establishes a connection with the USB power supply device, the product identification code PID and the vendor identification code VID of the USB power supply device are obtained, and the USB power supply device is judged whether it is a designated device according to the PID and the VID. When the USB power supply device is judged to be a designated device, step S204 is directly executed. In one example, when the USB slave device determines that the USB power supply device is a transformer attached to the USB slave device when it leaves the factory according to the PID and the VID, the relevant steps of the power quality detection can be skipped and used directly. When the USB slave device cannot obtain the PID and the VID of the USB power supply device, the relevant steps of the power quality detection continue to be executed.
步驟S202,致能電源品質檢測電路。 Step S202, enable the power quality detection circuit.
具體的,發送致能訊號至電源品質檢測電路的開關元件,使電源路徑導通,並通過電源品質檢測電路的負載。 Specifically, an enable signal is sent to the switch element of the power quality detection circuit to turn on the power path and pass through the load of the power quality detection circuit.
在一實施例中,USB從屬設備上電開機後,生成電源檢測旗標以及完整功能旗標,並存儲於存儲器。其中,電源檢測旗標用於表示是否已執行電源品質檢測,0代表尚未執行電源品質檢測,1代表已執行過電源品質檢測;完整功能旗標用於表示電源品質檢測的結果,0代表未通過電源品質檢測,1代表通過電源品質檢測。在本實施例中,兩個旗標的旗標值皆預設為0。每一次USB從屬設備100重新開機後,需讀取所述兩個旗標的旗標值,確認當前電源品質檢測的狀態。
In one embodiment, after the USB slave device is powered on, a power detection flag and a full function flag are generated and stored in a memory. The power detection flag is used to indicate whether the power quality test has been performed, 0 represents that the power quality test has not been performed, and 1 represents that the power quality test has been performed; the full function flag is used to indicate the result of the power quality test, 0 represents that the power quality test has not passed, and 1 represents that the power quality test has passed. In this embodiment, the flag values of the two flags are both preset to 0. Each time the
當USB從屬設備發送致能訊號至電源品質檢測電路的開關元件前,將電源檢測旗標的旗標值設置為1並存儲,表示開始執行電源品質檢測。 Before the USB slave device sends an enable signal to the switch element of the power quality detection circuit, the flag value of the power detection flag is set to 1 and stored, indicating that the power quality detection starts.
在一實施例中,負載的組成是根據預設的電源額定電流以及舉例來說,USB從屬設備需要的電流至少為760毫安(mA),亦即,USB供電設備至少需滿足USB3.0協議要求的900mA。在試產時,推算出通過負載的電流需要600mA,因此,負載由兩顆16歐姆電阻並聯以滿足電源品質檢測的需求。當致能電源品質檢測電路的開關元件後,會產生額外的電流通過負載,此時,若USB供電設備為500mA的供電設備,則USB從屬設備會因為超過USB供電設備能提供的電流而直接重開機,反之,系統則維持穩定狀態。 In one embodiment, the composition of the load is based on the preset power rating current and, for example, the current required by the USB slave device is at least 760 milliamperes (mA), that is, the USB power supply device must at least meet the 900mA required by the USB3.0 protocol. During trial production, it was calculated that the current passing through the load is 600mA, so the load is connected in parallel by two 16-ohm resistors to meet the power quality detection requirements. When the switch element of the power quality detection circuit is enabled, additional current will be generated to pass through the load. At this time, if the USB power supply device is a 500mA power supply device, the USB slave device will directly restart because the current exceeds the current that the USB power supply device can provide. Otherwise, the system will maintain a stable state.
步驟S203,判斷是否未重新開機達預設時間閾值。 Step S203, determine whether the reboot has not reached the preset time threshold.
當判斷USB從屬設備維持穩定狀態達預設時間閾值,未重新開機,則執行步驟S204。在一例中,預設時間閾值為5秒。反之,當USB從屬設備重新開機,則代表電源品質檢測結果為未通過,此時,USB從屬設備讀取電源 檢測旗標的旗標值為1、完整功能旗標的旗標值為0,代表電源品質檢測未通過,則執行步驟S205。 When it is determined that the USB slave device maintains a stable state for a preset time threshold and does not restart, step S204 is executed. In one example, the preset time threshold is 5 seconds. On the contrary, when the USB slave device restarts, it means that the power quality test result is not passed. At this time, the flag value of the USB slave device reading the power test flag is 1 and the flag value of the full function flag is 0, which means that the power quality test has not passed, and step S205 is executed.
步驟S204,致能所有的功能。 Step S204, enable all functions.
當電源品質檢測結果為通過,表示所連接的USB供電裝置可滿足USB從屬設備的運作需求,因此,通知周邊模塊致能所有的功能,將完整功能旗標的旗標值設置為1並加以存儲。 When the power quality test result is passed, it means that the connected USB power supply device can meet the operation requirements of the USB slave device. Therefore, the peripheral module is notified to enable all functions, and the flag value of the full function flag is set to 1 and stored.
在一例中,當USB從屬設備重新開機後,讀取電源檢測旗標的旗標值為0、完整功能旗標的旗標值為1,由於不可能在未通過電源品質檢測的情況下,將完整功能旗標的旗標值設置為1,因此,將判斷為運作失常,將完整功能旗標的旗標值設置為0,並重新執行電源品質檢測。 In one example, when the USB slave device is restarted, the flag value of the power detection flag is read as 0 and the flag value of the full function flag is 1. Since it is impossible to set the flag value of the full function flag to 1 without passing the power quality test, it is judged as malfunctioning, the flag value of the full function flag is set to 0, and the power quality test is re-executed.
在一例中,當電源品質檢測結果為通過,但使用者自行將USB從屬設備重新開機,則開機後讀取到的電源檢測旗標的旗標值與完整功能旗標的旗標值皆為1。考量到使用者從關機到重新開機的過程中有可能更換USB供電裝置,因此,在本例中,即時讀取到的電源檢測旗標的旗標值與完整功能旗標的旗標值皆為1,仍需將兩個旗標的旗標值皆設置為0,並執行電源品質檢測。 In one example, when the power quality test result is passed, but the user restarts the USB slave device, the flag values of the power test flag and the flag value of the full function flag read after the power is turned on are both 1. Considering that the user may replace the USB power supply device during the process from shutting down to restarting, in this example, the flag values of the power test flag and the flag value of the full function flag read in real time are both 1, and the flag values of both flags still need to be set to 0 and the power quality test is performed.
步驟S205,提示使用者更換USB供電設備。 Step S205, prompt the user to replace the USB power supply device.
在一實施例中,當USB從屬設備的電源品質檢測未通過,USB從屬設備經由一個或多個LED指示燈提示使用者更換合適的USB供電設備或是提示使用者目前USB從屬設備的功能受限。 In one embodiment, when the power quality test of the USB slave device fails, the USB slave device prompts the user to replace a suitable USB power supply device or prompts the user that the function of the current USB slave device is limited through one or more LED indicators.
在一實施例中,當USB從屬設備的電源品質檢測未通過,USB從屬設備傳送提示訊息至USB供電設備。例如,USB從屬設備為OTT Dongle,USB供電設備為電視,USB從屬設備可傳送提示訊息至USB供電設備的顯示屏幕輸出,告知使用者偵測到不符規格的電源,提示使用者目前無法使用USB從屬設備的完整功能。 In one embodiment, when the power quality test of the USB slave device fails, the USB slave device sends a prompt message to the USB power supply device. For example, the USB slave device is an OTT Dongle, and the USB power supply device is a TV. The USB slave device can send a prompt message to the display screen output of the USB power supply device to inform the user that a power source that does not meet the specifications is detected, and the user is prompted that the full function of the USB slave device cannot be used at present.
總結來說,本發明的USB從屬設備及其電源品質檢測方法,可檢測使用者使用的USB供電裝置是否符合USB從屬設備的規格要求,釐清無預期的重新開機與功能失常的原因,增加使用者體驗以及減少不必要的產品返修。 In summary, the USB slave device and its power quality detection method of the present invention can detect whether the USB power supply device used by the user meets the specification requirements of the USB slave device, clarify the causes of unexpected restarts and malfunctions, improve user experience and reduce unnecessary product returns.
值得注意的是,以上實施例僅用以說明本發明的技術方案而非限制,儘管參照較佳實施例對本發明進行了詳細說明,本領域的普通技術人員應當理解,可以對本發明的技術方案進行修改或等同替換,而不脫離本發明技術方案的精神和範圍。 It is worth noting that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention is described in detail with reference to the preferred embodiments, ordinary technicians in this field should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
S201~S205:步驟 S201~S205: Steps
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW112106348A TWI857498B (en) | 2023-02-21 | 2023-02-21 | Usb slave device and power quality detection method thereof |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW112106348A TWI857498B (en) | 2023-02-21 | 2023-02-21 | Usb slave device and power quality detection method thereof |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW202435031A TW202435031A (en) | 2024-09-01 |
| TWI857498B true TWI857498B (en) | 2024-10-01 |
Family
ID=93609611
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW112106348A TWI857498B (en) | 2023-02-21 | 2023-02-21 | Usb slave device and power quality detection method thereof |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI857498B (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7506219B2 (en) * | 2005-05-26 | 2009-03-17 | Microsoft Corporation | Status indicators for universal serial bus (USB) ports |
| TW201222244A (en) * | 2010-11-30 | 2012-06-01 | Askey Computer Corp | Device and method for examining USB port of test apparatus |
| CN103777730B (en) * | 2012-10-19 | 2016-05-18 | 纬创资通股份有限公司 | Power management circuit and method thereof |
| TW201625966A (en) * | 2014-12-31 | 2016-07-16 | 鴻海精密工業股份有限公司 | Current detecting device |
| CN208283484U (en) * | 2018-06-14 | 2018-12-25 | 东莞理工学院 | A kind of USB Power Adapter detector |
-
2023
- 2023-02-21 TW TW112106348A patent/TWI857498B/en active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7506219B2 (en) * | 2005-05-26 | 2009-03-17 | Microsoft Corporation | Status indicators for universal serial bus (USB) ports |
| TW201222244A (en) * | 2010-11-30 | 2012-06-01 | Askey Computer Corp | Device and method for examining USB port of test apparatus |
| CN103777730B (en) * | 2012-10-19 | 2016-05-18 | 纬创资通股份有限公司 | Power management circuit and method thereof |
| TW201625966A (en) * | 2014-12-31 | 2016-07-16 | 鴻海精密工業股份有限公司 | Current detecting device |
| CN208283484U (en) * | 2018-06-14 | 2018-12-25 | 东莞理工学院 | A kind of USB Power Adapter detector |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202435031A (en) | 2024-09-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8775845B2 (en) | Information processing device, power supply control method and storage medium | |
| CN107797050A (en) | A kind of method of location-server mainboard electrifying timing sequence abnormal state | |
| CN104238480A (en) | Cabinet server BMC startup and shutdown control system and method | |
| CN119201522A (en) | A method, system, device and medium for indicating abnormal power supply timing during server startup | |
| CN113672070B (en) | A start-stop control method, device and electronic equipment for transport mode | |
| CN114117562B (en) | Management method, device, electronic equipment and computer storage medium of intelligent network card | |
| US10235185B2 (en) | Computer and controlling method thereof | |
| JP5976074B2 (en) | Computer system and operation method thereof | |
| CN110083491A (en) | A kind of BIOS initialization method, apparatus, equipment and storage medium | |
| US20140143601A1 (en) | Debug device and debug method | |
| US20120137114A1 (en) | Method and circuit for resetting register | |
| TWI857498B (en) | Usb slave device and power quality detection method thereof | |
| CN1979438A (en) | Computer main-board on-off testing system and method | |
| CN103699412B (en) | The quick start method and system of terminal | |
| KR20140146341A (en) | Watt-hour meter and operating method thereof | |
| CN105302655A (en) | System crash processing method and device | |
| CN101206599B (en) | Method for diagnosis and insulation of computer mainboard equipment | |
| CN114647293B (en) | Power-down protection method and device, power supply monitoring assembly and server | |
| JP5182463B2 (en) | Projection apparatus and control method | |
| TWI631458B (en) | Motherboard and computer system thereof | |
| KR101583557B1 (en) | Power control pci card of computer and power contol method thereof | |
| TW201617870A (en) | Booting method | |
| US10921875B2 (en) | Computer system, operational method for a microcontroller, and computer program product | |
| CN108108273B (en) | Motherboard and its computer system | |
| KR101746434B1 (en) | A method for blocking the stanby power having multiple sensing functions |