Summary of the invention
In order to solve above technical problem, the present invention provides method, the device of a kind of usb data collection and is
System.
The invention discloses a kind of method that usb data gathers, including:
S1. the data constantly collected are stored in first group of SDRAM;
S2. judge whether described first group SDRAM is filled with, if so, enter step S3, if it is not, return
Step S1;
S3. first group of described SDRAM data are read back, meanwhile, the new data storage that will constantly collect
In second group of SDRAM;
S4. judge whether described second group SDRAM is filled with, if so, enter step S5, if it is not, return
Step S3;
S5. second group of described SDRAM data are read back.
In the method that usb data of the present invention gathers, also include between described step S2 and S3
Step: first group of SDRAM of S21. set is filled with mark.
In the method that usb data of the present invention gathers, also include between described step S3 and S4
Step: S31. removes first group of SDRAM and is filled with mark.
In the method that usb data of the present invention gathers, also include between described step S4 and S5
Step: second group of SDRAM of S41. set is filled with mark.
In the method that usb data of the present invention gathers, after described step S5, further comprise the steps of: S6.
Remove second group of SDRAM be filled with mark and return step S1.
The invention discloses the device that a kind of usb data gathers, including:
First group of SDRAM unit: for the data constantly collected are stored in first group of SDRAM;
First group of SDRAM is filled with judging unit: is connected with first group of described SDRAM unit, is used for judging
Whether first group of described SDRAM is filled with;
First group of SDRAM data is read back and second group of SDRAM unit, is filled with first group of described SDRAM
Judging unit is connected, for reading back, first group of described SDRAM data meanwhile, by constantly collect
New data is stored in second group of SDRAM;
Second group of SDRAM is filled with judging unit, reads back and second group of SDRAM with first group of described SDRAM
Unit is connected, for judging whether described second group SDRAM is filled with;
Second group of SDRAM data is read back unit, is filled with judging unit with second group of described SDRAM and is connected,
For second group of described SDRAM data are read back.
In the device that usb data of the present invention gathers, read back in first group of described SDRAM data
And second group of SDRAM unit and first group of SDRAM are filled with between judging unit and there is also first group of SDRAM and put
Bit location, is filled with mark for first group of SDRAM of set;Read back in first group of described SDRAM data and
Second group of SDRAM unit and second group of SDRAM are filled with between judging unit and there is also first group of clear position of SDRAM
Unit, is filled with mark for removing first group of SDRAM.
In the device that usb data of the present invention gathers, it is single that second group of described SDRAM is filled with judgement
Unit and second group of SDRAM data are read back and be there is also second group of SDRAM set unit between unit, for set
Second group of SDRAM is filled with mark, there is also second after second group of described SDRAM data read back unit
The group clear bit location of SDRAM, is filled with mark and to be back to first group of SDRAM mono-for removing second group of SDRAM
Unit.
The invention discloses the system that a kind of usb data gathers, including USB controller, for controlling data
Gather, the usb data controller that stores and transmit, first group of SDRAM, second group of SDRAM, for electricity
The signal conditioning circuit that flat turn is changed, described USB controller, first group of SDRAM, second group of SDRAM, letter
Number modulate circuit is all connected with usb data controller, and described usb data controller has claim 6
The device that described usb data gathers.
In the system that usb data of the present invention gathers, first group of described SDRAM, second group of SDRAM
At least include a piece of SDRAM chip.
Implement method, Apparatus and system that a kind of usb data of the present invention gathers, there is following useful skill
Art effect:
Two groups of SDRAM can alternately store data, it is ensured that when the transmission of data acquisition and data is carried out simultaneously
Do not produce the read/write conflict of SDRAM, it is possible to complete continuous data collection very easily, more effectively utilize PC
The storage resource of machine, it is achieved data record for a long time.Owing to employing SDRAM is as data buffer storage, a side
Face ensure that the bandwidth and the degree of depth of data storage that data store, and on the other hand greatly reduces the cost of hardware.
Detailed description of the invention
By describing the technology contents of the present invention, structural feature in detail, being realized purpose and effect, below in conjunction with reality
Execute mode and coordinate accompanying drawing to be explained in detail.
SDRAM: i.e.: Synchronous Dynamic Random Access Memory, synchronous dynamic random is deposited
Reservoir, synchronizes to refer to Memory job demand synchronised clock, and the transmission of internal order is with the transmission of data all
On the basis of it;Dynamically refer to that storage array needs constantly refreshing to ensure that data are not lost;Refer at random
Data are not linearly to store successively, but freely specify address to carry out reading and writing data.
The structure of this programme is fpga chip+high speed USB 2.0 controller+two group SDRAM, additionally includes signal
Modulate circuit, wherein FPGA be used for the collection of data, storage and with USB2.0 controller transmission
Bridge joint, high speed USB 2.0 controller is for realizing the USB high-speed data between PC and data collecting system
Transmission, two groups of SDRAM for alternately caching the data collected, direct defeated with outside of signal conditioning circuit
Enter signal to be connected, on the one hand for protecting the IO of fpga chip, on the other hand for level conversion.
Refer to Fig. 1, the method for a kind of usb data collection, including:
S1. the data constantly collected are stored in first group of SDRAM;
S2. judge whether described first group SDRAM is filled with, if so, enter step S3, if it is not, return
Step S1;
S3. first group of described SDRAM data are read back, meanwhile, the new data storage that will constantly collect
In second group of SDRAM;
S4. judge whether described second group SDRAM is filled with, if so, enter step S5, if it is not, return
Step S3;
S5. second group of described SDRAM data are read back.
It is filled with it is preferred that further comprise the steps of: first group of SDRAM of S21. set between described step S2 and S3
Mark, further comprises the steps of: S31. and removes first group of SDRAM and be filled with mark between described step S3 and S4.
It is filled with it is preferred that further comprise the steps of: second group of SDRAM of S41. set between described step S4 and S5
Mark, further comprise the steps of: after described step S5 S6. remove second group of SDRAM be filled with mark and return
Step S1.
The operation of system is controlled by USB by PC, and PC can read the fortune of acquisition system by USB
Row status information and collect data, meanwhile, PC can also send instruction by USB to acquisition system.
In data acquisition, first PC sends to acquisition system and starts order, and acquisition system receives startup
The data collected can be stored in first group of SDRAM after order, after first group of SDRAM is filled with, gather
System can set " first group of SDRAM is filled with mark ", in second group of SDRAM, then store data, the
After two groups of SDRAM are filled with, acquisition system can set " second group of SDRAM is filled with mark ".Meanwhile, PC
Data in first group of SDRAM can be read back, so after inquiring " first group of SDRAM is filled with mark " by machine
Rear removing " first group of SDRAM is filled with mark ", PC after inquiring " second group of SDRAM is filled with mark ",
Data in second group of SDRAM can be read back, then remove " second group of SDRAM is filled with mark ".The most anti-
Carry out, if PC inquires " first group of SDRAM is filled with mark " and " second group of SDRAM deposits simultaneously again
Full scale will ", then it represents that the storage speed of the data transmission speed more than USB, PC now can be given to make mistake and carry
Show.By reasonably design, as appropriately selected sample frequency, improve the means such as USB transmission efficiency, permissible
Avoid the generation of this kind of situation.
In this programme, the collection of data, storage, the control of SDRAM and system are connect by high speed USB 2.0
Mouthful and PC between the logical process work such as mutual completed by FPGA, therefore FPGA is whole system
Core.
Refer to Fig. 2, the device of a kind of usb data collection, including:
10, first group of SDRAM of first group of SDRAM unit is filled with 20, first group of SDRAM data of judging unit
Read back and 30, second group of SDRAM of second group of SDRAM unit is filled with 40, second group of SDRAM number of judging unit
According to the unit 50 that reads back.
First group of SDRAM unit 10: for the data constantly collected are stored in first group of SDRAM;
First group of SDRAM is filled with judging unit 20: be connected with first group of SDRAM unit 10, is used for judging institute
Whether the first group of SDRAM stated is filled with;
First group of SDRAM data is read back and second group of SDRAM unit 30, is filled with judgement with first group of SDRAM
Unit 20 is connected, for first group of described SDRAM data being read back, meanwhile, new by constantly collect
Data are stored in second group of SDRAM;
Second group of SDRAM is filled with judging unit 40, reads back with first group of SDRAM and second group of SDRAM unit
30 are connected, for judging whether described second group SDRAM is filled with;
Second group of SDRAM data is read back unit 50, is filled with judging unit 40 with second group of SDRAM and is connected, and uses
In second group of described SDRAM data are read back.
It is preferred that read back and second group of SDRAM unit 30 and first group of SDRAM first group of SDRAM data
It is filled with between judging unit 20 and there is also first group of SDRAM set unit 25, for first group of SDRAM of set
It is filled with mark;First group of SDRAM data are read back and second group of SDRAM unit 30 and second group of SDRAM are filled with
There is also first group of clear bit location of SDRAM 35 between judging unit 40, be filled with for removing first group of SDRAM
Mark.
It is preferred that second group of SDRAM is filled with judging unit 40 and second group of SDRAM data is read back unit 50
Between there is also second group of SDRAM set unit 45, be filled with mark for second group of SDRAM of set,
Two groups of SDRAM data are read back and be there is also second group of clear bit location of SDRAM 60 after unit 50, for removing the
Two groups of SDRAM are filled with mark and are back to first group of SDRAM unit.
Refer to Fig. 3, the system of a kind of usb data collection, including USB controller 100, for controlling number
According to gathering, 200, first group of SDRAM300 of usb data controller of storing and transmitting, second group
SDRAM400, signal conditioning circuit 500 for level conversion, USB controller 100, first group
SDRAM300, second group of SDRAM400, signal conditioning circuit 500 are all connected with usb data controller 200,
Usb data controller 200 has the device that above-mentioned usb data gathers.
Wherein, usb data controller 200 is fpga chip, the collection of data, storage, the control of SDRAM
System and system are worked by FPGA by the logical process such as mutual between high speed USB 2.0 interface and PC
Completing, therefore FPGA is the core of whole system, shown in functional block diagram Fig. 4 of FPGA.
Wherein the effect of USB interface bridge module 201 is by the inside of high speed USB 2.0 controller Yu FPGA
Logic bridges together, thus the instruction sent by host computer is converted into corresponding logical signal, controls
The state of the internal modules of FPGA.The effect of waveform sampling module 202 is to input with specific sample rate
Signal is sampled, and data sampling obtained deliver to waveform memory module 203.Waveform memory module 203
For controlling the storage of sampled data.First group of sdram controller 204 and second group of sdram controller 205
For controlling the sequential such as the refreshing of two groups of independences SDRAM of off-chip, precharge, reading and writing.
To sum up, this programme is the structure of fpga chip+high speed USB 2.0 controller+two group SDRAM, FPGA
Various digital units circuit can be realized efficiently, flexibly, and fpga chip can reconfigure, system upgrade
Very convenient.The data transmission that high speed USB 2.0 controller will be able to collect with the transfer rate of 480Mbps
To PC, two groups of SDRAM can alternately store data, it is ensured that the transmission of data acquisition and data is entered simultaneously
The read/write conflict of SDRAM is not produced, it is possible to complete consecutive data set very easily, more effectively utilize during row
The storage resource of PC, it is achieved data record for a long time.Owing to employing SDRAM is as data buffer storage, one
Aspect ensure that the bandwidth and the degree of depth of data storage that data store, and on the other hand greatly reduces the hard of scheme
Part cost.
The feature of the technical program design is:
1, notebook data acquisition scheme structure is " fpga chip+high speed USB 2.0 controller+two group SDRAM "
The feature of two groups of SDRAM is that the address bus of these two groups of SDRAM, data/address bus and control signal are all only
Stand, often group SDRAM can be independent control and access, one group of SDRAM is probably a piece of SDRAM core
Sheet, it is also possible to multi-disc SDRAM chip.
2, the working method of data acquisition system is, two groups of SDRAM alternately data storages and reading,
Data collecting system is marked by " first group of SDRAM is filled with mark " and " second group of SDRAM is filled with mark "
The data known in which group SDRAM can be read by PC, and PC judges to need which reads by the two mark
Data in group SDRAM, after the data in PC has read SDRAM, will can indicate removing accordingly.
3, the operation of data acquisition system controls to be completed by high speed USB 2.0 interface by PC, collects
Data read by high speed USB 2.0 interface by PC, the data collected are analyzed work further
Completed by PC.
Implement method, Apparatus and system that a kind of usb data of the present invention gathers, there is following useful skill
Art effect:
Two groups of SDRAM can alternately store data, it is ensured that when the transmission of data acquisition and data is carried out simultaneously
Do not produce the read/write conflict of SDRAM, it is possible to complete consecutive data set very easily, more effectively utilize PC
Storage resource, it is achieved for a long time data record.Owing to employing SDRAM is as data buffer storage, on the one hand
Ensure that bandwidth and the degree of depth of data storage, the hardware cost on the other hand greatly reduced that data store.
Above in conjunction with accompanying drawing, embodiments of the invention are described, but the invention is not limited in above-mentioned
Detailed description of the invention, above-mentioned detailed description of the invention is only schematic rather than restrictive, this
The those of ordinary skill in field, under the enlightenment of the present invention, is being protected without departing from present inventive concept and claim
Under the ambit protected, it may also be made that a lot of form, within these belong to protection scope of the present invention.