Hi,
I want to output a square wave of fundamental frequency 40,000 Hz from C5505/C5515 eZDSP. I am planning to store this square wave in a look up table. I can read this look up table and output the square wave. I know that the reconstruction filter at DAC of TLV320AIC3204 will not allow high frequencies to pass through and will smoothen edges of the square wave. Is there any way I can disable the reconstruction filter or bypass of DAC? Or any other way to do this?
Thanks
Abhishek
Hi Abishek,
Have you tried configuring the codec for a data rate of 192kHz? I would expect a pretty sharp 40 kHz square wave at that data rate/sampling frequency.
The codec also gives the user a lot of control over the signal processing on the DAC. For example, Interpolation Filter C is specifically designed for the 192ksps mode. The pass band extends up to 0.40*Fs (corresponds to 80kHz), more than sufficient for audio applications.
Check out Section 5.11 DAC of the AIC3204 Datasheet
Specific questions about the codec should be posted to the Audio Converters E2E Support Community.
Are you restricted to using the headphone jack with stereo cable as the channel for the square wave? Or can you use a GPIO pin instead - it is easy to make a square wave on GPIO with a timer.
Hope this helps,Mark
---------------------------------------------------------------------------------------------------------Please click the Verify Answer button on this post if it answers your question.
Also see our C5000 Wiki---------------------------------------------------------------------------------------------------------
Hi Mark,
My code runs at 192 KHz and I am using interpolation filter C. As square wave is summation of infinite odd harmonics, 40 KHz square wave is summation of 40 KHz, 120 KHz,..... Interpolation filter will pass only 40 KHz and will block subsequent frequencies. Moreover there is a analog reconstruction filter after filter C. I am therefore very skeptical of getting a sharp square wave without bypassing filter C and analog reconstruction filter.This brings me back to my original question whether I can bypass these filters?
I am not restricted to using head phone jack. Can you explain a bit on outputting a square wave on GPIO with a timer? I know how to output signals to eZDSP GPIO pins. I am not clear about the timer part. Do we have a timer on DSP which can be used for this purpose?
Can I output the bits using GPIO of C5505 at the rate 192,000 bits per second? What is the maximum input/output bit rate supported by C5505 GPIO? Any pointers on this will be useful.
Abhishek,
GPIO can be toggled with max 6.67MHz (60 nsec/cycle) speed at System Clock = 100MHz.
Regards,
Peter Chung
Please click the Verify Answer button on this post if it answers your question.
I have some further questions on outputting square waves if I may. In the MSP 430, there was a timer peripheral which could be set up to send a square wave out to a pin without ALU time (I.e. using the gpio registers in a C for{} loop) Does such a peripheral exist on the TMS320VC5505? To be a bit clearer maybe, I need a way to output a square wave of low frequency (around 120 hz) to a pin on the usb stick WITHOUT slowing down the program that is running on the c5505 microcontroller. Using the AIC audio codec is out because it is otherwise occupied in this application.
Hi Timothy,
sure, you can find 32-bit timers in C5505. If by "square wave" you mean simple digital signal, then solution is very easy. Setup timer prescaler and top value, so timer interrupt would be called every 4.16 msec. In ISR just invert state on certain pin and as result you will get 120 Hz signal.
regards
MS
Wonderful! Thank you, Michal
Hi Michal
Do you know how to output the square wave form but with much higher frequency, at around 25MHz?
I am working with the board TMS320C5515 and trying to read camera sensor data through GPIO but as the clock is in sine wave form, PCLK output from the camera interface also in the sine wave form so I cannot get data properly.
Thank you.
Any idea?
Dear Peter Chung, how can we know that "GPIO can be toggled with max 6.67MHz (60 nsec/cycle) speed at System Clock = 100MHz."?
Could you please show me a way to generate a squared wave form at speed 25MHz, if any?
Thank you very much.
Dear TI employees,
Does anyone have any idea about this? I really need this feature but currently there seems to be no way to output a squared wave signal at 25MHz by coding.
I am being stuck at this point and I am really need your help.
Thank you!
Long
Long,
It's a pity that we can't get any TI support here......
Here is a snippet from the C5515 datasheet (SPRS645E, pg 153) showing that the minimum pulse duration of the GPIO line is "3C", which is 3 times the system clock period. If you have system clock running at 100MHz, then the minimum pulse duration is 3 x (1/100MHz) ~= 30ns. Since this is the minimum "pulse duration", a "square wave" will consume two equal "pulse durations", or 2 x 30ns = 60ns, which is ~ 6.7MHz square wave.
I have verified this with the following code which toggles GPIO6 on my board (note: the code does not initialize the port).
#define SYS_GPIO_DATAOUT0 *(volatile ioport Uint16*)(0x1c0a) SYS_GPIO_DATAOUT0 |= 0x40; SYS_GPIO_DATAOUT0 &= ~0x40; SYS_GPIO_DATAOUT0 |= 0x40; SYS_GPIO_DATAOUT0 &= ~0x40;
#define SYS_GPIO_DATAOUT0 *(volatile ioport Uint16*)(0x1c0a)
SYS_GPIO_DATAOUT0 |= 0x40; SYS_GPIO_DATAOUT0 &= ~0x40; SYS_GPIO_DATAOUT0 |= 0x40; SYS_GPIO_DATAOUT0 &= ~0x40;
Currently I don't see a way to generate a square wave > 6.7MHz with the C5515. Perhaps others can chime in (TI comments welcome).
Thx,
MikeH
Dear MikeH,
I really wonder how come TI ignore these discussions!
Thank you very much for showing me this part! BTW, as your computation then 60ns should be equivalent to 16.7 MHz, right?
Long Ngoc as your computation then 60ns should be equivalent to 16.7 MHz, right?
...arrrrgghh! Yes (time for another cup of coffee).
Another thought. I might not be the best use of a high-power DSP to generate a high speed square wave. Most of the CPU cycles will be dedicated to this function. You might find it more economical to use a seperate, dedicated (cheap) clock generator chip instead of the DSP.