Detailed Description
The following describes the usb chip according to an embodiment of the present invention in detail with reference to the accompanying drawings.
As shown in fig. 1, the embodiment of the present invention provides a universal serial bus chip specifically including: a front-end data flow controller, a USB interface controller, a protocol interpretation controller and a USB physical layer. The front-end data flow controller is connected with the USB interface controller and sends the read data to the USB controller; the USB interface controller is respectively connected with the protocol interpretation controller and the USB physical layer, packs the data obtained from the former-stage data flow controller according to the USB protocol specification, and sends the packed data to the USB physical layer.
The front-end data flow controller, the USB interface controller, the protocol interpretation controller and the USB physical layer are explained below separately.
1. A front-end data flow controller for transmission and control of data; in the utility model discloses in the implementation-specific implementation process, the front end data stream controller can include two kinds or three kinds among storage controller, audio encoder and the image processor, namely, the front end data stream controller can include storage controller and audio encoder, also can include storage controller and image processor, can also include storage controller, audio encoder and image processor. Wherein,
the audio encoder is respectively connected with the microphone and the USB interface controller and is used for sampling and encoding the sound signals obtained by the microphone and then sending the encoded data to the USB interface controller;
the image processor is respectively connected with the image sensor and the USB interface controller, is responsible for finishing the processing of image data, such as automatic/programmable white balance, automatic/programmable exposure control, automatic/programmable gain control and the like, and sends the processed data to the USB interface controller;
the storage controller can comprise a memory card controller or a flash memory controller, and can also comprise a flash memory controller and a flash memory controller; wherein,
a Memory Card controller, which is connected to the Memory Card and the USB interface controller respectively, and is used for identifying and reading/writing the Memory Card, and sending the read data to the USB interface controller or writing the data obtained from the USB interface controller into the Memory Card, wherein the Memory Card controller may be one or more of an SM (Smart Media) Card controller, a CF (compact flash, standard flash) Card controller, an MMC (Multi Media Card) controller, an SD (Secure Digital Card) controller, an MS (Memory Stick) controller, a tf (trans flash) Card controller, etc. in the specific implementation process of the embodiment of the present invention;
the storage controller is used for identifying and reading and writing the flash memory and converting a physical layer and a logic layer of the flash memory; the memory controller may include one or more of a Nand flash (Nand flash) controller, a Nor flash (Nor flash) controller, an And flash (And flash) controller, And the like;
here, only the most common memory card controller and memory controller are taken as examples for description, but it should be understood by those skilled in the art that the embodiments of the present invention can be applied to other types of memory controllers as well, and the principle is similar, and thus the description is omitted here.
The front-end data flow controller may further include:
the image sensor is connected to the image sensor, and is configured to complete processing and control of video data together with the image processor, in a specific implementation process of an embodiment of the present invention, the image sensor may be a CMOS (Complementary Metal Oxide Semiconductor) image sensor, and may also be a CCD (Charged Coupled Device) image sensor, and the like, and here, only the CMOS image sensor is taken as an example for description, and an internal structure of the CMOS image sensor is as shown in fig. 2, and mainly includes modules such as a pixel array and a data output interface. The utility model discloses in the concrete realization process of embodiment, image sensor can integrate the embodiment of the utility model provides an on the USB chip, can practice thrift the cost of production like this, of course, image sensor also can not be integrated on the USB chip, but outside being independent of the USB chip, its concrete realization scheme has the mature technology in prior art, and here is no longer repeated.
2. The USB interface controller is connected with the front end data flow controller and the protocol interpreter respectively, is responsible for completing protocol data translation and event detection on the bus, and is a core device for realizing USB transmission. Specifically, when USB data is transmitted on the bus in packet units, the start and end flags of the data packet need to be identified. The data check adopts a Cyclic Redundancy Check (CRC) method, and a corresponding CRC check is required when data is received or transmitted. The USB protocol specifies that a USB device should have several states: connection, power up, default, address assignment, configuration complete, and suspend. The transition between the states is accomplished by an event detection function on the bus. According to the difference of the D + and D-signal line levels on the USB bus, the bus has 4 states: j-state, K-state, SEO-state, and SEI-state. The length of the duration of the various states determines bus events on the bus such as reset signals, suspend notifications, and wake-up. Therefore, detection and determination of USB bus events is required to accomplish the proper transition between states. USB interface controllers are typically required to be USB Spec Rev2.0 compliant. The USB interface controller is mainly used for detecting events on a serial bus, carrying out protocol processing with a universal CMOS image sensor, a USB physical layer and/or a USB device controller and completing conversion among states; the internal structure of the USB interface controller is shown in fig. 3: comprises a USB protocol controller, a configurable RAM and a register set, wherein,
the USB protocol controller is used for realizing a protocol layer of a USB and carrying out protocol processing with the universal CMOS image sensor, the USB physical layer and/or the USB equipment controller;
a configurable RAM for allocating a buffer of a specified size for a transmission endpoint;
and the register group is used for realizing the control of transmission and the processing of requests. The register group comprises a main control register, a USB control register, a control endpoint register, a non-control endpoint register and a DMA (Direct memory Access) register, wherein,
the main control register controls the interrupt enable and saves the interrupt state;
the USB control register is used for controlling various events related to the USB host and storing the states of the corresponding events;
the control end point register is used for processing the USB request from the host and storing the state information in transmission;
a non-control endpoint register to configure, control, and operate the non-control endpoint;
and the DMA register is used for processing DMA related operations.
3. The protocol interpretation controller is connected with the USB interface controller and is responsible for finishing the protocol interpretation of video, audio and mass storage classes, the protocol interpreter can use the MCU to finish request processing and transaction transmission control, specifically, the USB protocol interpretation controller realizes the following tasks, thereby realizing the protocol interpretation of the video, audio and mass storage classes:
the USB controls data transmission and reception of an Endpoint (Endpoint 0).
Various descriptors of video class, audio class and mass storage class are transmitted through a control endpoint channel;
(descriptor) sending to the host;
responding to various requirements (Request) of the host computer and performing interpretation;
the protocol interpreter may also be implemented completely by hardware, i.e. a finite state machine is used to complete the request processing and transmission control, and the implementation process is specifically shown in fig. 4, and includes the following steps:
step 40, the protocol interpretation controller circularly detects the state of a register related to the interruption, judges whether the interruption occurs, and executes step 41 when the interruption is found;
step 41, reading corresponding register content;
and step 42, judging the type of the interrupt on the USB bus according to the content of the register. If the bus reset interrupt is present, go to step 43; if the control interrupt is positive, go to step 44;
step 43, the device controller will reset the USB bus;
step 44, judging whether the control input is interrupted or the control output terminal, if the control input terminal is the control input terminal, executing step 45; if the control output is interrupted, go to step 46;
step 45, the device controller sends the data requested by the host to a buffer area of the control endpoint;
step 46, the device controller obtains the data sent by the host computer to the control endpoint buffer area, and analyzes the data to generate a series of control signals;
step 47, judging whether the interruption is the non-control point interruption or not, and if the interruption is the non-control endpoint interruption, executing step 48; if the interrupt type is unknown, go to step 49;
step 48, the equipment controller carries out corresponding processing according to the configuration information of the endpoint;
and step 49, carrying out error processing.
4. And the USB physical layer of the universal serial bus is connected with the USB interface controller and is responsible for converting the differential signals on the USB bus into digital signals, performing related data format conversion and sending the converted data to the PC. Specifically, since the USB data transmission uses NRZI (non return to zero inversion) encoding and bit stuffing, encoding and decoding are required when serial data is transmitted or received. Data is transferred in bytes within the controller and therefore also requires serial-to-parallel conversion. The USB physical layer is fully compliant with USB Spec Rev2.0 and UTMI Spec Rev1.05. The internal structure of the USB physical layer is shown in fig. 5, and includes a full-speed transmission sending and receiving module, a high-speed transmission sending and receiving module, a sending control logic module, a receiving control logic module, a full-speed/high-speed transmission switching control module, and a clock module, wherein,
a full-speed transmission sending and receiving module for sending and receiving image data at full speed;
the high-speed transmission sending and receiving module is used for sending and receiving image data at high speed;
the sending control logic module is used for realizing protocol processing of the received data packet;
the receiving control logic module is used for restoring the acquired data packet according to the USB protocol;
the full-speed/high-speed transmission switching control module is used for switching between a full-speed transmission state and a high-speed transmission state;
and the clock module is used for providing a control clock for the sending control logic module and the receiving control logic module.
The utility model discloses another embodiment provides a universal serial bus chip specifically includes: the image sensor, the image processor, the usb interface controller, the protocol interpreter translator, and the usb physical layer are shown in detail in fig. 6, in which,
the image processor is connected with the image processor, the image processor is connected with the universal serial bus interface controller, and the obtained video data is sent to the universal serial bus interface controller; the universal serial bus interface controller is respectively connected with the protocol interpretation controller and the universal serial bus physical layer, and sends the video data obtained from the front-end data flow controller to the universal serial bus physical layer or sends the video data obtained from the universal serial bus physical layer to the front-end data flow controller;
the following is a detailed description.
The image sensor is connected with the image sensor and used for completing the processing and control of video data together with the image processor, in the specific implementation process of the embodiment of the present invention, the image sensor may be a CMOS (Complementary Metal Oxide Semiconductor) image sensor, a CCD (Charged Coupled Device) image sensor, etc., and the CMOS image sensor is only used as an example herein for explanation;
the image processor is respectively connected with the image sensor and the USB interface controller, is responsible for finishing the processing of image data, such as automatic/programmable white balance, automatic/programmable exposure control, automatic/programmable gain control and the like, and sends the processed data to the USB interface controller;
the universal serial bus interface controller is respectively connected with the front-end data flow controller and the protocol interpreter, is responsible for finishing protocol data translation and event detection on the bus, and is a core device for realizing USB transmission.
The protocol interpretation controller is used for controlling the universal serial bus interface controller to interpret the video protocol;
and the universal serial bus physical layer is connected with the USB interface controller and is responsible for converting the differential signals on the USB bus into digital signals, performing related data format conversion and sending the converted data to the PC.
According to the technical solution provided by the embodiment of the present invention, the universal serial bus chip provided by the embodiment of the present invention integrates at least two of video, audio and storage types on the same chip to achieve the purpose of saving user cost, and the universal serial bus chip provided by another embodiment of the present invention integrates a CMOS image sensor on a USB chip to achieve the purpose of saving user cost; and because the USB chip does not need the drive development of a PC, the purpose of facilitating the use of a user is achieved.
The above description is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are all covered by the scope of the present invention. Therefore, the protection scope of the embodiments of the present invention shall be subject to the protection scope of the claims.