1. Field of the Invention
The present invention relates generally to an apparatus and method for the testing of a USB device, and in particular, to a USB device whose USB communication ports can also be used for testing of the USB device.
2. Background Art
USB is commonly used to interface data communications or connections between a host or hub (such as a personal computer (PC)) and peripheral devices (such as printers and scanners, among others). FIG. 1 is a simple schematic diagram illustrating a conventional USB device 10, such as a scanner, and how the USB device 10 is tested by the manufacturer of the USB device 10 prior to delivery of the USB device 10 to a customer.
The USB device 10 has an integrated circuit (IC) 12. Any conventional IC can be utilized, but in many cases, the IC can be a conventional ASIC as is well-known in the art. The IC 12 is coupled to a motor 14 to control the operation of the motor 14. In addition, the IC 12 is coupled to a sensor 16, which can be CCD sensor. The sensor 16 is utilized by the scanner 10 to scan documents, as is well-known in the art, and the signals representing the scanned information are provided to the IC 12 for processing.
Although the USB device 10 is being described herein as being a scanner, the principles of the present invention are equally applicable to any device or peripheral which has the capability for USB communication with a host device. Such devices and peripherals include keyboards, computer mice, printers, monitors, etc. In most cases, the host device would be a PC, which operates in conjunction with an operating system such as xe2x80x9cWindowsxe2x80x9d(trademark) to issue a series of commands to the USB device 10 to control the operation of the USB device 10. As a result, each USB device 10 requires one corresponding PC to enable the USB device 10 to be operated.
The testing of a USB device 10 usually includes a conventional burn-in test as is well-known in the art. FIG. 1 illustrates a testing unit 20 that has a processor 22 that is coupled via conventional USB lines (D+, Dxe2x88x92) to the IC 12 to perform the testing. The processor 22 is typically a PC operating in a xe2x80x9cWindowsxe2x80x9d(trademark) operating system (such as Windows 98). However, since each USB device 10 needs to be separately controlled by a dedicated PC, the manufacturer of the USB device 10 will need to have on hand a large number of PCs to perform testing. For example, a scanner manufacturer may need to utilize up to a few hundred PCs. Since each burn-in test can take up to three hours to complete for each USB device 10, the testing becomes cumbersome, time-consuming, and therefore quite expensive. As a result, many USB devices 10 are not tested prior to release.
To overcome this problem, some manufacturers have attempted to use smaller and less complex processors instead of an entire PC system to perform the testing. These smaller processors are less expensive than a conventional PC system because they omit many of the components (e.g., certain boards, cards, etc.) of a PC, and do not need to be supported by a xe2x80x9cWindowsxe2x80x9d(trademark) operating system. As a result, the manufacturer may be able to afford to hook up a few hundred smaller processors at any given time to perform the needed testing for the USB devices 10. One example of such a smaller processor is an MCU 8051, manufactured and sold by Intel Corporation, which is well-known in the art. To use the 8051, the USB device 10 would have two dedicated testing ports (such as an 12C protocol bus) that are only used for testing purposes. These testing ports are usually pins and connectors that are typically provided on the IC 12, and the processor would issue commands to the IC 12 via these testing ports to perform the testing procedures. Unfortunately, these dedicated testing ports cannot be used during the normal use and operation of the USB device 10. These open ports are often aesthetically unpleasant, and are often not tolerated by consumers. In addition, these open testing ports use up precious space on an IC 12, and increase the complexity of the design of the IC 12.
Thus, there still remains a need for an apparatus and method for testing USB devices that avoid the above-mentioned problems.
It is an object of the present invention to provide an IC and method for use in a USB device that does not need to be tested by PCs.
It is another object of the present invention to provide an IC and method for use in a USB device that does not utilize dedicated testing ports.
It is yet another object of the present invention to provide an IC and method for use in a USB device where the same pins and connectors can be used for both testing and normal operation.
To accomplish the objectives of the present invention, there is provided an apparatus and method of testing a USB device. The present invention provides a first USB communication line and a second USB communication line. Separate first and second paths are created between an external device and a controller in the USB device, with both paths including the first and second USB communication lines. The apparatus detects whether a USB connection exists over the first and second USB communication lines. If a USB connection exists over the first and second USB communication lines, USB communication is routed via the first path. Otherwise, testing communication is routed via the second path. The external device can be either a USB host or a testing unit.