Simple high speed loopback code from ADC to DAC

Applications, development tools, FPGA, C, WEB
Post Reply
gflesch
Posts: 4
Joined: Mon Jan 25, 2016 10:52 pm

Simple high speed loopback code from ADC to DAC

Post by gflesch » Thu Jun 16, 2016 7:54 pm

Hello,

I'm new to RedPitaya and would appreciate any help.
I see so many powerful examples, but I haven't seen anything that simply reads in values from the fast ADC and then immediately sends them out to the fast DAC, like a loopback.
The purpose is to build an gas absorption simulator from that simple loopback code that would read laser control voltages from ADC, do some quick math to simulate absorption and then output a simulated detector response to the DAC.
Are here any examples that let me read/write values one at a time on the fast channels? I'm sure it's possible with slow DAC/ADC, but I need the fast ones.

thanks!

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Simple high speed loopback code from ADC to DAC

Post by Nils Roos » Thu Jun 16, 2016 10:16 pm

Hi,

the PID controller does something very similar, it takes the fast ADC inputs, does some math on the sampled values, and outputs the result on the DAC. All the processing takes place in the FPGA logic, and you can feed parameters into the process.
Are here any examples that let me read/write values one at a time on the fast channels?
If you are asking about C-examples that execute on the ARM cores, I'm afraid there aren't. The reason is that the write-to-DAC-part is not at all easy to implement in a satisfactory fashion. Whether or not it is possible at all to do in software depends on what rate you want to achieve.

gflesch
Posts: 4
Joined: Mon Jan 25, 2016 10:52 pm

Re: Simple high speed loopback code from ADC to DAC

Post by gflesch » Thu Jun 16, 2016 10:40 pm

Thanks, I'll check that out.

As to rates, the idea is to test laser spectrometer control software that outputs a laser control voltage ramp continuously at 100 MS/sec.
Ideally, I would need to be able to read the input voltage, use some math to simulate the gas absorbing the laser light at that voltage (which produces light at some frequency on a laser), and then immediately output the simulated detector response also at continuously at 100 MS/sec.
Sound possible?

I very much appreciate your time and help!

gflesch
Posts: 4
Joined: Mon Jan 25, 2016 10:52 pm

Re: Simple high speed loopback code from ADC to DAC

Post by gflesch » Thu Jun 16, 2016 11:09 pm

Just to clarify, the ADC/DAC rate is 100 MS/sec.
The ramp has 1024 values and is generally from 1 KHz to tens of KHz, depending on modulation schemes.

thanks again.

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Simple high speed loopback code from ADC to DAC

Post by Nils Roos » Thu Jun 16, 2016 11:31 pm

But if I understand you right, you want to sample the control signal and generate the simulated detector signal at close to 100MSps?

At 100MSps the only real option is to do it in the programmable logic. Transferring the samples to the processor cores and back at that rate is simply not possible.

Regarding the transfer function, if you want to simulate time-invariant processes, a lookup table would offer the most flexibility at a constant low latency, independent of the shape of your absorption spectrum. Speaking of latency, minimum input to output latency is around 100ns with the Red Pitaya for a simple passthrough - just so you know what to expect.

gflesch
Posts: 4
Joined: Mon Jan 25, 2016 10:52 pm

Re: Simple high speed loopback code from ADC to DAC

Post by gflesch » Thu Jun 16, 2016 11:41 pm

ok, makes sense.
I'll look into implementing a lookup table in the PL.

thanks much.

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 97 guests