• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » C5000 Ultra Low Power DSP » C5000 Ultra Low Power DSP Forum » Outputting square wave from C5505/5515 eZDSP
Share
C5000 Ultra Low Power DSP
  • Forum
  • Announcements
Options
  • Subscribe via RSS
Top 6 Wiki Links
  • C5000 Main Wiki
  • C5000 Software
  • C5515 Boot-Image Programmer
  • CSL (including CSL 3.00)
  • C5000 Connected Audio Framework
  • Porting C5000 Teaching ROM to C5535 eZdsp
  • Forums

    Outputting square wave from C5505/5515 eZDSP

    This question is not answered
    Abhishek Seth66998
    Posted by Abhishek Seth66998
    on Feb 15 2011 11:50 AM
    Prodigy160 points

    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

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Mark Mckeown
      Posted by Mark Mckeown
      on Feb 15 2011 14:42 PM
      Genius10200 points

      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
      ---------------------------------------------------------------------------------------------------------

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Abhishek Seth66998
      Posted by Abhishek Seth66998
      on Feb 16 2011 00:46 AM
      Prodigy160 points

      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?

       

      Thanks

      Abhishek

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Abhishek Seth66998
      Posted by Abhishek Seth66998
      on Mar 07 2011 08:04 AM
      Prodigy160 points

      Hi,

      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.

      Thanks

      Abhishek 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Peter Chung
      Posted by Peter Chung
      on Mar 09 2011 10:45 AM
      Expert8075 points

      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.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Timothy Sapio
      Posted by Timothy Sapio
      on Jul 08 2011 20:32 PM
      Intellectual310 points

      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.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Michal Szymanski
      Posted by Michal Szymanski
      on Jul 09 2011 02:49 AM
      Expert1215 points

      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

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Timothy Sapio
      Posted by Timothy Sapio
      on Jul 12 2011 20:02 PM
      Intellectual310 points

      Wonderful! Thank you, Michal

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Long Ngoc
      Posted by Long Ngoc
      on May 08 2012 23:14 PM
      Intellectual285 points

      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.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Long Ngoc
      Posted by Long Ngoc
      on May 09 2012 21:00 PM
      Intellectual285 points

      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.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Long Ngoc
      Posted by Long Ngoc
      on May 11 2012 04:56 AM
      Intellectual285 points

      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

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • MikeH
      Posted by MikeH
      on May 11 2012 06:34 AM
      Guru12685 points

      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;

      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

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Long Ngoc
      Posted by Long Ngoc
      on May 11 2012 07:21 AM
      Intellectual285 points

      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?

      Regards,

      Long

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • MikeH
      Posted by MikeH
      on May 11 2012 07:30 AM
      Guru12685 points

      Long,

      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.

      Thx,

      MikeH

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use