CN104570858B - The analog signal method of sampling and sampling system - Google Patents
The analog signal method of sampling and sampling system Download PDFInfo
- Publication number
- CN104570858B CN104570858B CN201410800121.4A CN201410800121A CN104570858B CN 104570858 B CN104570858 B CN 104570858B CN 201410800121 A CN201410800121 A CN 201410800121A CN 104570858 B CN104570858 B CN 104570858B
- Authority
- CN
- China
- Prior art keywords
- signal
- analog
- microprocessor
- digital converter
- sampled data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000005070 sampling Methods 0.000 title claims abstract description 72
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000012545 processing Methods 0.000 claims abstract description 46
- 230000003139 buffering effect Effects 0.000 claims abstract description 20
- 238000009434 installation Methods 0.000 claims abstract description 19
- 238000004458 analytical method Methods 0.000 claims abstract description 14
- 238000004891 communication Methods 0.000 claims description 24
- 230000007274 generation of a signal involved in cell-cell signaling Effects 0.000 claims description 15
- 230000005540 biological transmission Effects 0.000 claims description 5
- 230000005641 tunneling Effects 0.000 claims description 2
- 238000004088 simulation Methods 0.000 claims 1
- 230000000694 effects Effects 0.000 abstract description 22
- 230000008569 process Effects 0.000 abstract description 11
- 238000010276 construction Methods 0.000 abstract description 8
- 238000013461 design Methods 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 8
- 241001269238 Data Species 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000008054 signal transmission Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/042—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Analogue/Digital Conversion (AREA)
- Microcomputers (AREA)
Abstract
The invention discloses a kind of analog signal method of sampling, it comprises the following steps:Microprocessor carries out Initialize installation;Microprocessor selects PWM passages by the hardware logic signal output of generation;Analog-digital converter is received after hardware logic signal, and analog-digital converter sends the sampled data of collection to dma controller by SPI interface;When the buffering area of dma controller is filled with sampled data, dma controller produces interrupt signal, and interrupt signal and sampling data transmitting are delivered into microprocessor;Microprocessor carries out analysis calculating processing to sampled data.Invention additionally discloses a kind of sampling system.The present invention is carried out after Initialize installation by microprocessor, is started analog-digital converter collection sampled data, has been reached the technique effect that need not be controlled to sampling process.Meanwhile, microprocessor of the invention is the high-speed sampling that analog signal can be achieved, and has reached that with low cost, system construction simplifies the technique effect low with design difficulty.
Description
Technical field
The invention belongs to signal acquisition field, more particularly to a kind of analog signal method of sampling and sampling system.
Background technology
At present, analog signal Sampling techniques are widely applied in the communication equipment of the communications industry, therefore, are occurred varied
The analog signal method of sampling.
And the existing main analog signal method of sampling is:Select DSP (Digital Signal Processing:Number
Word signal processor) and FPGA (Field rogrammable Gate Array:Field programmable gate array) use cooperatively, come
The high-speed sampling of analog signal is carried out, wherein FPGA is responsible for the control of analog signal high-speed sampling process, and DSP is responsible for sampled data
Analysis calculate
Because existing collection of simulant signal system both needs DSP, FPGA is needed again, so, cause construction sampling system
The high technical problem of cost of uniting.Simultaneously as need FPGA to control analog signal high-speed sampling process, so, cause sampling system
The technical problem such as system construction complexity and design difficulty height.
In summary, seek a kind of with low cost, and construction simplify the sampling system low with design difficulty be it is current urgently
Technical problem to be solved.
The content of the invention
It is a primary object of the present invention to provide a kind of analog signal method of sampling and sampling system, existing adopt is solved
The technical problems such as cost height, construction complexity and design difficulty height that sample system is present.
To achieve the above object, the invention provides a kind of analog signal method of sampling, it comprises the following steps:
Microprocessor carries out Initialize installation.
The microprocessor produces hardware logic signal, and selects PWM passage output hardware logical signals.
Analog-digital converter is received after the hardware logic signal, and the analog-digital converter gathers hits
According to, and the sampled data is sent to dma controller by SPI interface.
When the buffering area of the dma controller is filled with the sampled data, the dma controller produces interrupt signal, and
The interrupt signal and the sampling data transmitting are delivered into the microprocessor.
The microprocessor carries out analysis calculating processing to the sampled data.
Preferably, the step of microprocessor carries out Initialize installation, including:
The microprocessor obtains the time sequence parameter of the analog-digital converter, and sets institute according to the time sequence parameter
State the output frequency and dutycycle of the PWM module of microprocessor.
The microprocessor sets the parameter of the SPI interface.
The microprocessor sets the size of the buffering area of the dma controller.
Preferably, the microprocessor produces hardware logic signal, and selects the step of PWM passage output hardware logical signals
Suddenly, including:
The microprocessor produces clock signal, sampled signal and channel switching signal.
The microprocessor selects the different PWM passages, and according to the output frequency and the duty of setting
Than exporting the clock signal, the sampled signal and the channel switching signal respectively.
Preferably, the analog-digital converter is received after the hardware logic signal, the analog-digital converter
Sampled data is gathered, and the step of the sampled data is sent to dma controller by SPI interface, including:
The analog-digital converter receives the clock signal, the sampled signal sent by PWM passages difference
And the channel switching signal.
The analog-digital converter gathers the sampled data according to the clock signal and the sampled signal.
The analog-digital converter is sent out the sampled data by the SPI interface according to the channel switching signal
Deliver to the dma controller.
Preferably, the microprocessor carries out the step of analysis calculates processing to the sampled data, including:
The microprocessor according to the sampled data judge the microprocessor PWM module whether normal work.
The microprocessor according to the sampled data judge the analog-digital converter whether normal acquisition hits
According to.
In addition, to achieve the above object, present invention also offers a kind of analog signal sampling system, it includes microprocessor
Device, analog-digital converter, dma controller, the microprocessor are connected with the analog-digital converter by PWM tunneling traffics
Connect, the analog-digital converter is communicated to connect with the dma controller by SPI interface, the microprocessor and the DMA
Communicated to connect between controller, the microprocessor is used for Initialize installation, is additionally operable to produce hardware logic signal and selects PWM
Passage output hardware logical signal and to sampled data carry out analysis calculating processing;The analog-digital converter is used to adopt
Collect sampled data;The dma controller is used to store sampled data and produces interrupt signal.
Preferably, the microprocessor include acquisition module, background processing module, PWM module, background communication module and
Judge module.
The acquisition module, the time sequence parameter for obtaining the analog-digital converter.
The background processing module, output frequency and duty for setting the PWM module according to the time sequence parameter
Than being additionally operable to set the parameter of the SPI interface, being additionally operable to set the size of the buffering area of the dma controller, and produce
Hardware logic signal and selection PWM passages.
The background communication module, for sending the hardware logic signal to analog-digital converter.
The judge module, for according to the sampled data judge the PWM module whether normal work and described
Analog-digital converter whether normal acquisition sampled data.
Preferably, the background processing module includes clock generating unit, sampled signal generation unit, passage switching
Signal generation unit and PWM channel selection units.
The clock generating unit, for generating clock signal.
The sampled signal generation unit, for generating sampled signal.
The channel switching signal generation unit, for generating channel switching signal.
The PWM channel selection units, for selecting PWM to lead to according to clock signal, sampled signal or channel switching signal
Road.
Preferably, the analog-digital converter includes analog-digital converter processing module, analog-digital converter communication module.
The analog-digital converter processing module, for gathering hits according to the clock signal and the sampled signal
According to.
The analog-digital converter communication module, for receiving the clock signal, the sampled signal and the passage
Switching signal, and for sending the sampled data to the dma controller.
Preferably, the dma controller includes dma controller processing module and dma controller communication module.
The dma controller processing module, for the sampled data to be stored to buffering area, and for producing interruption
Signal.
The dma controller communication module, for receiving the sampled data, and sends interrupt signal to microprocessor
Device.
The present invention is carried out after Initialize installation by microprocessor, is started analog-digital converter collection sampled data, is reached
The technique effect that sampling process need not be controlled.Meanwhile, microprocessor of the invention is that analog signal can be achieved
High-speed sampling, has reached that with low cost, system construction simplifies the technique effect low with design difficulty.
Figure of description
Fig. 1 is the schematic flow sheet of analog signal method of sampling embodiment 1 of the present invention;
Fig. 2 is the schematic flow sheet of analog signal method of sampling embodiment 2 of the present invention;
Fig. 3 is the schematic flow sheet of analog signal method of sampling embodiment 3 of the present invention;
Fig. 4 is the schematic flow sheet of analog signal method of sampling embodiment 4 of the present invention;
Fig. 5 is the schematic flow sheet of analog signal method of sampling embodiment 5 of the present invention;
Fig. 6 is the block diagram of analog signal sampling system embodiment 6 of the present invention;
Fig. 7 is the high-level schematic functional block diagram of microprocessor embodiment 7 in analog signal sampling system of the present invention;
Fig. 8 is the high-level schematic functional block diagram of analog-digital converter embodiment 8 in analog signal sampling system of the present invention;
Fig. 9 is the high-level schematic functional block diagram of dma controller embodiment 9 in analog signal sampling system of the present invention.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used to limit the present invention.
Embodiment 1
Referring to Fig. 1, Fig. 1 is the schematic flow sheet of analog signal method of sampling embodiment 1 of the present invention.
In embodiment 1, the invention provides a kind of analog signal method of sampling, it comprises the following steps:
Step S10, microprocessor carries out Initialize installation.
Microprocessor includes PWM (Pulse Width Modulation:Pulse width modulation) module, SPI (Serial
Control Interface:Serial Peripheral Interface (SPI)) interface and DMA (Direct Memory Access:Direct memory is visited
Ask) controller.Microprocessor carries out parameter setting to PWM module, SPI interface and dma controller etc., so that follow-up ADC
When (Analog-to-Digital Control analog-digital converters) gathers sampled data, microprocessor need not be to sampling
Journey is controlled.The technique effect of the treatment effect of lifting microprocessor is reached.
Step S11, the microprocessor produces hardware logic signal, and selects PWM passage output hardware logical signals.
After the completion of the operation of microprocessor Initialize installation, microprocessor generates the hardware logic signal related to ADC samplings.Together
When, select corresponding PWM passages output hardware logical signal.
Because the present invention has carried out operating the Initialize installation of PWM module by microprocessor, so, when the present invention passes through
During the PWM passage output hardware logical signals of selection, the output frequency of the hardware logic signal of output, dutycycle meet setting
Demand.Therefore, reached microprocessor without the technique effect that is controlled to sampling process.
Step S12, analog-digital converter is received after the hardware logic signal, the analog-digital converter collection
Sampled data, and the sampled data is sent to dma controller by SPI interface.
After analog-digital converter receives hardware logic signal, start the collection of sampled data, and adopting collection
Sample data are transmitted to dma controller by SPI interface.
Because microprocessor of the present invention has carried out Initialize installation operation to SPI interface, so, transmitted by SPI interface
Sampled data is satisfactory to the DMA sampled datas controlled, has reached and has been further ensured that sampling process does not need micro- place
The technique effect that reason device is controlled.
Step S13, when the buffering area of the dma controller is filled with the sampled data, the dma controller produces interruption
Signal, and the interrupt signal and the sampling data transmitting are delivered into the microprocessor.
When the buffering area of dma controller is filled with sampled data, dma controller generation interrupt signal, DMA believes the interruption
Number send to microprocessor, microprocessor is received after the interrupt signal, receive dma controller send sampled data.
Step S14, the microprocessor carries out analysis calculating processing to the sampled data.
Microprocessor is finished receiving after the sampled data of dma controller transmission, the sampled data is carried out at analysis calculating
Reason operation.
The present invention is carried out after Initialize installation by microprocessor, is started analog-digital converter collection sampled data, is reached
The technique effect that sampling process need not be controlled.Meanwhile, microprocessor of the invention is that analog signal can be achieved
High-speed sampling, has reached that with low cost, system construction simplifies the technique effect low with design difficulty.
Embodiment 2
Referring to Fig. 2, Fig. 2 is the schematic flow sheet of analog signal method of sampling embodiment 2 of the present invention.
In example 2, with above-described embodiment 1 the step of, is essentially identical, and difference is, the step S10, bag
Include:
Step S20, the microprocessor obtains the time sequence parameter of the analog-digital converter, and is joined according to the sequential
Number sets the output frequency and dutycycle of the PWM module of the microprocessor.
Microprocessor obtains the time sequence parameter of analog-digital converter, the PWM module set further according to the time sequence parameter
Output frequency and dutycycle, so that after the hardware logic signal of microprocessor generation is exported by PWM passages, its output frequency and accounting for
It is empty more consistent than with the output frequency and dutycycle of setting.
Step S21, the microprocessor sets the parameter of the SPI interface.
Microprocessor is configured to the parameter of SPI interface, is sent extremely so that analog-digital converter is received by SPI
The sampled data of dma controller is the sampled data for meeting setting requirements, has reached sampled data to meeting setting requirements
The technique effect of filtering.
Step S22, the microprocessor sets the size of the buffering area of the dma controller.
Microprocessor set dma controller buffering area size, reached microprocessor can according to specific circumstances,
Determine that optimal time interval carries out once analysis calculating processing to sampled data, reached the treatment effeciency for accelerating microprocessor
Technique effect.
Embodiment 3
Referring to Fig. 3, Fig. 3 is the schematic flow sheet of analog signal method of sampling embodiment 3 of the present invention.
In embodiment 3, with above-described embodiment 2 the step of, is essentially identical, and difference is, the step S11, bag
Include:
Step S30, the microprocessor produces clock signal, sampled signal and channel switching signal.
Microprocesser initialization is set after the completion of operation, and microprocessor generates clock signal (ad_clock), sampling letter
Number (ad_start) and channel switching signal (ad_sel).
Step S31, the microprocessor selects the different PWM passages, and the output frequency according to setting and
The dutycycle exports the clock signal, the sampled signal and the channel switching signal respectively.
Microprocessor is for one PWM passages output clock signal (ad_clock) of selection, the output frequency of the clock signal
Rate, dutycycle are consistent with output frequency and dutycycle that microprocessor sets PWM module.
Microprocessor is for one PWM passages output sampled signal (ad_start) of selection, the output frequency of the sampled signal
Rate, dutycycle are consistent with output frequency and dutycycle that microprocessor sets PWM module.
Microprocessor is directed to one PWM passage output channel switching signal (ad_sel) of selection, the channel switching signal
Output frequency, dutycycle are consistent with output frequency and dutycycle that microprocessor sets PWM module.
The present invention selects different PWM passages to export different hardware logic signals by microprocessor, has reached quickening
The technique effect of transmission speed.
Embodiment 4
Referring to Fig. 4, Fig. 4 is the schematic flow sheet of analog signal method of sampling embodiment 4 of the present invention.
In example 4, with above-described embodiment 3 the step of, is essentially identical, and difference is, the step S12, bag
Include:
Step S40, the analog-digital converter receives the clock signal by the transmission of different PWM passages, described
Sampled signal and the channel switching signal.
Analog-digital converter receives clock signal, sampled signal and the passage sent by different PWM passages and cut
Change signal.
Step S41, the analog-digital converter gathers the sampling according to the clock signal and the sampled signal
Data.
Analog-digital converter is received after clock signal and sampled signal, opens collection sampled data.
Step S42, the analog-digital converter passes through the sampled data according to the channel switching signal described
SPI interface is sent to the dma controller.
Analog-digital converter is received after channel switching signal, by the sampled data of collection by SPI interface send to
Dma controller.
Embodiment 5
Referring to Fig. 5, Fig. 5 is the schematic flow sheet of analog signal method of sampling embodiment 5 of the present invention.
In embodiment 5, essentially identical the step of with above-described embodiment 1, difference is, the step S14, bag
Include:
Step S50, the microprocessor judges whether the PWM module of the microprocessor is normal according to the sampled data
Work;
Step S51, the microprocessor judges whether the analog-digital converter is normally adopted according to the sampled data
Collect sampled data.
The sampled data of the present invention includes PWM module and judges that data message and analog-digital converter judge that data are believed
Breath.
Microprocessor by PWM module judge data message judge PWM module whether normal work, reached ensure output
Hardware logic signal output frequency and dutycycle be the technique effect for meeting setting requirements.
Microprocessor by analog-digital converter judge data message judge analog-digital converter whether normal work,
The technique effect of the work state information of real-time understanding digital quantizer is reached.
Embodiment 6
Referring to Fig. 6, Fig. 6 is the block diagram of analog signal sampling system embodiment 6 of the present invention.
In addition, to achieve the above object, the embodiment of the present invention 6 additionally provides a kind of analog signal sampling system, and it includes
Microprocessor 1, analog-digital converter 2, dma controller 3, the microprocessor 1 pass through with the analog-digital converter 2
PWM passages 4 are communicated to connect, and the analog-digital converter 2 is communicated to connect with the dma controller 3 by SPI interface 5, described
Communicated to connect between microprocessor 1 and the dma controller 3, the microprocessor 1 is used for Initialize installation, is additionally operable to produce
Hardware logic signal carries out analysis calculating processing with the output hardware logical signal of selection PWM passages 4 and to sampled data;Institute
Stating analog-digital converter 2 is used to gather sampled data;The dma controller 3 is used to store sampled data and produces interruption
Signal.
Microprocessor includes PWM (Pulse Width Modulation:Pulse width modulation) module, SPI (Serial
Control Interface:Serial Peripheral Interface (SPI)) interface and DMA (Direct Memory Access:Direct memory is visited
Ask) controller.
Microprocessor 1 carries out parameter setting to PWM module, SPI interface and dma controller 3 etc., so that follow-up ADC
When (Analog-to-Digital Control analog-digital converters 2) gathers sampled data, microprocessor need not be to sampling
Journey is controlled.The technique effect of the treatment effect of lifting microprocessor 1 is reached.
After the completion of the operation of microprocessor Initialize installation, microprocessor 1 generates the hardware logic signal related to ADC samplings.
Meanwhile, select corresponding PWM passages output hardware logical signal.Because the present invention has been carried out to PWM module by microprocessor
Initialize installation is operated, so, when PWM passage output hardware logical signal of the present invention by selection, the hardware of output is patrolled
Collect the demand that the output frequency of signal, dutycycle meet setting.Therefore, reached microprocessor 1 without entering to sampling process
The technique effect of row control.
After analog-digital converter 2 receives hardware logic signal, start the collection of sampled data, and adopting collection
Sample data are transmitted to dma controller 3 by SPI interface.
Because microprocessor 1 of the present invention has carried out Initialize installation operation to SPI interface, so, transmitted by SPI interface
Sampled data is satisfactory to the DMA sampled datas controlled, has reached and has been further ensured that sampling process does not need micro- place
The technique effect that reason device 1 is controlled.
When the buffering area of dma controller 3 is filled with sampled data, the generation interrupt signal of dma controller 3, DMA interrupts this
Signal is sent to microprocessor 1, and microprocessor 1 is received after the interrupt signal, receives the sampled data that dma controller 3 is sent.
Microprocessor 1 is finished receiving after the sampled data of the transmission of dma controller 3, and analysis calculating is carried out to the sampled data
Processing operation.
The present invention is carried out after Initialize installation by microprocessor, is started the collection sampled data of analog-digital converter 2, is reached
The technique effect that sampling process need not be controlled.Meanwhile, microprocessor 1 of the invention is that analog signal can be achieved
High-speed sampling, has reached that with low cost, system construction simplifies the technique effect low with design difficulty.
Embodiment 7
Referring to Fig. 7, Fig. 7 is the high-level schematic functional block diagram of microprocessor embodiment 7 in analog signal sampling system of the present invention.
In embodiment 7, the structure with above-described embodiment 6 is essentially identical, and difference is, the microprocessor 1 is wrapped
Include acquisition module 10, background processing module 12, PWM module 11, background communication module 14 and judge module 13.
The acquisition module 10, the time sequence parameter for obtaining the analog-digital converter.
The acquisition module 10 of microprocessor obtains the time sequence parameter of analog-digital converter, and the parameter is sent to micro- place
Manage the background processing module 12 of device.
The background processing module 12, for set according to the time sequence parameter PWM module 11 output frequency and
Dutycycle, is additionally operable to set the parameter of the SPI interface, is additionally operable to set the size of the buffering area of the dma controller, and
Produce hardware logic signal and selection PWM passages.
The background processing module 12 of microprocessor 1 sets the output frequency and duty of PWM module 11 according to the time sequence parameter
Than so that the hardware logic signal of microprocessor generation through PWM passages when export, its output frequency and dutycycle are defeated with setting
Go out frequency consistent with dutycycle.
The background processing module 12 of microprocessor 1 is also provided with the parameter of SPI interface, so that exported by SPI interface
Hits is the sampled data for meeting sampling request.
The background processing module 12 of microprocessor 1 is also provided with the size of the buffering area of dma controller, so that by default
A period of time after, the sampled data that microprocessor is sent to dma controller is analyzed and processed, and has reached raising microprocessor
Treatment effeciency technique effect.
The background communication module 14, for sending the hardware logic signal to analog-digital converter.
The generation hardware logic signal of background processing module 12 of microprocessor 1, and it is different to select different PWM passages to export
Hardware logic signal to analog-digital converter.
The judge module 13, for according to the sampled data judge the PWM module 11 whether normal work and
The analog-digital converter whether normal acquisition sampled data.
The judge module 13 of microprocessor 1 is carried out in analysis calculation processes to the sampled data of dma controller, can be with
According to sampled data judge PWM module 11 whether normal work and the analog-digital converter whether normal acquisition hits
According to.
Further, the background processing module 12 includes clock generating unit 121, sampled signal generation unit
122nd, channel switching signal generation unit 123 and PWM channel selection units 124.
The clock generating unit 121, for generating clock signal.
The sampled signal generation unit 122, for generating sampled signal.
The channel switching signal generation unit 123, for generating channel switching signal.
The PWM channel selection units 124, for selecting PWM according to clock signal, sampled signal or channel switching signal
Passage.
The clock generating unit 121 of background processing module 12 generates clock signal.
The sampled signal generation unit 122 of background processing module 12 generates sampled signal.
The channel switching signal generation unit 123 of background processing module 12 generates channel switching signal.
The PWM channel selection units 124 of background processing module 12 select different PWM passages export respectively clock signal,
Sampled signal and channel switching signal.
Embodiment 8
Referring to Fig. 8, Fig. 8 is the functional module of analog-digital converter embodiment 8 in analog signal sampling system of the present invention
Schematic diagram.
In embodiment 8, the structure with above-described embodiment 6 is essentially identical, and difference is, the Analog-digital Converter
Device 2 includes analog-digital converter processing module 21, analog-digital converter communication module 22.
The analog-digital converter processing module 21, for gathering hits according to the clock signal and the sampled signal
According to.
The analog-digital converter communication module 22, for receiving the clock signal, the sampled signal and described logical
Road switching signal, and for sending the sampled data to the dma controller.
Analog-digital converter communication module 22 receives clock signal, sampled signal and the passage switching letter that microprocessor is sent
Number.
The analog-digital converter processing module 21 of analog-digital converter 2 is received after clock signal and sampled signal, is started
The collection of sampled data.
After gathered data is collected, analog-digital converter processing module 21 carries out sampled data according to channel switching signal
Transmission.
Analog-digital converter communication module 22 sends gathered data to dma controller by SPI interface.
Embodiment 9
Referring to Fig. 9, Fig. 9 is the functional module of analog-digital converter embodiment 9 in analog signal sampling system of the present invention
Schematic diagram.
In embodiment 9, the structure with above-described embodiment 6 is essentially identical, and difference is, the dma controller 3 is wrapped
Include dma controller processing module 31 and dma controller communication module 32.
The dma controller processing module 31, for the sampled data to be stored to buffering area, and in generation
Break signal.
The dma controller communication module 32, for receiving the sampled data, and sends interrupt signal to microprocessor
Device.
Dma controller communication module 32 receives the sampled data that analog-digital converter is sent, dma controller processing module
31 store sampled data into buffering area.
When being filled with the sampled data in buffering area, the generation interrupt signal of dma controller processing module 31.
Dma controller communication module 32 sends the interrupt signal to microprocessor.
Sampled data in microcomputer reads buffering area, and analysis calculating processing is carried out to the sampled data.
The embodiment to invention is described in detail above, but it is only used as example, and the present invention is not intended to limit
With specific embodiments described above.For a person skilled in the art, any equivalent modifications carried out to the invention
Or substitute also all among scope of the invention, therefore, the equalization made in the case where not departing from the spirit and principles in the present invention scope
Conversion and modification, improvement etc., all should be contained within the scope of the invention.
Claims (8)
1. a kind of analog signal method of sampling, it is characterised in that it comprises the following steps:
Microprocessor carries out Initialize installation;
The microprocessor produces hardware logic signal, and selects PWM passage output hardware logical signals;
Analog-digital converter is received after the hardware logic signal, and the analog-digital converter gathers sampled data, and
The sampled data is sent to dma controller by SPI interface;
When the buffering area of the dma controller is filled with the sampled data, the dma controller produces interrupt signal, and by institute
State interrupt signal and the sampling data transmitting delivers to the microprocessor;
The microprocessor carries out analysis calculating processing to the sampled data;
The step of microprocessor carries out Initialize installation, including:
The microprocessor obtains the time sequence parameter of the analog-digital converter, and sets described micro- according to the time sequence parameter
The output frequency and dutycycle of the PWM module of processor;
The microprocessor sets the parameter of the SPI interface;
The microprocessor sets the size of the buffering area of the dma controller.
2. the analog signal method of sampling according to claim 1, it is characterised in that the microprocessor produces hardware logic
Signal, and the step of select PWM passage output hardware logical signals, including:
The microprocessor produces clock signal, sampled signal and channel switching signal;
The microprocessor selects the different PWM passages, and the output frequency according to setting and the duty score
The clock signal, the sampled signal and the channel switching signal are not exported.
3. the analog signal method of sampling according to claim 2, it is characterised in that the analog-digital converter is received
After the hardware logic signal, the analog-digital converter gathers sampled data, and the sampled data is passed through into SPI interface
The step of sending to dma controller, including:
The analog-digital converter receive by the clock signal of different PWM passages transmission, the sampled signal and
The channel switching signal;
The analog-digital converter gathers the sampled data according to the clock signal and the sampled signal;
The analog-digital converter according to the channel switching signal by the sampled data by the SPI interface send to
The dma controller.
4. the analog signal method of sampling according to claim 1, it is characterised in that the microprocessor is to the hits
The step of handling is calculated according to analysis is carried out, including:
The microprocessor according to the sampled data judge the microprocessor PWM module whether normal work;
The microprocessor according to the sampled data judge the analog-digital converter whether normal acquisition sampled data.
5. a kind of analog signal sampling system, it is characterised in that it includes microprocessor, analog-digital converter, DMA controls
Device, the microprocessor is connected with the analog-digital converter by PWM tunneling traffics, the analog-digital converter and institute
State dma controller to communicate to connect by SPI interface, communicated to connect between the microprocessor and the dma controller, it is described micro-
Processor be used for Initialize installation, be additionally operable to produce hardware logic signal and select PWM passage output hardware logical signals and
Analysis calculating processing is carried out to sampled data;The analog-digital converter is used to gather sampled data;The dma controller is used
In storage sampled data and generation interrupt signal;
The microprocessor includes acquisition module, background processing module, PWM module, background communication module and judge module;
The acquisition module, the time sequence parameter for obtaining the analog-digital converter;
The background processing module, output frequency and dutycycle for setting the PWM module according to the time sequence parameter, also
Parameter for setting the SPI interface, is additionally operable to set the size of the buffering area of the dma controller, and produce hardware
Logical signal and selection PWM passages;
The background communication module, for sending the hardware logic signal to analog-digital converter;
The judge module, for according to the sampled data judge the PWM module whether normal work and the simulation
Digital quantizer whether normal acquisition sampled data.
6. analog signal sampling system according to claim 5, it is characterised in that the background processing module includes clock
Signal generation unit, sampled signal generation unit, channel switching signal generation unit and PWM channel selection units;
The clock generating unit, for generating clock signal;
The sampled signal generation unit, for generating sampled signal;
The channel switching signal generation unit, for generating channel switching signal;
The PWM channel selection units, for selecting PWM passages according to clock signal, sampled signal or channel switching signal.
7. analog signal sampling system according to claim 6, it is characterised in that the analog-digital converter includes mould
Number converter processing module, analog-digital converter communication module;
The analog-digital converter processing module, for gathering sampled data according to the clock signal and the sampled signal;
The analog-digital converter communication module, for receiving the clock signal, the sampled signal and passage switching
Signal, and for sending the sampled data to the dma controller.
8. analog signal sampling system according to claim 5, it is characterised in that the dma controller is controlled including DMA
Device processing module and dma controller communication module;
The dma controller processing module, letter is interrupted for the sampled data to be stored to buffering area, and for producing
Number;
The dma controller communication module, for receiving the sampled data, and sends interrupt signal to microprocessor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410800121.4A CN104570858B (en) | 2014-12-19 | 2014-12-19 | The analog signal method of sampling and sampling system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410800121.4A CN104570858B (en) | 2014-12-19 | 2014-12-19 | The analog signal method of sampling and sampling system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104570858A CN104570858A (en) | 2015-04-29 |
CN104570858B true CN104570858B (en) | 2017-08-29 |
Family
ID=53087211
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410800121.4A Active CN104570858B (en) | 2014-12-19 | 2014-12-19 | The analog signal method of sampling and sampling system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104570858B (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016183829A1 (en) * | 2015-05-20 | 2016-11-24 | 深圳怡化电脑股份有限公司 | Multiple-channel analog sensor-based sampling method and apparatus, and currency switcher |
CN107437943B (en) * | 2016-05-28 | 2021-08-31 | 深圳市京泉华科技股份有限公司 | Analog-to-digital converter sampling system and analog-to-digital converter sampling method |
CN108375756A (en) * | 2018-01-09 | 2018-08-07 | 山东省科学院自动化研究所 | A kind of direct sampling system of pulse radar radio frequency and method based on switch arrays |
CN109739782B (en) * | 2018-12-27 | 2020-10-30 | 国电南瑞科技股份有限公司 | Continuous sampling method |
CN112650049B (en) * | 2019-10-11 | 2023-01-20 | 博世华域转向系统有限公司 | System and method for signal acquisition and control output of electric power steering motor |
CN111786865B (en) * | 2020-06-09 | 2021-11-12 | 青岛信芯微电子科技股份有限公司 | Data processing method and equipment |
CN111988417B (en) * | 2020-08-28 | 2022-07-19 | 电子科技大学 | Communication control method of terminal of Internet of things |
CN112040601B (en) * | 2020-09-03 | 2023-04-07 | 广州彩熠灯光股份有限公司 | Lamp dot matrix control device and method and LED stage lamp |
CN112946355A (en) * | 2021-02-25 | 2021-06-11 | 云谷技术(珠海)有限公司 | Power distribution terminal PWM analog sampling system and method |
CN113031761B (en) * | 2021-03-05 | 2023-06-23 | 西北工业大学 | Multi-sensing data high-speed synchronous sampling method of data glove |
CN113114254B (en) * | 2021-05-18 | 2022-08-26 | 天津凯发电气股份有限公司 | High-speed multi-channel synchronous analog quantity acquisition control method |
CN113253651B (en) * | 2021-05-20 | 2022-08-16 | 广州大学 | Dynamic oversampling method and circuit for electrochemical signal acquisition |
CN113835465B (en) * | 2021-09-28 | 2024-02-02 | 北京维普无限智能技术有限公司 | System and method for generating PWM (pulse Width modulation) signals and corresponding electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN2678250Y (en) * | 2004-01-09 | 2005-02-09 | 李剑 | PWM controller using DMA technology |
CN1746838A (en) * | 2005-10-17 | 2006-03-15 | 张金贵 | Sampling method and system for multi-channel analog signal |
US8072180B1 (en) * | 2002-12-03 | 2011-12-06 | Deka Products Limited Partnership | Synchronous sampling of PWM waveforms |
CN102495132A (en) * | 2011-12-13 | 2012-06-13 | 东北大学 | Multi-channel data acquisition device for submarine pipeline magnetic flux leakage internal detector |
CN102664578A (en) * | 2012-04-20 | 2012-09-12 | 电子科技大学 | Distributed control system of diesel generators |
CN103278203A (en) * | 2013-04-25 | 2013-09-04 | 合肥工业大学 | High frequency Coriolis mass flowmeter digital signal processing system |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7696912B2 (en) * | 2008-05-02 | 2010-04-13 | Exar Corporation | Interrupt based multiplexed current limit circuit |
CN101645054B (en) * | 2009-08-25 | 2011-07-13 | 中兴通讯股份有限公司 | Data acquisition card, extension control system and method thereof |
CN101672700A (en) * | 2009-09-27 | 2010-03-17 | 上海华魏光纤传感技术有限公司 | Distributed temperature measuring A/D acquisition card based on FPGA and acquisition method thereof |
US8502721B2 (en) * | 2009-12-02 | 2013-08-06 | Scaleo Chip | Apparatus and methods thereof for reducing energy consumption for PWM controlled integrated circuits in vehicles |
CN102694997A (en) * | 2011-03-24 | 2012-09-26 | 张天飞 | Design of general data collection and transmission board based on FPGA and camera link protocol-based interface |
CN102736541B (en) * | 2012-06-19 | 2015-01-07 | 北京航空航天大学 | Device for acquiring rocket-borne data of solid-liquid power sounding rocket |
US9047270B2 (en) * | 2013-01-18 | 2015-06-02 | Freescale Semiconductor Inc. | DMA-assisted irregular sampling sequences |
CN103744334A (en) * | 2014-01-22 | 2014-04-23 | 浪潮电子信息产业股份有限公司 | Data acquisition system based on field programmable gate array chip and Ethernet |
-
2014
- 2014-12-19 CN CN201410800121.4A patent/CN104570858B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8072180B1 (en) * | 2002-12-03 | 2011-12-06 | Deka Products Limited Partnership | Synchronous sampling of PWM waveforms |
CN2678250Y (en) * | 2004-01-09 | 2005-02-09 | 李剑 | PWM controller using DMA technology |
CN1746838A (en) * | 2005-10-17 | 2006-03-15 | 张金贵 | Sampling method and system for multi-channel analog signal |
CN102495132A (en) * | 2011-12-13 | 2012-06-13 | 东北大学 | Multi-channel data acquisition device for submarine pipeline magnetic flux leakage internal detector |
CN102664578A (en) * | 2012-04-20 | 2012-09-12 | 电子科技大学 | Distributed control system of diesel generators |
CN103278203A (en) * | 2013-04-25 | 2013-09-04 | 合肥工业大学 | High frequency Coriolis mass flowmeter digital signal processing system |
Non-Patent Citations (2)
Title |
---|
一种基于PWM原理的多路信号发生器;王小立;《电力系统保护与控制》;20070501;第35卷(第9期);全文 * |
微机控制系统中PWM的实现;张运波;《电工技术》;20021231(第8期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN104570858A (en) | 2015-04-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104570858B (en) | The analog signal method of sampling and sampling system | |
CN103136447B (en) | Implementation method based on the medical system embedding wireless communication module | |
CN105223944A (en) | The vehicle data acquisition equipment of a kind of adaptive OBD II interface and the multiple automobile bus of self-adaptation and diagnosing protocol | |
CN103955205B (en) | The remote debugging system and method for a kind of electric life controller | |
CN106354124A (en) | Self diagnosis system and method based on channels of FPGA analog input device | |
CN110930689A (en) | Road condition data dynamic acquisition method and device based on automobile data recorder | |
CN103207571B (en) | Encoder signal simulation system and method applied to simulator of loading and unloading machine | |
CN110332646A (en) | The control method of mobile air purifier and mobile air cleaner equipment | |
CN105975758A (en) | Remote auxiliary system terminal of medical device | |
CN108809822A (en) | gateway | |
CN107678549A (en) | The control method and system of smart machine | |
CN103784125A (en) | One-to-many wireless data collection and communication method for monitoring physiological parameters | |
CN110478911A (en) | The unmanned method of intelligent game vehicle and intelligent vehicle, equipment based on machine learning | |
CN105337380B (en) | A kind of control method of wireless charging, device and wireless powering device | |
CN104079567A (en) | Protocol converter, protocol conversion method and elevator remote monitoring system | |
CN104616467B (en) | A kind of braking energy recovery system for electric vehicle collecting method | |
CN104352215B (en) | Wireless fetus central monitoring method and system | |
CN110297457A (en) | A kind of human-computer interaction interface automatic control system for sewage disposal device | |
CN104484990A (en) | Communication device and environmental parameter monitoring system | |
CN203314990U (en) | Control system for medical scanning equipment | |
CN206584348U (en) | Vehicle driver driving efficiency is taken an examination or training information processing unit | |
CN104808153B (en) | Inverter charger communication failure detection device in track traffic | |
CN210038543U (en) | Special vehicle adopting control system for special vehicle | |
CN105342630B (en) | A kind of X-ray production apparatus pulse perspective method for controlling frequency conversion based on embedded software | |
CN201752509U (en) | Intelligent freshener releaser |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |