• 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) » OMAP™ Processors » OMAP-L13x, AM1x and C674x Processors Forum » Using McAsp FIFOs on C6747
Share
OMAP™ Processors
  • Forums
  • Announcements
Options
  • Subscribe via RSS
Resources
  • OMAP-L1x DSP+ARM9™-based Processors Product Folder
  • OMAP3525/30 DSP+ARM Cortex™-A8-based SOCs Product Folder

  • Top OMAPL Wiki Links
  • OMAPL3x Schematic Review Checklist
  • OMAPL13x Boot resources

  • OMAPL Document Resources
  • OMAPL137 Technical reference manual
  • OMAPL138 Technical reference manual
  • OMAPL Boot loader App Notes
  • Using McAsp FIFOs on C6747

    Using McAsp FIFOs on C6747

    This question is answered
    John Wilkes
    Posted by John Wilkes
    on Dec 08 2009 09:18 AM
    Intellectual945 points

    Hello,

     

    I’ve been trying to get the write FIFO to work on the McAsp on a OMAP-L137 (from the C6747 core). I have set the WFIFOCTL register (with the WENA bit set last as described in the user guide). Also this is set before the transmitter is taken out of reset.

     

    I then write five times to the XBUF[0] register expecting to have five transmissions. But I only get two. It is as if the writes are not being FIFO’d. Am I writing to the correct register? Or is there some set up I am missing?

     

    Cheers,

     

    John.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Brad Griffis
      Posted by Brad Griffis
      on Dec 08 2009 22:55 PM
      Guru57330 points

      How have you configured XFMT[XBUSEL]?  If you left that value at its default (0) then it will be expecting writes through the DMA port.  See Table 6-45 "McASP Registers Accessed Through DMA Port" in the datasheet for the correct addresses.

      i didn't see any mention of the FIFO handling interrupts.  I think it may have only been designed to work with EDMA events and not interrupts.  I'll double check with the Houston apps team.

      ---------------------------------------------------------------------------------------------------------

      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.
    • John Wilkes
      Posted by John Wilkes
      on Dec 09 2009 03:25 AM
      Intellectual945 points

      Hi Brad,

       

      Thanks for your response.

       

      Yes, I have set the XBUSEL bit. In fact, I can make my five transmissions work correctly if I wait on the XSTAT[XDATA] bit between writes to XBUF[0]. If I remove the waits I get only two transmissions out of the port, obviously (!) because subsequent writes to the XBUF[0] register are occurring before the previous transmission has completed and are being ignored.

       

      Using the wait is not efficient use of CPU time and I was hoping I could get the FIFO to queue up my five transmissions without having to resort to using DMA.

       

      However, with the FIFO supposedly enabled, I get the same behaviour, i.e. only two writes out instead of five – making me believe that either the FIFO is not enabled or XUF[0] is not the correct register to write to.

       

      Cheers,

       

      John.

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Brad Griffis
      Posted by Brad Griffis
      on Dec 09 2009 10:14 AM
      Guru57330 points

      The Houston apps team confirmed that the FIFO was not designed for usage with the CPU.  Looking at Figure 1 of the McASP User Guide shows it well.  You can see that the DMA events are routed to the Audio FIFO and then out, whereas the CPU interrupts do not go to the FIFO.  That means that CPU interrupts are coming directly from the McASP (i.e. there is no knowledge of a FIFO).  This makes it impractical to use the FIFO in a CPU-based setup.

      So I think your choices are:

      1. Setup the FIFO and service it with EDMA.
      2. Don't use the FIFO and service the McASP sample-by-sample with the CPU (interrupt based).

      Brad

      ---------------------------------------------------------------------------------------------------------

      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.
    • John Wilkes
      Posted by John Wilkes
      on Dec 10 2009 04:24 AM
      Verified Answer
      Verified by John Wilkes
      Intellectual945 points

      Hi Brad,

      Thanks again for your response.

      However, I think you need to tell the Houston apps team to have another think as I have managed to get the FIFO working from CPU writes. The problem was, as I suspected, that I was writing to the wrong register. I think that XBUF[0] is the actual transmission register for serialiser 0 and the input to the FIFO is a different register called XBUF or XRBUF (depending on which bit of the user guide you are reading).

      I think that there is a small problem in the document (SPRUFM1) which hinders the understanding of how the FIFOs (and the DMA) write to the McAsp. On page 68 we find table 8 which has a distinct lack of hex addresses in the column labelled ‘Hex Addresses’:

       

      Luckily the OMAP-L137 data sheet (SPRS563c) comes to our rescue here with table 6-47 on page 114:

        

      I’m using McAsp1 so I do my writes to 0x01D06000, not XBUF[0] (which is at 0x01D04200). Also I have to actually reset the XFMT(XBUSEL) bit and it all works as required.

      Incidentally, I think I would have hit the same problem if I had tried to use DMA as this would need to write to the same register. I suggest that the table in SPRUFM1 needs updating to include the addresses.

      Thanks again for your help.

      Cheers,

      John.

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Brad Griffis
      Posted by Brad Griffis
      on Dec 10 2009 16:32 PM
      Guru57330 points

      John,

      There's no issue with the DSP core being capable of writing to the FIFO.  Writing XFMT[XBUSEL]=0 is the correct configuration for using the address at 0x01D06000.  Everyone agrees that the FIFO is physically capable of being written by both EDMA and CPU.  The part where I believe there is an issue is that you will get interrupts on a sample by sample basis and not due to the FIFO theshold being reached.

      So are you getting interrupts based on FIFO threshold, or are you getting interrupts every sample?  I expect that you're getting an interrupt every single sample regardless of FIFO level.

      Brad

      ---------------------------------------------------------------------------------------------------------

      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.
    • John Wilkes
      Posted by John Wilkes
      on Dec 14 2009 02:32 AM
      Intellectual945 points

      Hi Brad,

      I'm not sure since I am not using interrupts. All I need to do at this stage is transmit five words out of the port, so there is no need to enable any interrupt.

      However, at some point in the future I need to configure the McAsp to receive as well, and then it will be useful to use interrupts - the ideal would be to have an interrupt when the receive FIFO reaches a set threshold. Is this the behaviour you expect? Or will I just not get any interrupts at all? I will investigate further and let you know what I find.

      Thanks, as ever, for your help.

      Cheers,

      John.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Brad Griffis
      Posted by Brad Griffis
      on Dec 21 2009 10:41 AM
      Guru57330 points

      Hi John,

      Sorry for the slow reply.  I was on vacation  last week.

      This all makes more sense now that I know you're only transmitting 5 words.  I would expect everything to work fine for this use case.

      The interrupts are not connected to the FIFO.  That means you will get interrupts on a sample-by-sample basis and there will be no knowledge of any kind of FIFO theshold.  It is not possible to get interrupts when the FIFO threshold is reached.  Only EDMA events are generated when the FIFO threshold is reached.  You could potentially do something such as creating a dummy EDMA transfer associated with that channel and then have a completion interrupt for that dummy transfer.  That seems a bit of a waste though.  In other words, if you do that much effort with the EDMA you might as well use the EDMA to actually transfer the data!

      Brad

      ---------------------------------------------------------------------------------------------------------

      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.
    • John Wilkes
      Posted by John Wilkes
      on Jan 07 2010 04:25 AM
      Intellectual945 points

      Hi Brad,

      Yep that is pretty much the behaviour I see. Looks like I will have to use the DMA after all, for reception at least. Thank you very much for your help.

      Cheers,

      John.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Judson Wilson
      Posted by Judson Wilson
      on Oct 20 2011 16:35 PM
      Intellectual620 points

      Found this thread in google, thought I would add a note for others searching for answers.

      I have had success using the FIFO for the McASP on the OMAP-L138 as described in this thread, without DMA, using the "LAST" interrupt.  This allows me to use the FIFO to grab an entire frame of data from the serializer, one interrupt per frame (instead of a separate interrupt for each slot in the frame). 

      This is useful if you don't want (or need) to deal with the DMA.

      McASP OMAP-L138
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • John Wilkes
      Posted by John Wilkes
      on Oct 31 2011 04:36 AM
      Intellectual945 points

      Hi Judson,

      Cool, well done for finding that, wish I'd discovered it back in the day. Actually, I moved over to use the L138 too shortly after this thread was originally posted and I switched to using the McBSP peripheral because this is much more suited to my application.

      Cheers,

      John.

       

      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