|
| View previous topic :: View next topic |
| Author |
Message |
David16
Joined: 04 Jul 2010 Posts: 7
|
Posted: Sun Jul 04, 2010 7:45 pm Post subject: AdcStream/DacStream problem |
|
|
Hi,
I am new to the Quixote, and I met some problems for the AdcStream and DacStream.
I was studying the examples of Quixote provided by Innovative Integration. There were some special functions in the codes but I could not find the definition for them. I tried to find some information from the head files of the project, the online help for Malibu as well as the downloaded documents(Quixote-Malibu.pdf, Malibu.pdf, etc). However, there was no related description. As a result, it is very hard for me to write my own applications.
One example is the example "AEcho". In this project, some functions such as Ain.Get(), Aout. Put() and Splitter.Extract() are employed. However, we cannot find the definition for these functions. As a result, I do not know clearly how to use them.
Could you tell me where I can find some related information or send me some references related to these functions.
Thank you. |
|
| Back to top |
|
 |
jhenderson Site Admin
Joined: 07 Mar 2006 Posts: 1177 Location: So. Cal. USA
|
Posted: Mon Jul 05, 2010 7:09 pm Post subject: |
|
|
The functions to which you refer are contained in the Pismo target libraries - they are part of the host Malibu libraries. Malibu code runs on the PC under Windows or Linux, whereas Pismo applications run on the target DSP under Dsp/BIOS.
Refer to the Quixote software manual, Quixote-Malibu.pdf (starting at pg 54) and the Pismo help file, QuixotePismo.chm for details on target-side software development. Also, be sure to read the documentation supplied by TI on Dsp/BIOS, upon which many of the classes within Pismo are built. |
|
| Back to top |
|
 |
David16
Joined: 04 Jul 2010 Posts: 7
|
Posted: Thu Jul 08, 2010 12:22 pm Post subject: |
|
|
Thank you very much for your reply.
We still have some problems about some functions in the Pismo lib after reading the files:
1. What is the difference between the function "put" and the function "PlayDefaultImage"? As mentioned in QuixotePismo.chm, "PlayDefaultImage" works on a default buffer while "put" can work on an assigned buffer. However, we are thinking what will be the other difference between these two functions. We did some tests with these two functions based on the example "AEcho". The change of the codes is shown as following:
void Execute()
{
while (!Terminated())
{
FCount = 0;
Starting.Acquire();
int ChannelCount = Ain.Device().Channels().ActiveChannels();
AnalysisBuffer.Resize(Ain.Events());
ScaleFactor.Resize(Ain.Events());
ScaleFactor.Set(-0.1f);
Splitter.Phase(0).Channels(ChannelCount).Bits(HardwareInfo()->AdcBits());
// echo input to output
while(Looping)
{
volatile float * Wug = AnalysisBuffer.Addr();
Ain.Get();
short * Waveform = Aout.Buffer().ShortAddr();
float Pi = 4.0 * std::atan(1.0);
for (int i= 0; i<1000; ++i)
{
int sample = std::sin(2.0*Pi*(float)i /100)*5000;
for (int ch=0;ch<2;++ch)
*Waveform++=Sample;
}
//Aout.Put(Aout.Buffer());
Aout.PlayDefaultImage();
++FCount;
}
Stopping.Release();
}
}
Here we assume that the sample rate is 100 KHz and two DAC are enabled. When we used the "put" method, the wave presented in the oscillograph was discontinuous。 However, the "PlayDefaultImage" method could give continuous waves.
2. We met another problem when we were running the above adjusted codes. We loaded the .out file to the DSP using the RTDX Terminal provided by Innovative Integration. When we used the "Aout.put()" method, the program was usually ended and restarted by itself. Could you tell us the potential reasons for this phenomenon and how to solve it?
3。Another problem is how to record the signals received by the ADC using “Get” method. If we want to save the obtained signals for further processing, how can we achieve it?
Thanks in advance. |
|
| Back to top |
|
 |
jhenderson Site Admin
Joined: 07 Mar 2006 Posts: 1177 Location: So. Cal. USA
|
Posted: Thu Jul 08, 2010 12:56 pm Post subject: |
|
|
| Quote: | | 1. What is the difference between the function "put" and the function "PlayDefaultImage"? |
The Pismo Stream drivers use EDMA to automate data movement between a memory buffer and the D/A hardware. The D/A hardware consumes data at the sample rate and it is the responsibility of the application software to provide a buffer for playback before all previous buffers have been consumed. If the Stream exhausts all available buffers before another is provided by the application, the stream will play the contents of the default image buffer.
Pismo provides a means of changing the contents of the default image buffer, allowing exploitation of this driver characteristic. For example in some applications, it is desireable to play a single waveform continuously. By loading this waveform into the default image buffer, the waveform can be played indefinitely without further application involvement.
| Quote: | | When we used the "put" method, the wave presented in the oscillograph was discontinuous。 However, the "PlayDefaultImage" method could give continuous waves. |
Your application code is not calculating the contents of each buffer submitted to the Stream driver fast enough to meet the real-time consumption rate of the D/A. At rates in the MHz range, the DSP cannot be expected to satisfy the required data rate. The solution is to embed the waveform generation algorithm within the onboard FPGA.
| Quote: | We met another problem when we were running the above adjusted codes. We loaded the .out file to the DSP using the RTDX Terminal provided by Innovative Integration. When we used the "Aout.put()" method, the program was usually ended and restarted by itself. Could you tell us the potential reasons for this phenomenon and how to solve it?
|
The information above is insufficient for a definitive diagnosis. But, I suspect that the DSP application crashed. A common cause is that the stack overflowed - you might need to increase the size of the stack.
| Quote: | | Another problem is how to record the signals received by the ADC using “Get” method. If we want to save the obtained signals for further processing, how can we achieve it? |
Following a call to Get(). the Stream buffer contains the newest samples retrieved from the A/D. Copy the contents of this buffer into another buffer or send it to the PCI bus via the PCI driver Put() method.
Again, bear in mind that at the high sample rates of which the onboard analog is capable, you will not be able to sustain capture or processing. This is the domain of an FPGA-based solution. |
|
| Back to top |
|
 |
David16
Joined: 04 Jul 2010 Posts: 7
|
Posted: Fri Jul 16, 2010 7:31 am Post subject: |
|
|
Dear friends,
I am still a little confused with the AdcStream and DacStream. After some study, I still do not know how to make the two ADCs and DACs work separately once they are both enabled.
When we use the command "Aout.Put()", the two DACs will output the same wave saved in the buffer. How can we control the DACs separately? For example, if we want one DAC to output the wave generated by the DSP, another DAC to output the signals received by the ADC, what should we do?
Also for the ADCs, the signals received by the two ADCs are saved in the buffer "Ain.Buffer". If we want to do different processings to the signals received by different ADCs, what should we do? How can we separate the two ADC data streams?
Could you give me some references and examples?
Thank you very much. |
|
| Back to top |
|
 |
jhenderson Site Admin
Joined: 07 Mar 2006 Posts: 1177 Location: So. Cal. USA
|
Posted: Fri Jul 16, 2010 8:30 am Post subject: |
|
|
The data buffers received from the A/Ds via the AdcStream driver and the data sent to the D/As via the DacStream driver contain interleaved data samples for each enabled channel as described at (http://www.iidsp.com/forum/viewtopic.php?t=411&highlight=format).
It is the responsibility of the application software to create the interleaved buffer prior to sending to the D/As, and to extract the data for each channel from the interleaved data set from within buffers received from the A/Ds. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
© Copyright 2006-2008 Innovative Integration
Powered by phpBB © 2001, 2002 phpBB Group
Based on iCGstation v1.0 Template By Ray © 2003, 2004 iOptional
|
|
|