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, have some problems with phase

Status
Not open for further replies.

kirgizz

Member level 2
Joined
Sep 7, 2004
Messages
52
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
644
Hi,

in order to continue my DSP work I'm facing a problem with phase.
In my DSP design based on ADSP21262EVM I generate a sine wave from a sine table. Required quality of the wave is ok, but there is something wrong.

I feed a sine wave with fixed frequency from an external source into DSP. At the same time my internal sine wave is generated with the same frequency. Both signals are led to the analogue output of the board. My digital real-time oscilloscope shows both signals running "against each other": they are not synchronous, the phase between them is NOT constant (need constant phase).

Yes, the reason could be my software algorithm. But what? I tested an another sine oscillator (quadrature coupled sin/cos oscillator) and the result is the same. Apart from the sine oscillator my program contains codec and peripherals configuration routines only, data RX/TX is interrupt driven.
The table-based sine algorithm were tested on Motorola DSP56L307EVM board too: the phase between arrival and generated sine was constant. A hardware problem?


Anyone can give me some advice for possible cause?

Thank you in advance
 

are you doing any phase synchronization with externally fed source?
brmadhukar
 

I can't see how you've set up your project, but if your two signals are derived from different crystal oscillators, then they won't have exactly the same frequency. The frequency accuracy of an ordinary cheap crystal oscillator is 100ppm (0.01 percent).
 

to brmadhukar

The DSP is configured as slave, so the codec delivers serial clock and frame sync sognals. Interrupt occurs when the DSP RX connected to ADC receives the next frame sync from the codec. Then, the next sine value is calculated. The both sine values (input and internally generated) are send at the same time to DSP TX port connected to DAC codec inputs. I think the phase must be constant in this case (ok, there can be a little frequency difference between these sources).



to echo47

I made some changes on the board. There are 2 separate clock oscillators for the DSP and for the codec. I disconnected the DSP osc and connected it's xtal input to the osc which is used by codec. In this way the both use the same 12,288 MHz osc mounted on the board.



Maybe I'm wrong in my thoughts
 

Is the offset fixed or is it varying? If fixed, you can say that the phase synch is not proper and you just have to advance the internal generation.

hope this helps
brmadhukar
 

Thank you brmadhukar,


the offset is fixed.

I realized that two signals coming from two different sources can't be synchronous because of slightly different frequencies. There must be a tuning using techniques such PLL to get them running in-phase.

I converted the input sine wave to TLL and feed it to DSP. It seems to be a problem of measuring. The DSP does measuring TTL signal width and scales it to the table delta. The measured value is not accurate enough so the generated frequency is not equal to the input frequency. As result I can't see any constant phase difference. In my case a frequency difference of 0.01 Hz is critical.

I think about PLL but how can a PLL device tell DSP what frequency the signal running with? Can you follow me?
 

Can you explain your project goals a little more? It sounds like you are inputting a sinewave, converting it to a square wave, measuring its period (imprecisely), and then generating a new sinewave at the measured frequency.

If your input sinewave is available continuously, then how about reading it with an A/D converter, and using its data directly? Or, if you are stuck with that square wave, then design a DSP lowpass filter that converts it to a sinewave.
 

echo47

Thanks, you are right. I have sinewave as the input, convert it to a square wave by external hardware and measure its period by DSP, which then generates a new sinewave at the measured frequency.

The cause for such operation is that I need 2 waves internally: sine and cosine at the same frequency (for quadrature demodulation).
I'd rather use the input sine and additionally make cosine from it in analogue way. Then the both signals will be sampled by ADC. Besides, my design must be able to work with square wave input signals too.

Can you give me some advice which sort of filter can I use to convert square waves to sine/cosine?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top