Turn the more camera module configuration devices and method of SCCB based on USB3.0
Technical field
The present invention relates to a kind of more camera module configuration devices and methods, in particular to turn SCCB's based on a kind of USB3.0
More camera module configuration devices and method.
Background technique
With the development of science and technology, cost is also constantly declining, this makes while the resolution ratio of camera is continuously improved
Camera can be widely used in industry, monitoring and testing field, simultaneously because mobile terminal device such as smart phone
It continues to develop, so that high-resolution camera gets enter into the life of general public, the city camera module Shen Shou based on SCCB
Field is welcome, and in the links before camera module is researched and developed, produces, tests and dispatches from the factory, needs to carry out parameter to camera module to match
It sets and screen test, to determine whether the product is qualified.
Since high-definition camera mould group has high resolution ratio, high requirement is proposed to the transmission rate of data acquisition,
Currently, being undoubtedly existing stage best solution using USB3.0, before acquiring image data, need for camera shooting
Mould group is configured accordingly or is carried out according to test case different configurations, and camera module front end is serially taken the photograph using SCCB
As head control bus agreement, the initialization information of camera is configured.Due to different, the configuration communication link of project application background
The configuration mode of embedded standalone version is much used, configuration mode is single, and handover configurations mode efficiencies are low, and hardware redundancy lacks
Point is unfavorable for carrying out flexible dynamic configuration online when carrying out camera module test.
SCCB agreement is generally used to carry out camera configuration, and its using the embedded product of high-definition camera mould group at this stage
There are FPGA, single-chip microcontroller in configuration main side, and configuration information is written in slave DSP etc. by SCCB, to reach configuration camera
Purpose.But in each testing process before camera module research and development, production, test and factory, especially carry out screen test
When, due to the mode more than one of camera output, the information needed to configure is also not quite similar, and test macro is all using on PC
Position machine does main side, removes configuration camera module after having FPGA or single-chip microcontroller, then through SCCB;In this case, only it need to guarantee this
Communication link is normal, such configuration communication link, and some is wasted more using individual single-chip microcontroller mode
Resource;Some even increases new serial ports or Ethernet, and the interfaces such as USB2.0 do collocation channel, undoubtedly brings more to project
More burden;In addition, being brought to test macro more tired when especially carrying out the screen test of multiple camera modules simultaneously
It disturbs, increases testing cost.
Summary of the invention
The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art and provide a kind of USB3.0 to turn SCCB's
More camera module configuration devices and method, the USB3.0, which turns more camera module configuration devices of SCCB and method, to expire well
The acquisition and communication of sufficient big data quantity, and information configuration channel of the reusable as camera module, simplify the connecting pin with the end PC
Mouthful, hardware cost is low, moreover it is possible to the information of each camera module of online dynamic configuration, flexibly configurable camera module information, and can be same
The more camera module configurations of Shi Jinhang.
The technical scheme adopted by the invention is that: the more camera module configuration devices for turning SCCB based on USB3.0 include
Host computer, USB3.0 communication module, field programmable gate array, camera module;The field programmable gate array includes
USB3.0 module for reading and writing, data buffer storage and processing module, SCCB communication module, control unit module;The USB3.0 reads and writes mould
Block, the data buffer storage and processing module, the SCCB communication module are connect with described control unit module, the USB3.0
Module for reading and writing is communicated by the USB3.0 communication module and the host computer, the camera module and the SCCB communication module
Connection.The camera module includes multiple modules, and each channel SCCB of the SCCB communication module corresponds to a camera module,
Independent operating between each mould group, does not interfere with each other.
The more camera module configuration methods for turning SCCB based on USB3.0 use the more camera shootings for turning SCCB based on USB3.0
Mould group configuration device, this method comprises the following steps:
Step 1: the configuration information of camera module being required according to frame format, is defeated by data buffer storage processing module, when host computer opens
When dynamic initial configuration, and then it is sent to USB3.0 communication module;
Step 2: receiving the data that upper computer software is sent, be sent to the USB3.0 module for reading and writing of field programmable gate array;
Step 3: receiving the data that USB3.0 communication module is sent, cached;
Step 4: after receiving the data buffer storage that USB3.0 communication module is sent, disposably moving new data buffer storage in batches
Area judges that the reception for starting data next time prepares according to empty full scale will bit status register;
Step 5: following functions are realized inside FPGA: the data cached frame head of parsing USB3.0 module for reading and writing identifies target
The characteristic informations such as the ID number of camera module and the length of configuration information, feed back to control unit module;Meanwhile parsing
Configuration data classification storage is called for control unit module according to different target camera module;
Step 6: receiving data buffer storage and processing module classification storage data to be sent, be sent to target camera module, complete
Configuration.
The USB3.0 module for reading and writing includes write state machine and read states machine,
Write state machine: power-up state is reset state, then enters idle state, and whether the FIFO of waiting FX3 first has
Readable data reads data subsequently into read states, subsequently enters and enters back into after readiness when reading halted state and stopping one
The clock period is then return to idle state, repeatedly;
Read states machine: power-up state is reset state, subsequently enters idle state, judges whether FIFO has writeable data permission,
Enter in the FIFO of write state write-in FX3 if having, subsequently enters and write halted state one clock cycle of stop, eventually pass back to sky
Not busy state, repeatedly.
The beneficial effects of the present invention are: the present invention has following excellent since the present invention uses USB3.0 to turn the design of SCCB
Point:
1, the conversion of USB3.0 to SCCB agreement is realized, PC host computer can flexibly carry out sensor configuration;
2, realize that USB3.0 controller is transformed into the reading and writing sequential control of SCCB agreement by control chip FPGA;
3, the processing technique combined by data register and status register is, it can be achieved that FIFO data cached batch is moved
And sensor configuration;
4, it is docked inside FPGA with the data transmit-receive FIFO of FX3, it can be achieved that the Loop communication at the end PC and the end FPGA is surveyed certainly.
Detailed description of the invention
Fig. 1 is the system block diagram for turning the more camera module configuration devices of SCCB the present invention is based on USB3.0;
Fig. 2 is the structure chart based on upper computer software information frame;
Fig. 3 is the FX3 read-write state machine transition diagram based on the end FPGA;
In figure: 1- upper computer software, 2-USB3.0 communication module, 3-FPGA field programmable gate array, 301-USB3.0
Module for reading and writing, 302- data buffer storage and processing module, 303-SCCB communication module, 304- control unit module, 4- camera module.
Specific embodiment
The present invention is described in further detail below in conjunction with attached drawing and specific embodiment:
As shown in Figure 1, turning SCCB(SCCB based on USB3.0 is serial camera control bus association) more camera modules configuration dress
It sets, comprising: host computer 1, USB3.0 communication module 2, field programmable gate array 3, camera module 4, wherein field programmable gate
Array includes USB3.0 module for reading and writing 301, data buffer storage and processing module 302, SCCB communication module 303, control unit module
304, wherein camera module 4 includes multiple modules, and each channel SCCB corresponds to a camera module, independently transports between each mould group
Row, does not interfere with each other.
Host computer: the configuration information of camera module is required according to frame format, data buffer storage processing module is defeated by, when upper
When machine starts initial configuration, and then it is sent to USB3.0 communication module, completes configuration.If single supplemental characteristic has update,
Only refresh the content of specified parameter, remaining supplemental characteristic continues to have;When subsequent update partial content, camera module is imported again
List content is defeated by data buffer storage processing module, is sent to USB3.0 communication module, completes transmission;
USB3.0 communication module: receiving the data that upper computer software is sent, and the USB3.0 for being sent to field programmable gate array is read
Writing module;
Field programmable gate array: i.e. FPGA system platform, integrated control unit module, USB3.0 module for reading and writing, data
Caching and processing module, SCCB communication module, complete the operation of minimum system;
Control unit module: the data that USB3.0 communication module is sent are received, is cached, is then disposably moved in batches
New data buffer area judges that the reception for starting data next time prepares according to empty full scale will bit status register;Start simultaneously
The data received are sent to camera module by SCCB communication module to be configured;
USB3.0 module for reading and writing: realizing the function inside FPGA, receives the data that USB3.0 communication module is sent, and carries out
Caching;Sensor feedback information can also be cached to read for USB3.0 communication module, be ultimately passed to upper computer software;
Data buffer storage and processing module: realizing the function inside FPGA, parses the data cached frame of USB3.0 module for reading and writing
Head identifies the characteristic informations such as the ID number of target camera module and the length of configuration information, feeds back to control unit module;Meanwhile
The configuration data classification storage parsed, it is called for control unit module according to different target camera module;
SCCB communication module: receiving data buffer storage and processing module classification storage data to be sent, is sent to target camera shooting mould
Group;
Camera module: according to project testing application requirement, meet the product to be measured of SCCB configuration protocol
The process for carrying out communication configuration to camera module using the device is as follows, comprises the following steps:
Step 1: host computer 1 is according to the configuration information and frame head of camera module (including sequence number, camera module ID, configuration data
Length is write down characters in advance) component frame, USB3.0 communication module 2 is sent to by host computer automatic or manual.
Step 2:USB3.0 communication module 2 receives the data that host computer 1 is sent using special chip or IP, is sent to scene
The USB3.0 module for reading and writing 301 of programmable gate array 3.
Step 3:USB3.0 module for reading and writing 301 is under the control of control unit module 304, into data buffer storage and processing mould
Block 302 is handled, and according to the empty full scale will and status register of FIFO, is disposably carried out moving classification and is separately stored to datarams
Area judges that the empty full scale will of FIFO and status register judge whether to need to update configuration data again again, and solves simultaneously
Analysis frame head data carries out the ID identification and channel selecting of more camera modules, and then selects corresponding SCCB communication module 303.
Step 4:SCCB communication module 303 receives the configuration data of respective channel, is sent to corresponding camera module 4, completes
Configuration, carries out corresponding camera module screen test.
As shown in Fig. 2, being the structure chart of upper computer software information frame, the frame that upper computer software 1 is defined according to camera module
Structure, frame structure are made of frame head and configuration data, and frame head includes sequence number, camera module ID, setting address, order control
Word, data length, configuration data includes camera module register configuration information, and according to different demands, frame structure definition can be carried out
Flexible configuration.
As shown in figure 3, for the USB3.0(FX3 based on the end FPGA) read-write state machine transition diagram, FX3 is one and is integrated with
3.0 peripheral control unit of USB of ARM9 processor can be split up into write state machine and read states machine to describe.
Write state machine: power-up state is reset state, then enters idle state, and the FIFO of waiting FX3 first is
It is no to have readable data, data are read subsequently into read states, enter back into reading halted state stop one after subsequently entering readiness
A clock cycle is then return to idle state, repeatedly.
Read states machine: power-up state is reset state, subsequently enters idle state, judges whether FIFO has writeable data to weigh
Limit enters if having in the FIFO of write state write-in FX3, subsequently enters and writes halted state one clock cycle of stop, finally returns
To idle state, repeatedly.
The present invention is applied to the technical field of camera module configuration.
Although the embodiment of the present invention is described with practical solution, the limit to meaning of the present invention is not constituted
It makes, for those skilled in the art, is all to the modification of its embodiment and with the combination of other schemes according to this specification
Obviously.