Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me increase the output speed of a DAC converter

Status
Not open for further replies.

gvanto

Member level 1
Member level 1
Joined
Aug 17, 2004
Messages
41
Helped
4
Reputation
8
Reaction score
0
Trophy points
1,286
Activity points
442
I have built a little DAC converter to work on the parrallel port.
I am using Dev-Cpp to output the samples of a cosine wave (see code below) in C++...

The fastest output frequency I can get from the DAC is just under 700 Hertz (ie. the fastest possible 'for' loop I can think of). This is using 255 samples/perdiod - less samples can obviously get a higher frequency output at the expensive of resolution.

This is a little dissapointing as I was hoping to be able to construct frequencies of up to say 20KHz at least.

Im using an 800MHz CPU laptop btw.

Any help/advice on increasing the output speed (can it be done?) would be greatly appreciated. I have heard that using direct memory access (DMA) is faster but I havent got the faintest idea where to begin and whether the increase in speed is significant?

Eventually the idea was/is to implement a digital (audio) filter in software - is this feasible or shall I just not bother?

Help much appreciated,
gvanto

Code:

Code:
int N = 255; //Number of samples/period 
int k; 
double pi = 3.1459; 

while(1) { 
        for(k=0;k<=N;k++) 
        { 
              
             result = 0.5 * cos(2*k*pi/N) + 0.5;  // Halve wave, + add 0.5 DC to get  +ve only 
             value = ceil(result * 255);       
             Out32(BASE_ADDRESS, value); 
           
        } 
      }
 

Real-time help

gvanto , look to the lptscope code. it reads lpt with more than 100 K samples per sec . That is where windows programming knowledge comes to business . I do not see very big difference between reading and writing to lpt port . Dig into its code and see how the port access thread is implemented there . You should somehow raize you task priority within windows to get faster access to port

Regarding lpt max speed in ECP mode it should allow speed of more than 1 megabyte per sec .
 

Real-time help

Dear sir,
I think that with a good C source code you should be capable of sending up to 500k samples/s to your DAC. this is my prev experience and I think that it is possible.
 

Re: Real-time help

Artem,

Thanks but what is this lptcode that you're talking about?

I was hoping to achieve faster rates yes.

Regards,
gvanto
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top