Acquire long signal with DMA on triggered input?

Applications, development tools, FPGA, C, WEB
razh
Posts: 8
Joined: Thu Oct 15, 2015 9:59 am

Acquire long signal with DMA on triggered input?

Post by razh » Fri Oct 16, 2015 1:19 pm

I saw a couple of projects including the ones from Nils and Pavel using DMA to store or transmit measurements of more than 16kSamples in length. However, my project requires the ability to store a long signal (i.a. 32MB as published in the 0.93 release note) upon a trigger input.
I am planning on using Nils' rp_remote_acquire as a first step but it lacks the ability to wait for a trigger to start recording. Is there any functionality in 0.94 or other projects which incorporate DMA to acquire long signals on triggers that I have overlooked or is there no such program yet?

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: Acquire long signal with DMA on triggered input?

Post by pavel » Fri Oct 16, 2015 1:25 pm

Have you seen the following one?
https://github.com/pavel-demin/red-pita ... er_trigger

It records 1M samples by default and can be easily adapted to record 32M samples.

Here is how it can be used:
  1. download the customized SD card image zip file from
    https://googledrive.com/host/0B-t5klOOy ... rigger.zip
  2. copy the content of the SD card image zip file to an SD card
  3. boot Red Pitaya with the new SD card
  4. run the following commands from the Red Pitaya command line:

Code: Select all

# make /opt writable
rw

# record 1M ADC samples
adc-recorder-trigger > /opt/adc-samples.txt

# make /opt read-only
ro

razh
Posts: 8
Joined: Thu Oct 15, 2015 9:59 am

Re: Acquire long signal with DMA on triggered input?

Post by razh » Fri Oct 16, 2015 2:39 pm

I have actually found that yesterday but was a little intimidated by the pointer magic you are using in adc-recorder-trigger.c ;)
Can you tell me what units the trigger mask and the trigger level are in? In the code on github both are simply set to 1.
Also, the number of samples is 1024*1024-1. Is there a special reason you use one less than a power of 2? If I would like to acquire 32*10^6, I can just set it to 32*1024*1024-1, correct?

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: Acquire long signal with DMA on triggered input?

Post by pavel » Fri Oct 16, 2015 3:06 pm

Can you tell me what units the trigger mask and the trigger level are in? In the code on github both are simply set to 1.
This example uses an external trigger arriving to one of the Red Pitaya GPIO connectors (DIO*_P ). So, there is not much choice for the level and mask 1 means that only the first pin (DIO0_P ) is used .
Also, the number of samples is 1024*1024-1. Is there a special reason you use one less than a power of 2? If I would like to acquire 32*10^6, I can just set it to 32*1024*1024-1, correct?
Correct. The counter that counts the samples starts from 0. The number of samples is specified by the the max. value of the counter when it should stop.

razh
Posts: 8
Joined: Thu Oct 15, 2015 9:59 am

Re: Acquire long signal with DMA on triggered input?

Post by razh » Sat Oct 17, 2015 1:00 pm

that's excellent! I will try to setup a crosscompilation environment shortly and modify your adc-recorder-trigger.c.

Is it possible to set the decimation factor within adc-recorder-trigger? It would be quite convenient if the cfg-pointer would allow this.

[edit] going through the block_design.tcl I see that the decimation is currently not implemented. I am trying to merge the feature over from radar_test but so far without success.

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: Acquire long signal with DMA on triggered input?

Post by pavel » Thu Oct 22, 2015 10:30 am

razh wrote:Is it possible to set the decimation factor within adc-recorder-trigger? It would be quite convenient if the cfg-pointer would allow this.

[edit] going through the block_design.tcl I see that the decimation is currently not implemented. I am trying to merge the feature over from radar_test but so far without success.
Yes, it's possible. What is the range of the decimation factors that you are looking for?

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: Acquire long signal with DMA on triggered input?

Post by pavel » Thu Oct 22, 2015 10:36 am

razh wrote:[edit] going through the block_design.tcl I see that the decimation is currently not implemented. I am trying to merge the feature over from radar_test but so far without success.
Actually, the decimation is implemented but the factor is fixed (32). To make it configurable it's indeed possible to copy the rate_0 and cic_0 blocks from radar_test and then connect rate_0 to the configuration register.

razh
Posts: 8
Joined: Thu Oct 15, 2015 9:59 am

Re: Acquire long signal with DMA on triggered input?

Post by razh » Sun Oct 25, 2015 10:44 pm

pavel wrote:
razh wrote:[edit] going through the block_design.tcl I see that the decimation is currently not implemented. I am trying to merge the feature over from radar_test but so far without success.
Actually, the decimation is implemented but the factor is fixed (32). To make it configurable it's indeed possible to copy the rate_0 and cic_0 blocks from radar_test and then connect rate_0 to the configuration register.
That's pretty much what I did so far. However, when compiling this modified version of adc_recorder_trigger or even the original version itself, I get a number of critical warnings about mismatching widths of inputs and bus interface properties. Is this normal?

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: Acquire long signal with DMA on triggered input?

Post by pavel » Mon Oct 26, 2015 12:18 am

razh wrote: That's pretty much what I did so far. However, when compiling this modified version of adc_recorder_trigger or even the original version itself, I get a number of critical warnings about mismatching widths of inputs and bus interface properties. Is this normal?
There are indeed few places where the widths are mismatched. For example, concat_0/In0 and scope_0/sts_data, concat_0/In1 and writer_0/sts_data. All the extra most significant bits are set to low automatically. I don't think that there is anything really critical in these warnings.

razh
Posts: 8
Joined: Thu Oct 15, 2015 9:59 am

Re: Acquire long signal with DMA on triggered input?

Post by razh » Mon Oct 26, 2015 2:20 pm

pavel wrote:
razh wrote: That's pretty much what I did so far. However, when compiling this modified version of adc_recorder_trigger or even the original version itself, I get a number of critical warnings about mismatching widths of inputs and bus interface properties. Is this normal?
There are indeed few places where the widths are mismatched. For example, concat_0/In0 and scope_0/sts_data, concat_0/In1 and writer_0/sts_data. All the extra most significant bits are set to low automatically. I don't think that there is anything really critical in these warnings.
It seems to work fine regardless of the warnings. However, now I am facing a new problem: There seems to be a problem with either the CIC or the FIR or a combination of both when it comes to measuring fast transients such as in the following plots. There is significant overshoot after fast transients as well as sometimes oscillations shortly before fast transients are measured. A proper oscilloscope connected instead of the Red Pitaya doesn't show any of this behavior and the Red Pitaya web app shows only little overshoot which leads me to believe that something in the fpga programming is off. Do you have any idea as to the source?
Image
Image

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 19 guests