CN105824732A - USB detection method and detection system - Google Patents

USB detection method and detection system Download PDF

Info

Publication number
CN105824732A
CN105824732A CN201510598131.9A CN201510598131A CN105824732A CN 105824732 A CN105824732 A CN 105824732A CN 201510598131 A CN201510598131 A CN 201510598131A CN 105824732 A CN105824732 A CN 105824732A
Authority
CN
China
Prior art keywords
equipment
pin
usb
device type
vbus
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201510598131.9A
Other languages
Chinese (zh)
Inventor
尹全喜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201510598131.9A priority Critical patent/CN105824732A/en
Publication of CN105824732A publication Critical patent/CN105824732A/en
Pending legal-status Critical Current

Links

Landscapes

  • Tests Of Electronic Circuits (AREA)

Abstract

The embodiment of the invention provides a USB detection method and a USB detection system. The USB detection method is used for detecting the type of second equipment connected to first equipment and comprises the following steps: detecting whether a VBUS pin of the first equipment is in contact with a VBUS pin of the second equipment; if detecting that the VBUS pin of the first equipment is in contact with the VBUS pin of the second equipment, starting delay; after the delay is completed, starting pull up and pull down operations of a pin D+ and a pin D- of the second equipment; judging the type of the second equipment according to results of the pull up and pull down operations. The invention provides a brand-new USB detection scheme and a detection method, so that the USB insertion detection function of electronic equipment is perfected, and the problems of mis-judgment of the detected type, low charging current and failure in data transmission due to slow insertion and extremely large D+/D- contact delay are solved.

Description

A kind of USB detection method and detecting system
Technical field
The present invention relates to USB flash memory field, be specifically related to a kind of USB detection method and detecting system.
Background technology
USB fills agreement BC1.2 soon and supplements the content of USB live part, establishes the standard of a set of charge type detection simultaneously, and it has been used on the electronic equipment of all use USB2.0/USB3.0 at present.
Illustrating as a example by microUSB, Fig. 1 show USB end and the schematic diagram of micro-B terminated line of existing microUSB data wire.As shown in Figure 1, USB end has black line, green line, white line, four pins of red line, microUSB end has the black line (GND) of correspondence, green line (D+), white line (D-), red line (VBUS) pin, and a dead end (ID).
Fig. 2 show the schematic diagram of existing BC1.2 detection boot sequence, as shown in Figure 2, BC1.2 detection boot sequence is: first detection USBVBUS inserts, pulling operation on D+/D-being carried out after being ready to respond to, level state on detection D+/D-, judge device type (standard charging, non-standard charging, data transmission set etc.), finally configure charging current or set up data transmission.Specifically, being standard charging during D+D-short circuit, be non-standard charging during D+D-open circuit, D+D-sets up data transmission when having a constant impedance (such as 15k) over the ground.
Fig. 3 show the schematic diagram of the pin of the plug end of USB and the socket end of equipment.As it is shown on figure 3, due to the structure design of USB, Micro-B plug end VBUS and GND are longer than D-, D+, ID pin.When USB device inserts time, there will be situations below: VBUS with GND of plug end first contacts with VBUS and GND of socket end, after processor (CPU etc. of such as mobile phone) carries out detecting USBVBUS insertion, when D+/D-being carried out upper pulling operation and detects its level state, D+, D-are also not in contact with, and cause equipment to be identified as non-standard charged state.After entering non-standard charged state, it may appear that cannot be carried out data transmission, and charging current can be limited in such as about 500mA, causes charging rate slow.
Prior art after detection USBVBUS inserts, D+, D-pin be likely to not in contact with on be switched on detection, therefore equipment can be identified as non-standard charged state always, and then produce and cannot transmit the problems such as data, charging be slow.
Summary of the invention
The embodiment of the present invention provides a kind of USB detection method, and slow because inserting with solve that prior art exists, D+/D-contact time delay is too big, causes detecting type and judges to make mistakes, and charging current is little, it is impossible to the problem such as carry out data transmission.
For achieving the above object, one embodiment of the invention proposes a kind of USB detection method, is connected to the device type of the second equipment of the first equipment for detection, and described detection method includes:
Whether the VBUS pin detecting described first equipment contacts with the VBUS pin of described second equipment;
After the VBUS pin of VBUS pin with described second equipment that described first equipment detected contacts, start-up study;
After described time delay completes, start the D+ pin to described second equipment and the upper pulling operation of D-pin;And
Result according to described upper pulling operation, it is judged that the device type of described second equipment.
One embodiment of the invention proposes a kind of USB detection method, is connected to the device type of the second equipment of the first equipment for detection, and described detection method includes:
Whether the VBUS pin detecting described first equipment contacts with the VBUS pin of described second equipment;
After the VBUS pin of VBUS pin with described second equipment that described first equipment detected contacts, the D+ pin detecting described first equipment contacts with D+ pin and the D-pin of described second equipment the most respectively with D-pin;
After detecting that the D+ pin of described first equipment and D-pin contact with the D+ pin of described second equipment and D-pin respectively, start the D+ pin to described second equipment and the upper pulling operation of D-pin;And
Result according to described upper pulling operation, it is judged that the device type of described second equipment.
One embodiment of the invention proposes a kind of USB detection method, is connected to the device type of the second equipment of the first equipment for detection, and described detection method includes:
Whether the VBUS pin detecting described first equipment contacts with the VBUS pin of described second equipment;
After the VBUS pin of VBUS pin with described second equipment that described first equipment detected contacts, D+ pin and D-pin to described second equipment carry out pulling operation in n times, and record testing result;
After in described n times, pulling operation completes, it is judged that in the operation of described n times, the testing result of last M operation is the most consistent;
When last M testing result is consistent, according to described last M testing result, it is judged that the device type of described second equipment, wherein M and N is positive integer, and M≤N.
One embodiment of the invention proposes a kind of USB detecting system, is connected to the device type of the second equipment of the first equipment for detection, it is characterised in that described detecting system includes detection module, processing module, operation module and judge module, wherein:
Whether described detection module contacts with the VBUS pin of described second equipment for the VBUS pin detecting described first equipment;
Described processing module is used for after described detection module detects that the VBUS pin of described first equipment contacts with the VBUS pin of described second equipment, start-up study;
Described operation module is for completing to start the D+ pin to described second equipment and the upper pulling operation of D-pin afterwards in described time delay;
Described judge module judges the device type of described second equipment according to the result of described upper pulling operation.
One embodiment of the invention proposes a kind of USB detecting system, is connected to the device type of the second equipment of the first equipment for detection, described detecting system includes first detection module, the second detection module, operation module and judge module, wherein:
Whether described first detection module contacts with the VBUS pin of described second equipment for the VBUS pin detecting described first equipment;
Described second detection module is after described first detection module detects that the VBUS pin of described first equipment contacts with the VBUS pin of described second equipment;The D+ pin detecting described first equipment contacts with D+ pin and the D-pin of described second equipment the most respectively with D-pin;
Described operation module after judging that the D+ pin of described first equipment and D-pin contact with the D+ pin of described second equipment and D-pin respectively at described second detection module, D+ pin and the upper pulling operation of D-pin to described second equipment;
Described judge module judges the device type of described second equipment according to the result of described upper pulling operation.
One embodiment of the invention proposes a kind of USB detecting system, is connected to the device type of the second equipment of the first equipment for detection, and described detecting system includes detection module, operation module, the first judge module and the second judge module, wherein:
Whether described detection module contacts with the VBUS pin of described second equipment for the VBUS pin detecting described first equipment;
Described operation module is for after described detection module detects that the VBUS pin of described first equipment contacts with the VBUS pin of described second equipment, and D+ pin and D-pin to described second equipment carry out pulling operation in n times, and record testing result;
Described first judge module judges that last M the testing result in the testing result that in described n times, pulling operation obtains is the most consistent;
Described second judge module judges the device type of described second equipment when described first judge module is judged as consistent according to described consistent testing result;Wherein M and N is positive integer, and M≤N.
According to foregoing description, the invention provides a kind of brand-new USB detection scheme and detecting system, improve electronic equipment USB and insert detection function, avoiding because inserting slow, D+/D-contact time delay is too big, causes detecting type and judges to make mistakes, charging current is little, it is impossible to the problem such as carry out data transmission.
Accompanying drawing explanation
Fig. 1 show USB end and the schematic diagram of micro-B terminated line of existing microUSB data wire.
Fig. 2 show the schematic diagram of existing BC1.2 detection boot sequence.
Fig. 3 show the schematic diagram of the pin of the plug end of USB and the socket end of equipment.
Fig. 4 A show the enforcement sequential schematic of the first embodiment of USB detection method of the present invention.
Fig. 4 B is the schematic diagram that corresponding USB device connects.
The flow chart of the USB detection method that Fig. 4 C show in first embodiment of the invention.
The block diagram of the USB detecting system that Fig. 4 D show in first embodiment of the invention.
Fig. 5 A show the enforcement sequential schematic of the second embodiment of USB detection method of the present invention.
The flow chart of the USB detection method that Fig. 5 B show in second embodiment of the invention.
The block diagram of the USB detecting system that Fig. 5 C show in second embodiment of the invention.
Fig. 6 A show the enforcement precedence diagram of the 3rd embodiment of USB detection method of the present invention.
The schematic diagram that the USB device that Fig. 6 B show in third embodiment of the invention connects.
The flow chart of the USB detection method that Fig. 6 C show in third embodiment of the invention.
The block diagram of the USB detecting system that Fig. 6 D show in third embodiment of the invention.
Detailed description of the invention
Understandable for enabling the above-mentioned purpose of the present invention, feature and advantage to become apparent from, the present invention is further detailed explanation with detailed description of the invention below in conjunction with the accompanying drawings.
It should be noted that for USB device, each USB end has black line (GND), green line (D+), white line (D-), red line (VBUS) pin, microUSB end also has a dead end (ID)." upper pulling operation " described below refers to apply voltage and current at D+ or D-end, for being standard charging during short-circuit condition between D+ and D-, for being non-standard charging during open-circuit condition between D+ and D-, when having a constant impedance (such as 15k Ω) between D+ and D-over the ground, set up data transmission.This is to well known to a person skilled in the art, the most reinflated explanation at this.
Embodiment 1
Fig. 4 A show the enforcement sequential schematic of the first embodiment of USB detection method of the present invention, and Fig. 4 B is the schematic diagram that corresponding USB device connects.As shown in Figure 4 A and 4 B shown in FIG., first embodiment of the invention increases delay circuit in socket end, then by software delay read operation, with pulling operation on just D+/D-being carried out after plug end is fully-inserted.
As shown in Figure 4 B, the VBUS of the first equipment 10 is charged, usually 5V;The VBUS of the second equipment 20 is uncharged, for 0V.First equipment 10 for example, computer end, or claim plug end, the second equipment 20 for example, mobile phone terminal, or claim socket end.Delay circuit 30 is arranged on the VBUS end of the first equipment 10.After the first equipment 10 and the second equipment 20 connect, the VBUS of the second equipment 20 also has the voltage of such as 5V, this voltage open detection trigger.The operation of software read latch can be detection protocol, when the VBUS the second equipment 20 being detected has 5V voltage, automatically through certain time, then detects D+/D-.
The USB detection method that the present embodiment proposes can realize by being solidificated in the firmware within the second equipment 20.Specifically, the flow chart of the USB detection method that Fig. 4 C show in first embodiment of the invention, this testing process realizes by firing the firmware in the second equipment 20.
The present invention also proposes a kind of USB detecting system corresponding to embodiment 1, can be realized by firmware.Fig. 4 D show the block diagram of the USB detecting system of this embodiment.As shown in Figure 4 D, this USB detecting system includes detection module 40, processing module 50, judge module 60 and an operation module 70 and above-mentioned delay circuit 3.
The testing process that the present embodiment proposes is as follows:
Step 101, whether the VBUS pin detecting the first equipment 10 contacts with the VBUS pin of the second equipment 20;In a step 101, whether detection module 40 contacts with the VBUS pin of the second equipment for the VBUS pin of detection the first equipment 10;Such as, detection module 40 can gather the voltage of the VBUS of the second equipment 20, and when VBUS and the VBUS contact of the second equipment 20 of the first equipment 10, detection module 40 can send the voltage signal of the high level collected to processing module 50 according to BC1.2 agreement.
Step 102, when the VBUS pin of VBUS pin and the second equipment 20 that the first equipment 10 detected contacts, start-up study;In one embodiment, this time delay can be realized by the delay circuit 30 in the second equipment 20;In a step 102, after processing module 50 receives the voltage signal that detection module 40 sends, start-up study;Such as, processing module 50 receives the voltage signal that detection module 40 sends, and sends the first signal to the delay circuit 30 of this firmware according to this voltage signal, starts this delay circuit 30.Delay circuit 30 can also be hardware delay circuit.
Step 103, after this time delay completes, starts the upper pulling operation of the D+/D-pin to the second equipment.In step 103, operation module 70 is for completing to start the D+ pin to the second equipment 20 and the upper pulling operation of D-pin afterwards in time delay;Such as, after this delay circuit 30 completes time delay, transmission secondary signal to processing module 50, the length for example, 5s of delay circuit 30 time delay, after 5s, delay circuit 30 sends secondary signal S2 to processing module 50, the startup upper pulling operation to D+/D-.
Step 104, according to the result of described upper pulling operation, it is judged that the device type of described second equipment.At step 104, it is judged that module 60 judges the device type of the second corresponding equipment 20 for the result according to the upper pulling operation to D+/D-.
Specifically, step 104 can include following sub-step:
Step 104a, D+ pin and the level state of D-pin after pulling operation in detection, it is thus achieved that testing result;This testing result is for example: opens a way between short circuit, D+/D-between D+/D-, have a constant impedance (such as 15k Ω) thrin over the ground between D+/D-.
Step 104b, obtains the device type of the second equipment corresponding to testing result according to this testing result, and this device type can be such as: standard charging type, non-standard charge type, set up data transmission thrin.
In one embodiment, it is judged that module 60 farther includes:
3rd detection module, for detecting the level state of D+/D-pin after pulling operation, it is thus achieved that testing result;
Result acquisition module, for according to testing result, it is thus achieved that corresponding to the device type of the second equipment of described testing result.
Preferably, step 104 can also include:
Step 104c, is that this second equipment 20 configures resource according to the type of the second equipment.USB detecting system in the present embodiment can also include resource configuration module, and being used for according to device type is the second equipment configuration resource.
When described testing result is short circuit between described D+ pin and described D-pin, and the device type of described second equipment is standard charging type;The step then configuring resource includes the second equipment 20 is carried out standard charging;
When described testing result is to open a way between described D+ pin and described D-pin, and the device type of described second equipment is non-standard charge type;The step then configuring resource includes the second equipment 20 is carried out non-standard charging;
When described testing result is that to have impedance, the device type of described second equipment between described D+ pin and described D-pin over the ground be data transmission;The step then configuring resource includes carrying out data transmission between the second equipment 20.
It is noted that the implementation of delay circuit 30 has multiple, for example, RC circuit, switch timer etc., delay circuit 30 can be that those of ordinary skill in the art realize easily, and the present invention is not limited thereto.
The USB detection method proposed by the present embodiment and detecting system, within a certain period of time, by delay circuit, software delay read operation etc., it is possible to solve to insert the problem causing detection type to judge to make mistakes slowly.
Embodiment 2
Fig. 5 A show the enforcement sequential schematic of the second embodiment of USB detection method of the present invention, as shown in Figure 5A, by repeatedly D+/D-being carried out level state on upper pulling operation and detection D+/D-in the present embodiment, the number of times of detection can be set, doing effectively judgement with last detection several times.For example, can detect once every 1s, within 30s, complete detection.Similar with a upper embodiment, the repeated detection of D+/D-can also be realized by the present embodiment by being solidificated in the firmware within the second equipment 20.Specifically, the flow chart of the USB detection method that Fig. 5 B show in second embodiment of the invention.
The present invention also proposes a kind of USB detecting system corresponding to embodiment 2, can be realized by firmware.Fig. 5 C show the block diagram of the USB detecting system of this embodiment.As shown in Figure 5 C, this USB detecting system includes detection module 40, operation module 70, a first judge module 60a and the second judge module 60b.
The testing process that the embodiment of the present invention provides is as follows:
Step 201, whether the VBUS pin detecting the first equipment 10 contacts with the VBUS pin of the second equipment 20;In step 201, whether detection module 40 contacts with the VBUS pin of the second equipment 20 for the VBUS pin of detection the first equipment 10;Such as, detection module 40 can gather the voltage of the VBUS of the second equipment 20, VBUS and the VBUS contact of the second equipment 20, the operation module 70 in the voltage signal of the high level that detection module 40 meeting is collected according to the transmission of BC1.2 agreement to firmware when the first equipment 10.
Step 202, after the VBUS contact of VBUS and the second equipment 20 that the first equipment 10 detected, carries out pulling operation in n times to D+/D-, and records testing result;This testing result is for example: opens a way between short circuit, D+/D-between D+/D-, have a constant impedance (such as 15k Ω) thrin over the ground between D+/D-.In step 202., operation module 70 is after judging contact, and D+ pin and D-pin to the second equipment 20 carry out pulling operation in n times, and record testing result;Such as, operation module 70 receives the voltage signal that detection module 40 sends, and according to this voltage signal, D+/D-is carried out pulling operation in n times, and described operation module 70 records the testing result that pulling operation in n times is each;This testing result is for example: opens a way between short circuit, D+/D-between D+/D-, have a constant impedance (such as 15k Ω) thrin over the ground between D+/D-.
Step 203, after in the n times detecting D+/D-, pulling operation completes, it is judged that in n times, in pulling operation, last M testing result is the most consistent;In step 203, after in n times, pulling operation completes, the first judge module 60a judges that last M the testing result in the testing result that in n times, pulling operation obtains is the most consistent.
Step 204, when last M testing result is consistent, judges the type of this second equipment 20 by this last M testing result.Wherein M and N is positive integer, and M≤N.This testing result may is that there is a constant impedance (such as 15k Ω) thrin over the ground between open circuit, D+/D-between short circuit, D+/D-between D+/D-.The device type of this second equipment can be: standard charging type, non-standard charge type, sets up data transmission thrin.In step 204, the second judge module 60b judges the device type of described second equipment 20 when the first judge module 60a is judged as consistent according to described consistent testing result.Identical with a upper embodiment, do not repeat them here.
Preferably, in the embodiment of USB detection method of the present invention, it is judged that after the step of the device type of described second equipment, described USB detection method also includes:
It is described second equipment configuration resource according to described device type.
Accordingly, the embodiment of described USB detecting system also includes:
Resource configuration module, is described second equipment configuration resource according to described device type.
In the present embodiment, M and N is positive integer, simultaneously M≤N, and when N is such as 30 times, M can be 5 times.The detection device provided by the present embodiment and system, in the case of D+/D-is before last detection several times in contact, processor will not be judged by accident, causes slowly detecting the problem that type judges to make mistakes therefore, it is possible to solve to insert.
Embodiment 3
Fig. 6 A show the enforcement precedence diagram of the 3rd embodiment of USB detection method of the present invention.Fig. 6 B show the schematic diagram that the USB device of correspondence connects.As shown in Figure 6 A and 6 B, the D+/D-of USB the second equipment 20 (socket end) increases contact testing circuit, after contact testing circuit detects that the D+/D-of the first equipment 10 and D+/D-of the second equipment 20 touches, produce and interrupt to processor, processor controlling startup and D+/D-carrying out upper pulling operation and follow-up flow process.
Similar with a upper embodiment, the repeated detection of D+/D-can also be realized by the present embodiment by being solidificated in the firmware within the second equipment 20.Specifically, the flow chart of the USB detection method that Fig. 6 C show in third embodiment of the invention.
The present invention also proposes a kind of USB detecting system corresponding to embodiment 3, can be realized by firmware.Fig. 6 D show the block diagram of the USB detecting system of this embodiment.As shown in Figure 6 D, this USB detecting system includes a first detection module 40a, one second detection module 40b, operation module 70 and a judge module 60.In an embodiment of this USB detecting system:
The testing process that the embodiment of the present invention provides is as follows:
Step 301, whether the VBUS detecting the first equipment 10 contacts with the VBUS of the second equipment 20;In step 301, whether first detection module 40a contacts with the VBUS pin of the second equipment 20 for the VBUS pin of detection the first equipment 10;Such as, first detection module 40a in firmware can gather the voltage of the VBUS of the second equipment 20, when the VBUS contact of the VBUS of the first equipment 10 and the second equipment 20, first detection module 40a can send the voltage signal of the high level collected to the second detection module 40b in firmware according to BC1.2 agreement;
Step 302, when the VBUS of VBUS and the second equipment 20 that the first equipment 10 detected contacts, whether D+ with D-detecting the first equipment 10 contacts with D+ and D-of the second equipment 20;In step 302, the second detection module 40b is after receiving voltage signal;The D+ pin detecting the first equipment 20 contacts with D+ pin and the D-pin of the second equipment 20 the most respectively with D-pin;Such as, secondary signal, after contact being detected, is sent to operation module 70 by the second detection module 40b.
Step 303, when D+ and D-of D+ with D-and the second equipment 20 that the first equipment 10 detected contacts, starts the upper pulling operation to D+/D-;In step 303, operation module 70 after judging that at the second detection module the D+ pin of the first equipment and D-pin contact with the D+ pin of the second equipment and D-pin respectively, D+ pin and the upper pulling operation of D-pin to the second equipment;
Step 304, according to the result of described upper pulling operation, it is judged that the device type of described second equipment.In step 304, it is judged that module 60 judges the device type of the second corresponding equipment 20 for the result according to the upper pulling operation to D+/D-.
The D+ pin and the D-pin that detect described first equipment contact with the D+ pin of described second equipment and D-pin the most respectively and can realize by arranging testing circuit between the D+ pin and D-pin and the D+ pin of described second equipment and D-pin of described first equipment.
Specifically, step 304 can include following sub-step:
Step 304a, the level state of D+/D-pin after pulling operation in detection, it is thus achieved that testing result;This testing result is for example: opens a way between short circuit, D+/D-between D+/D-, have a constant impedance (such as 15k Ω) thrin over the ground between D+/D-.
Step 304b, obtains the device type of the second equipment corresponding to this testing result according to this testing result, and this device type can be such as: standard charging type, non-standard charge type, set up data transmission thrin.
Preferably, step 304 can also include:
Step 304c, is that described second equipment 20 configures resource according to described device type.
Accordingly, in an embodiment of USB detecting system, this detecting system also includes:
3rd detection module, described D+ pin and the level state of described D-pin after detecting described upper pulling operation, it is thus achieved that testing result;
Result acquisition module, according to described testing result, it is thus achieved that corresponding to the device type of the second equipment of described testing result;And
Resource configuration module, is described second equipment configuration resource according to described device type.
The USB detection method proposed by the present embodiment and detecting system, once in the D+/D-of the second equipment 20 and the D+/D-connection of the first equipment 10, just D+/D-is carried out upper pulling operation, the mistake that primitive root judges according to BC1.2 agreement can be revised, solve to insert the problem causing detection type to judge to make mistakes slowly.
According to foregoing description, the invention provides a kind of brand-new USB detection scheme and detecting system, improve electronic equipment USB and insert detection function, avoiding because inserting slow, D+/D-contact time delay is too big, causes detecting type and judges to make mistakes, charging current is little, it is impossible to the problem such as carry out data transmission.
Above a kind of USB detection method provided by the present invention and detecting system are described in detail, principle and the embodiment of the present invention are set forth by specific case used herein, and the explanation of embodiments above is only intended to help to understand method and the core concept thereof of the present invention;Simultaneously for one of ordinary skill in the art, according to the thought of the present invention, the most all will change, and each embodiment can be combined with each other to obtain more perfect technical scheme, within belonging to the scope of the present invention.In sum, this specification content should not be construed as limitation of the present invention.

Claims (16)

1. a USB detection method, is connected to the device type of the second equipment of the first equipment, it is characterised in that described detection method includes for detection:
Whether the VBUS pin detecting described first equipment contacts with the VBUS pin of described second equipment;
After the VBUS pin of VBUS pin with described second equipment that described first equipment detected contacts, start-up study;
After described time delay completes, start the D+ pin to described second equipment and the upper pulling operation of D-pin;And
Result according to described upper pulling operation, it is judged that the device type of described second equipment.
2. USB detection method as claimed in claim 1, it is characterised in that described start-up study is to start to be arranged at the delay circuit in described second equipment.
3. a USB detection method, is connected to the device type of the second equipment of the first equipment, it is characterised in that described detection method includes for detection:
Whether the VBUS pin detecting described first equipment contacts with the VBUS pin of described second equipment;
After the VBUS pin of VBUS pin with described second equipment that described first equipment detected contacts, the D+ pin detecting described first equipment contacts with D+ pin and the D-pin of described second equipment the most respectively with D-pin;
After detecting that the D+ pin of described first equipment and D-pin contact with the D+ pin of described second equipment and D-pin respectively, start the D+ pin to described second equipment and the upper pulling operation of D-pin;And
Result according to described upper pulling operation, it is judged that the device type of described second equipment.
4. USB detection method as claimed in claim 3, it is characterized in that, it is by arranging testing circuit realization between the D+ pin of described first equipment and D-pin and the D+ pin of described second equipment and D-pin that the D+ pin of described first equipment of described detection and D-pin contact with the D+ pin of described second equipment and D-pin the most respectively.
5. the USB detection method as described in claim 1 or 3, it is characterised in that the described result according to described upper pulling operation, it is judged that the step of the device type of described second equipment includes following sub-step:
Described D+ pin and the level state of D-pin after detecting described upper pulling operation, it is thus achieved that testing result;
According to described testing result, it is thus achieved that corresponding to the device type of described second equipment of described testing result.
6. USB detection method as claimed in claim 5, it is characterised in that
When described testing result is short circuit between described D+ pin and described D-pin, and the device type of described second equipment is standard charging type;
When described testing result is to open a way between described D+ pin and described D-pin, and the device type of described second equipment is non-standard charge type;
When described testing result is that to have impedance, the device type of described second equipment between described D+ pin and described D-pin over the ground be data transmission;
After judging the step of device type of described second equipment, described USB detection method also includes:
It is described second equipment configuration resource according to described device type.
7. a USB detection method, is connected to the device type of the second equipment of the first equipment, it is characterised in that described detection method includes for detection:
Whether the VBUS pin detecting described first equipment contacts with the VBUS pin of described second equipment;
After the VBUS pin of VBUS pin with described second equipment that described first equipment detected contacts, D+ pin and D-pin to described second equipment carry out pulling operation in n times, and record testing result;
After in described n times, pulling operation completes, it is judged that in the operation of described n times, the testing result of last M operation is the most consistent;
When last M testing result is consistent, according to described last M testing result, it is judged that the device type of described second equipment, wherein M and N is positive integer, and M≤N.
8. USB detection method as claimed in claim 7, it is characterised in that after judging the step of device type of described second equipment, described USB detection method also includes:
It is described second equipment configuration resource according to described device type.
9. a USB detecting system, is connected to the device type of the second equipment of the first equipment, it is characterised in that described detecting system includes detection module, processing module, operation module and judge module, wherein for detection:
Whether described detection module contacts with the VBUS pin of described second equipment for the VBUS pin detecting described first equipment;
Described processing module is used for after described detection module detects that the VBUS pin of described first equipment contacts with the VBUS pin of described second equipment, start-up study;
Described operation module is for completing to start the D+ pin to described second equipment and the upper pulling operation of D-pin afterwards in described time delay;
Described judge module judges the device type of described second equipment according to the result of described upper pulling operation.
10. USB detecting system as claimed in claim 9, it is characterised in that after described detection module detects that the VBUS pin of described first equipment contacts with the VBUS pin of described second equipment, described processing module is used for start-up study circuit.
11. 1 kinds of USB detecting systems, are connected to the device type of the second equipment of the first equipment, it is characterised in that described detecting system includes first detection module, the second detection module, operation module and judge module, wherein for detection:
Whether described first detection module contacts with the VBUS pin of described second equipment for the VBUS pin detecting described first equipment;
Described second detection module is after described first detection module detects that the VBUS pin of described first equipment contacts with the VBUS pin of described second equipment;The D+ pin detecting described first equipment contacts with D+ pin and the D-pin of described second equipment the most respectively with D-pin;
Described operation module after detecting that the D+ pin of described first equipment and D-pin contact with the D+ pin of described second equipment and D-pin respectively at described second detection module, D+ pin and the upper pulling operation of D-pin to described second equipment;
Described judge module judges the device type of described second equipment according to the result of described upper pulling operation.
12. USB detecting systems as claimed in claim 11, it is characterized in that, it is by the most respectively and arranging testing circuit realization between the D+ pin of described second equipment and D-pin at the D+ pin of described first equipment and D-pin that the D+ pin of described first equipment of described detection and D-pin contact with the D+ pin of described second equipment and D-pin the most respectively.
The 13. USB detecting systems as described in claim 9 or 11, it is characterised in that described judge module includes:
3rd detection module, described D+ pin and the level state of D-pin after detecting described upper pulling operation, it is thus achieved that testing result;And
Result acquisition module, according to described testing result, it is thus achieved that corresponding to the device type of described second equipment of described testing result.
14. USB detecting systems as claimed in claim 13, it is characterised in that
When described testing result is short circuit between described D+ pin and described D-pin, and the device type of described second equipment is standard charging type;
When described testing result is to open a way between described D+ pin and described D-pin, and the device type of described second equipment is non-standard charge type;
When described testing result is that to have impedance, the device type of described second equipment between described D+ pin and described D-pin over the ground be data transmission;
Described USB detecting system also includes:
Resource configuration module, is described second equipment configuration resource according to described device type.
15. 1 kinds of USB detecting systems, are connected to the device type of the second equipment of the first equipment, it is characterised in that described detecting system includes detection module, operation module, the first judge module and the second judge module, wherein for detection:
Whether described detection module contacts with the VBUS pin of described second equipment for the VBUS pin detecting described first equipment;
Described operation module is for after described detection module detects that the VBUS pin of described first equipment contacts with the VBUS pin of described second equipment, and D+ pin and D-pin to described second equipment carry out pulling operation in n times, and record testing result;
Described first judge module judges that last M the testing result in the testing result that in described n times, pulling operation obtains is the most consistent;
Described second judge module judges the device type of described second equipment when described first judge module is judged as consistent according to described consistent testing result;Wherein M and N is positive integer, and M≤N.
16. USB detecting systems as claimed in claim 15, it is characterised in that described USB detecting system also includes:
Resource configuration module, is described second equipment configuration resource according to described device type.
CN201510598131.9A 2015-09-18 2015-09-18 USB detection method and detection system Pending CN105824732A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510598131.9A CN105824732A (en) 2015-09-18 2015-09-18 USB detection method and detection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510598131.9A CN105824732A (en) 2015-09-18 2015-09-18 USB detection method and detection system

Publications (1)

Publication Number Publication Date
CN105824732A true CN105824732A (en) 2016-08-03

Family

ID=56514544

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510598131.9A Pending CN105824732A (en) 2015-09-18 2015-09-18 USB detection method and detection system

Country Status (1)

Country Link
CN (1) CN105824732A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107666307A (en) * 2017-08-31 2018-02-06 普联技术有限公司 A kind of USB insertion detection circuits and USB insert detection device
CN108628789A (en) * 2017-12-11 2018-10-09 百富计算机技术(深圳)有限公司 The method, apparatus and USB device that detection USB device is connect with host
CN109086234A (en) * 2018-07-26 2018-12-25 上海闻泰电子科技有限公司 Device identification method, device, identification equipment and storage medium
CN109614033A (en) * 2019-01-22 2019-04-12 芯海科技(深圳)股份有限公司 It is a kind of while detecting the circuit of analog signal and digital signal, device and method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102119A (en) * 2007-07-17 2008-01-09 青岛海信移动通信技术股份有限公司 A charging detection circuit of appliance device and charging detection method
CN101174713A (en) * 2006-11-01 2008-05-07 中兴通讯股份有限公司 Method and device for charged side detecting charging mode of exterior charging source
CN101436425A (en) * 2008-12-18 2009-05-20 深圳华为通信技术有限公司 Circuit for controlling power supply of functional module and wireless data terminal equipment
CN202649997U (en) * 2012-03-01 2013-01-02 深圳市蓝海华腾技术有限公司 Detection and recovery device for USB communication port, and communication equipment
CN103064489A (en) * 2011-10-21 2013-04-24 华为终端有限公司 Method for selecting internal circuit according to conditions of universal serial bus (USB) interface and terminal
CN103106167A (en) * 2013-01-22 2013-05-15 矽力杰半导体技术(杭州)有限公司 Universal Serial Bus (USB) equipment and control method thereof
US20130326094A1 (en) * 2010-11-24 2013-12-05 Shanghai Actions Semiconductor Co., Ltd. Usb device and detection method thereof
CN203965559U (en) * 2014-07-01 2014-11-26 南靖万利达科技有限公司 A kind of device for preventing that the USB interface connection status of electronic equipment from judging by accident

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101174713A (en) * 2006-11-01 2008-05-07 中兴通讯股份有限公司 Method and device for charged side detecting charging mode of exterior charging source
CN101102119A (en) * 2007-07-17 2008-01-09 青岛海信移动通信技术股份有限公司 A charging detection circuit of appliance device and charging detection method
CN101436425A (en) * 2008-12-18 2009-05-20 深圳华为通信技术有限公司 Circuit for controlling power supply of functional module and wireless data terminal equipment
US20130326094A1 (en) * 2010-11-24 2013-12-05 Shanghai Actions Semiconductor Co., Ltd. Usb device and detection method thereof
CN103064489A (en) * 2011-10-21 2013-04-24 华为终端有限公司 Method for selecting internal circuit according to conditions of universal serial bus (USB) interface and terminal
CN202649997U (en) * 2012-03-01 2013-01-02 深圳市蓝海华腾技术有限公司 Detection and recovery device for USB communication port, and communication equipment
CN103106167A (en) * 2013-01-22 2013-05-15 矽力杰半导体技术(杭州)有限公司 Universal Serial Bus (USB) equipment and control method thereof
CN203965559U (en) * 2014-07-01 2014-11-26 南靖万利达科技有限公司 A kind of device for preventing that the USB interface connection status of electronic equipment from judging by accident

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107666307A (en) * 2017-08-31 2018-02-06 普联技术有限公司 A kind of USB insertion detection circuits and USB insert detection device
CN107666307B (en) * 2017-08-31 2021-02-09 普联技术有限公司 USB inserts detection circuitry and USB inserts check out test set
CN108628789A (en) * 2017-12-11 2018-10-09 百富计算机技术(深圳)有限公司 The method, apparatus and USB device that detection USB device is connect with host
CN109086234A (en) * 2018-07-26 2018-12-25 上海闻泰电子科技有限公司 Device identification method, device, identification equipment and storage medium
CN109614033A (en) * 2019-01-22 2019-04-12 芯海科技(深圳)股份有限公司 It is a kind of while detecting the circuit of analog signal and digital signal, device and method

Similar Documents

Publication Publication Date Title
CN102393837B (en) USB charger recognition device and method
CN101383627B (en) Device and method for terminal charger charging, USB charging and data communication
CN100495377C (en) Method for inspecting type of connected peripheral apparatus and terminal interface
CN203387203U (en) Charging switching system possessing USB on-the-go (OTG) function
TWI573368B (en) Portable electronic device and charging method therefor
EP2584471A1 (en) Method and terminal for selecting internal circuit according to USB interface status
CN102223439B (en) Electronic equipment with USB interface and USB communication starting method thereof
US9444278B2 (en) USB charging with data communication
CN103024195B (en) Smart mobile terminal and implementation method of charging of smart mobile terminal
US20130002192A1 (en) Method and system for sampling multiple profiles in a charging port without host intervention
EP2991156A1 (en) Method and device for performing large-current charging on intelligent terminal
CN104272216A (en) Electronic device and control method therefor
US9018896B2 (en) Method and system for determining whether a portable device is charging
CN102981916B (en) A kind of mobile terminal and control method thereof and device
CN105824732A (en) USB detection method and detection system
CN105071484B (en) A kind of charging method and device of the terminal with data exchanging function
CN106597143B (en) Test equipment and test method
CN106374581A (en) Voltage output method for charger and charger
CN107783630A (en) Electronic installation and its control method and computer-readable recording medium
CN104919388A (en) Charging an electrical device via a data interface
CN105048018A (en) Charging method and device for terminal having on-the-go (OTG) function
CN104426194A (en) Charging method and charging equipment
CN108924325B (en) Data processing method and related device
CN110557748A (en) detection circuit based on control chip, mobile terminal and data line
CN102087639B (en) Method for starting USB (Universal Serial Bus) state machine as well as terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160803

RJ01 Rejection of invention patent application after publication