Intel® FPGA University Program
University Program Material, Education Boards, and Laboratory Exercises
1174 Discussions

Can de0-nano work with high speed ADC (such as AD9283)?

Altera_Forum
Honored Contributor II
2,298 Views

Dear Community, 

I'm working in a wind meter based in DE0-NANO development board and NIOS II. Here's a basic block diagram of project: 

 

ultrasonic signal 1 (total length of 1000 us) -> ad converter (ad7478) sampling at 1 msps -> nios ii -> cross correlation of these two signals -> send the result to pc 

ultrasonic signal 2 (total length of 1000 us) -> ad converter (ad7478) sampling at 1 msps ->  

 

The problem is, sampling at 1 MSPS is not enough for my research project (after several prototypes, I concluded this). Some of its premises is that I must get wind measurement through cross correlation and that I must use DE0-NANO board. Therefore, sampling rate must be increased. 

 

So, I began some tests with ad9283 adc to increase sampling rate. I tried to sample at 20 MSPS and considering the signal has a length of 1000 us, this will give me 20 000 samples. 

 

The approach I did was to use interruption so whenever the clock's edge of AD9283 is rising, then an interruption occurs and it's time to gather ADC's data. 

 

Unfortunately, this approach didn't work. I believe that since NIOS's clock is 50MHz and AD's clock is 20MHz, NIOS is unable to process the interruptions. I could increase NIOS clock, but I have a limitation of the SDRAM's clock I'm using (I'm using SDRAM Controller IP because of SDRAM of DE0-NANO). 

 

Therefore, I'd like to ask for help of the experts of community whether I'm making mistakes as well as to know whether DE0-NANO is capable of working with high speed ADC, such as AD9283. 

 

Kind Regards, 

Tiago
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
626 Views

The DE0-nano will work fine with this ADC. 

 

Your attempts to use the NIOS II to process the data in real-time might be futile however. 

 

If you only need to process pulse data, then you should write some HDL to "trigger", eg., then the input is above some thresholds, write a snapshot of the data to RAM, and then process that snapshot with the NIOS II. If you have to process the data continuously, then you will need to write some HDL to do that. 

 

Go and read about the SignalTap II logic analyzer. Capture a trace of samples from the ADC using the logic analyzer. Then think a little more about what you need to do. 

 

There are SignalTap II logic analyzer trace examples for the DE0-nano here ... 

 

https://www.ovro.caltech.edu/~dwh/correlator/pdf/esc-104paper_hawkins.pdf 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
626 Views

As Dave said, real-time processing 20MSPS with NIOS is not practical (it can't do anything in a single clock, and your algorithm/filter would have to be trivial even at Fmax for your FPGA). 

 

Although the SDRAM has ample bandwidth for what you would like to do, you also have 600kbit of FPGA onchip RAM capable of holding the entire window and which you may find more straightforward to deal with. 

e.g. dual-port RAM or FIFO, with one side being written by the ADC.
0 Kudos
Altera_Forum
Honored Contributor II
626 Views

dear dave, 

Thank you for your feedback. I have to confess that I've never used Signal Tap. I did a fast analysis on your manuscript and downloaded the zip file of esc-104. I'll study this since you used de0-nano. 

 

Regarding your suggestion, actually my approach was to sample a reference signal (signal 1) then a delayed signal (signal 2). After cross correlating both signals, the result will give me the difference of time between the pulsed ultrasonic signal. 

 

When there's no wind, it's expected to measure a fixed delay. However, when there's wind, the delay will be changed. When the wind is around 1 to 2m/s for example, this delay increases/decreases of about some nano seconds. That's the change of time I need to measure, since this measurement will end in the wind measurement. 

 

Therefore, I'll study to write a vhdl code where a counter starts at the moment I excite an ultrasonic sensor. In parallel, there would be another vhdl code tto read ADC then, after the data gathered is over a trigger, then this counter stops. In this case, I would not be using cross correlation algorithm. 

In every case, I'll study Signal Tap to check what this tool can help me. 

 

dear ted, 

Thank you for your feedback. I was thinking about your suggestion and the thing is: Can I use FIFO (from megawizard) with a clock of 20 MSPS? If yes, then I would gather ADC's data in a sample rate I need. However, once the data is in FIFO, Can I read the data in a lower rate? For example, at a 1 MSPS? 

 

Kind Regards, 

Tiago
0 Kudos
Altera_Forum
Honored Contributor II
626 Views

 

--- Quote Start ---  

 

Regarding your suggestion, actually my approach was to sample a reference signal (signal 1) then a delayed signal (signal 2). After cross correlating both signals, the result will give me the difference of time between the pulsed ultrasonic signal. 

 

When there's no wind, it's expected to measure a fixed delay. However, when there's wind, the delay will be changed. When the wind is around 1 to 2m/s for example, this delay increases/decreases of about some nano seconds. That's the change of time I need to measure, since this measurement will end in the wind measurement. 

 

Therefore, I'll study to write a vhdl code where a counter starts at the moment I excite an ultrasonic sensor. In parallel, there would be another vhdl code tto read ADC then, after the data gathered is over a trigger, then this counter stops. In this case, I would not be using cross correlation algorithm. 

In every case, I'll study Signal Tap to check what this tool can help me. 

 

--- Quote End ---  

 

Do you get to control the ultrasonic source and signal? Since you indicate you plan on sampling both a reference source and the echos, I would guess not. 

 

Your transmit pulse will have a much higher amplitude than your echo, so you will need to make sure you have the gains between the two channels set correctly. 

 

What do the response echos look like? If they are noisy or have multi-path signals, you may require some additional signal processing. 

 

How were you planning on cross-correlating the signals? Using lag correlation, or FFTs? 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
626 Views

 

--- Quote Start ---  

Can I use FIFO (from megawizard) with a clock of 20 MSPS? If yes, then I would gather ADC's data in a sample rate I need. However, once the data is in FIFO, Can I read the data in a lower rate? For example, at a 1 MSPS? 

 

--- Quote End ---  

 

 

Yes, 20MSPS writing and 1MSPS reading is no problem, assuming you keep your FIFO deep enough to not overflow. For starters, I'd set the FIFO deep enough to fully contain your entire sampling window. You can work to shrink it (if needed) after you get things basically working.
0 Kudos
Altera_Forum
Honored Contributor II
626 Views

Dear Dave, please take a look at my comments bellow. 

 

 

--- Quote Start ---  

Do you get to control the ultrasonic source and signal? Since you indicate you plan on sampling both a reference source and the echos, I would guess not. 

 

--- Quote End ---  

 

I guess I have control over the process of exciting the ultrasonic sensor as well as receiving its signal. Take a look at the following picture with the signals I captured.https://www.alteraforum.com/forum/attachment.php?attachmentid=9670  

In this case, sampling rate is 909 KSPS, which means one sample at 1.1 us. 

 

 

--- Quote Start ---  

 

Your transmit pulse will have a much higher amplitude than your echo, so you will need to make sure you have the gains between the two channels set correctly. 

 

--- Quote End ---  

 

That's right. I designed a pcb in order to tune the gains required to obtain the previous signals. The pcb I designed is shown in picture placa pronta.https://www.alteraforum.com/forum/attachment.php?attachmentid=9671  

 

 

--- Quote Start ---  

 

What do the response echos look like? If they are noisy or have multi-path signals, you may require some additional signal processing. 

 

--- Quote End ---  

 

Take a look at the signals picture. Could you tell me which signal processing you're thinking? 

 

 

--- Quote Start ---  

 

How were you planning on cross-correlating the signals? Using lag correlation, or FFTs? 

 

Cheers, 

Dave 

 

--- Quote End ---  

 

 

I guess I'm using lag approach. After studying this book, http://www.ece.rutgers.edu/~orfanidi/osp2e/osp2e.pdf (http://www.ece.rutgers.edu/~orfanidi/osp2e/osp2e.pdf) I implemented in NIOS the following formula (I left in Latex type setting if you don't mind): 

 

\begin{equation}\label{eq:xcorr} 

R_{xy}[k]=\dfrac{1}{N}\sum_{n=0}^{N-1-k}y_{n+k}x_{n} 

\end{equation} 

Where R_{xy} is the correlator function and y and x are the signal's vectors. 

 

I hope all of this helped you to understand better my issue. 

 

Kind Regards, 

Tiago
0 Kudos
Altera_Forum
Honored Contributor II
626 Views

Thank you Ted. 

I'll study FIFO approach. 

 

Dear Dave, 

I posted a reply to your feedback but it's waiting for moderator to approve. 

 

Kind Regards, 

Tiago
0 Kudos
Altera_Forum
Honored Contributor II
626 Views

Dear Ted. 

Fifo approach worked fine. Besides using FiFo from Megawizard, I needed to create a state machine to control fifo. I used Volnei Pedroni's book as a reference. 

 

I noticed that the depth of FiFo from Megaqizard has some values predefined, so I have some questions: 

1) Is it possible to change the predefined values? 

2) Is there any design template of designing a FiFo using some kind of HDL? 

 

Kind Regards, 

Tiago
0 Kudos
Altera_Forum
Honored Contributor II
626 Views

Hi Tiago, 

 

Have you implemented a simulation of your signal processing in MATLAB (or Octave)? If you have not, I would recommend it. That simulation would help you describe what you are trying to do to others. 

 

For example, if you are performing a lag correlation, then you will be correlating the echo against "something". What is that "something"? If you were pulse compressing each sensor signal, then you could correlate the receiver echos against a copy of the transmitted signal, or a phase-only function (with uniform amplitude). There's lots of different options, and a simulation will help determine what to expect for each option. There's no need to over-analyze the signals to determine which is best. You're better off to get something working and then fine tune it. 

 

Have you analyzed the bit-growth of your correlation. For example, an FM chirp (used in sonar and radar) increases its signal-to-noise by the time-bandwidth of the chirp. That means your pulse compression logic needs to have a sufficient bit-width to support the bit-growth due to pulse compression. 

 

Cheers, 

Dave
0 Kudos
Reply