A kind of USB interface pick-up unit and method thereof
Technical field
The present invention relates to hardware detection, be specifically related to a kind of USB interface pick-up unit and method thereof.
Background technology
At present, the USB connected mode is selected by nearly all digital product, so the simple effect that detects fast and accurately is that all manufacturers are pursued, and the mode that present industry is taked is commonly: 1. directly use computer to connect test, machine of the relatively very low detection of this method cost-effective rate approximately needs about 45 seconds, and simply uses every testing tool of computer roughly to need about 3000 yuan to operating personnel's requirement meeting.2. use classic method to detect electric current, voltage inspection, survey pulse, test open circuit and short circuit or the like, and this method of testing does not relatively guarantee quality, about about 35 seconds of running time and operator's requirement risen to need to be familiar with current voltmeter or the like instrument.
Summary of the invention
The technical issues that need to address of the present invention are, how a kind of USB interface pick-up unit and method thereof are provided, and can reduce the pick-up unit cost, improve detection efficiency and accuracy.
Above-mentioned first technical matters of the present invention solves like this, and a kind of USB interface detection method is provided, and uses the pick-up unit of the USB interface of the two role device DRD of band, may further comprise the steps:
1.1) circuit connects detected USB interface and described pick-up unit, and set up communication each other by USB OTG agreement and connect;
1.2) utilize described communication connection to carry out read-write operation, judge according to its success or not whether this detected USB interface is normal.
According to detection method provided by the invention, described read-write comprises one or more in device descriptor, configuration descriptor and the endpoint descriptor that reads detected USB interface.
According to detection method provided by the invention, described judgement comprises that successfully to drive successful pilot lamp according to read-write operation bright; Failure drives the bright or failure buzzer warning of failure pilot lamp according to read-write operation.
According to detection method provided by the invention, described couple of role device DRD is made as server HOST.
According to detection method provided by the invention, the USB interface of described couple of role device DRD is connected to detected USB interface by cable line; Described cable directly or connect the USB interface of described couple of role device DRD by connector.
Another technical matters of the present invention solves like this, and a kind of USB interface pick-up unit comprises the detection indicating device of USB interface, connected single-chip microcomputer and the control thereof of two role device DRD.
According to pick-up unit provided by the invention, described detection indicating device comprises pilot lamp or voice output.
According to pick-up unit provided by the invention, described pilot lamp is a plurality of different color pilot lamp.
USB interface pick-up unit provided by the invention and method thereof, use simple pick-up unit to substitute PC, the communication of adopting USB OTG agreement to set up between detected USB interface and the pick-up unit connects, utilize its interior single-chip microcomputer to carry out read-write operation again, judge according to its success or not whether this detected USB interface is normal, greatly reduce to detect and use equipment cost, improved detection efficiency and success ratio.
Description of drawings
Further the present invention is described in detail below in conjunction with the drawings and specific embodiments.
Fig. 1 is the circuit block diagram of USB interface pick-up unit provided by the invention.
Embodiment
Apparatus of the present invention adopt embedded OS, directly visit the product that connects by the agreement control of USB own, reach welding and the linkage function of the USB that quick and precisely detects this product, concrete principle: single chip computer AT 89C52 control USB interface chip CH375A reads the device descriptor of product to be measured, the configuration descriptor, parameters such as endpoint descriptor are also deposited them among its internal storage SRAM62256, and after reading these parameters, the bright expression usb function of LED lamp is normal.
This device has following several big characteristics:
1. simple to operate, fool proof:
The operator only needs with a USB connecting line in operation simply with product and this product Couple together, as long as 1-2 system's second just can detect the function of detected product automatically, realize behaviour Make fool proof, the people is reduced to " 0 " for the probability of makeing mistakes, operating personnel's requirement is reduced to and can be familiar with Simple several Chinese character is just passable.
2. practicality is very strong, and cost is low, the efficient height: this device adopt USB OTG agreement directly and The direct-detection of product and detected product can 100% be guaranteed in the product communication, our products-hardware Cost is low, and volume also is 1/30 of common computer, and it is complete that the operating time also can remain on 8 seconds left and right sides Become, can greatly must raise the efficiency.