• 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 » Embedded Software » StarterWare » StarterWare forum » Changing the sampling rate.
Share
StarterWare
  • Forum
Options
  • Subscribe via RSS

Forums

Changing the sampling rate.

This question is not answered
mahesh
Posted by mahesh
on Apr 19 2012 05:50 AM
Intellectual670 points

Urgent.

Dear friends,

I am presently  test running the McASP program of Starterware 1.x.x.3 on my OMAPL138 EVM. I need to change the sampling frequency to 8192 Hz from 8000Hz. 

Can I get Fs= 8192 Hz instead of 8000Hz using the formula given below

  fs = (PLL_IN * [pllJval.pllDval] * pllRval) /(2048 * pllPval).
 Where  PLL_IN = 24576 kHz ..

If possible, how to calculate the values of pllJval, pllDval, pllRval, pllPval to obtain 8192Hz.

Thanks in advance.

Regards,

Mahesh



Be brave and be sincere; then follow any path with devotion, and you must reach
God. Once lay hold of one link of the chain, and the whole chain must come by degrees.
Water the roots of the tree (that is, reach the Lord), and the whole tree is watered.
Getting the Lord, we get all.

Retreat given at the Thousand Island Park, USA. June 23, 1895. Complete Works, 7.6.
Swami Vivekananda




Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Sujith KV
    Posted by Sujith KV
    on Apr 23 2012 12:39 PM
    Intellectual2505 points

    Hi Mahesh,

    I was busy with some issues, so couldnt respond to this. 

    I suggest to configure McASP only for Receive, may be only receive EDMA paRAM set you configure, then capture the sine wave in the three RX buffers. 

    You can define three paramsets and statically link them. 

    configuration for rxBuf0:

    static struct EDMA3CCPaRAMEntry const rx0Par =
    {
    (unsigned int)(OPT_FIFO_WIDTH), /* Opt field */
    (unsigned int)SOC_MCASP_1_DATA_REGS, /* source address */
    (unsigned short)(BYTES_PER_SAMPLE), /* aCnt */
    (unsigned short)(1), /* bCnt */
    (unsigned int)rxBuf0, /* dest address */    ----> for the next paramset (rx1Par), give rxBuf1, and for rx2Par, give rxBuf2.
    (short) (0), /* source bIdx */
    (short)(BYTES_PER_SAMPLE), /* dest bIdx */
    (unsigned short)(***), /* link address */ ----> here give link to the paramset of rxBuf1. for rx1Par, give link to the paramset of rx2Par. For rx2Par, give 0xFFFF;
    (unsigned short)(0), /* bCnt reload value */
    (short)(0), /* source cIdx */
    (short)(0), /* dest cIdx */
    (unsigned short)1 /* cCnt */
    };

    If you configure properly, the sine wave will be captured in the three buffers.

    BTW, if you already know the sine wave frequency, I hope you can calculate how many samples are there in the sine wave directly from the sample values.

    regards

    sujith.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • mahesh
    Posted by mahesh
    on Apr 25 2012 13:04 PM
    Intellectual670 points

    Dear Sujit,

    I have incorporated the changes that you suggested.

    Also I add one extra line here in soc_omapl138.h

    #define SOC_MCASP_0_DATA_REGS               (0x01D02000)
    #define SOC_MCASP_1_DATA_REGS               (0x46400000) // extra line

    But I get error in the following regarding link aadress.

    //    configuration for rxBuf0

    static struct EDMA3CCPaRAMEntry const rx0Par =
        {
                (unsigned int)(OPT_FIFO_WIDTH), /* Opt field */
                (unsigned int)SOC_MCASP_1_DATA_REGS, /* source address */
                (unsigned short)(BYTES_PER_SAMPLE), /* aCnt */
                (unsigned short)(1), /* bCnt */
                (unsigned int)rxBuf0, /* dest address */
                (short) (0), /* source bIdx */
                (short)(BYTES_PER_SAMPLE), /* dest bIdx */
                (unsigned short)(rx1Par), /* link address */ // mere use of rx1Par gives error: expression must have arithmetic type
                (unsigned short)(0), /* bCnt reload value */
                        (short)(0), /* source cIdx */
                        (short)(0), /* dest cIdx */
                        (unsigned short)1 /* cCnt */
        };


    Can you tell me why such errors are coming and what to pass as link address.

    Regards,

    Mahesh

    Be brave and be sincere; then follow any path with devotion, and you must reach
    God. Once lay hold of one link of the chain, and the whole chain must come by degrees.
    Water the roots of the tree (that is, reach the Lord), and the whole tree is watered.
    Getting the Lord, we get all.

    Retreat given at the Thousand Island Park, USA. June 23, 1895. Complete Works, 7.6.
    Swami Vivekananda




    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Sujith KV
    Posted by Sujith KV
    on Apr 25 2012 22:57 PM
    Intellectual2505 points

    Hi Mahesh,

    The link address is NOT the address of the structure. It is the address of the param set to which the current paramset has to be linked to. Kindly refer to the function BufferRxDMAActivate() function in the McASP example application, to see how we can give link address. Here it is done run-time. But in your case, you can statically give as I had explained.

    Cheers,

    Sujith.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • mahesh
    Posted by mahesh
    on Apr 27 2012 14:27 PM
    Intellectual670 points

    Dear Sujit,

    I have been trying to capture the samples as per your suggestions.

    1.  I am  resetting the transmitter ,disabling all the transmit interrupts , and enabling the interrupts as follows,

         McASPTxIntDisable(SOC_MCASP_0_CTRL_REGS, MCASP_TX_DMAERROR
                                                    | MCASP_TX_CLKFAIL
                                                    | MCASP_TX_SYNCERROR
                                                    | MCASP_TX_UNDERRUN);
        /* Enable error interrupts for McASP - Receive */
        McASPRxIntEnable(SOC_MCASP_0_CTRL_REGS, MCASP_RX_DMAERROR
                                                | MCASP_RX_CLKFAIL
                                                | MCASP_RX_SYNCERROR
                                                | MCASP_RX_OVERRUN);

       /* Reset Transmit section */
        McASPTxReset(SOC_MCASP_0_CTRL_REGS);

    2.  I am declaring my own array of pointers to copy from rxBufPtr

    static unsigned int const ch0BufPtr[NUM_BUF] =
           {
               (unsigned int) ch0Buf0,
               (unsigned int) ch0Buf1,
               (unsigned int) ch0Buf2
           };

    static unsigned char ch0Buf0[AUDIO_BUF_SIZE];
    static unsigned char ch0Buf1[AUDIO_BUF_SIZE];
    static unsigned char ch0Buf2[AUDIO_BUF_SIZE];

    3. I declare the paRAM set as below

    /* The paRAM for rxBuf0 of Receive section. */
    static struct EDMA3CCPaRAMEntry const rx0Par =
           {
               (unsigned int)(OPT_FIFO_WIDTH), /* Opt field */
               (unsigned int)SOC_MCASP_1_DATA_REGS, /* source address */
               (unsigned short)(BYTES_PER_SAMPLE), /* aCnt */
               (unsigned short)(1), /* bCnt */
               (unsigned int)rxBuf0, /* dest address */
               (short) (0), /* source bIdx */
               (short)(BYTES_PER_SAMPLE), /* dest bIdx */
               (unsigned short)(40* SIZE_PARAMSET), /* link address */
               (unsigned short)(0), /* bCnt reload value */
               (short)(0), /* source cIdx */
               (short)(0), /* dest cIdx */
               (unsigned short)1 /* cCnt */
           };

    /* The paRAM for rxBuf1 of Receive section. */
    static struct EDMA3CCPaRAMEntry const rx1Par =
           {
               (unsigned int)(OPT_FIFO_WIDTH), /* Opt field */
               (unsigned int)SOC_MCASP_1_DATA_REGS, /* source address */
               (unsigned short)(BYTES_PER_SAMPLE), /* aCnt */
               (unsigned short)(1), /* bCnt */
               (unsigned int)rxBuf1, /* dest address */
               (short) (0), /* source bIdx */
               (short)(BYTES_PER_SAMPLE), /* dest bIdx */
               (unsigned short)(41* SIZE_PARAMSET), /* link address */
               (unsigned short)(0), /* bCnt reload value */
               (short)(0), /* source cIdx */
               (short)(0), /* dest cIdx */
               (unsigned short)1 /* cCnt */
           };

    /* The paRAM for rxBuf2 of Receive section. */
    static struct EDMA3CCPaRAMEntry const rx2Par =
           {
               (unsigned int)(OPT_FIFO_WIDTH), /* Opt field */
               (unsigned int)SOC_MCASP_1_DATA_REGS, /* source address */
               (unsigned short)(BYTES_PER_SAMPLE), /* aCnt */
               (unsigned short)(1), /* bCnt */
               (unsigned int)rxBuf0, /* dest address */
               (short) (0), /* source bIdx */
               (short)(BYTES_PER_SAMPLE), /* dest bIdx */
               (unsigned short)(0xFFFF), /* link address */
               (unsigned short)(0), /* bCnt reload value */
               (short)(0), /* source cIdx */
               (short)(0), /* dest cIdx */
               (unsigned short)1 /* cCnt */
           };


    I can see that audio transmission is off. I want to see that audio samples recieved in rxBuf0, rxBuf1, and rxBuf2 are displayed in graph. The single time Graph reports an error that it cannot compute the starting address of rxBuf0. The capture size and display sizes are 8000 samples, with 32-bit integer data type.

    The graph is empty always. The Expressions window in the Debug perspective shows- initially when program is loaded- correct size of the rxBuf0 but when the program is running, it shows Type: unknown and Error: Unknown identifier rxBuf0.

    Please see the file modified . I am waiting for your suggestions.

    0118.modified_asp.c

    Regards,

    Mahesh



    Be brave and be sincere; then follow any path with devotion, and you must reach
    God. Once lay hold of one link of the chain, and the whole chain must come by degrees.
    Water the roots of the tree (that is, reach the Lord), and the whole tree is watered.
    Getting the Lord, we get all.

    Retreat given at the Thousand Island Park, USA. June 23, 1895. Complete Works, 7.6.
    Swami Vivekananda




    StarterWare CCS v5.1 CCS aic3106 mcasp omap l138
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • mahesh
    Posted by mahesh
    on Apr 29 2012 04:05 AM
    Intellectual670 points

    Dear Sujit,

    Are you there?

    Regards,

    Mahesh

    Be brave and be sincere; then follow any path with devotion, and you must reach
    God. Once lay hold of one link of the chain, and the whole chain must come by degrees.
    Water the roots of the tree (that is, reach the Lord), and the whole tree is watered.
    Getting the Lord, we get all.

    Retreat given at the Thousand Island Park, USA. June 23, 1895. Complete Works, 7.6.
    Swami Vivekananda




    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Sujith KV
    Posted by Sujith KV
    on Apr 29 2012 23:45 PM
    Intellectual2505 points

    Hi Mahesh,

    I think you are facing problem because aCnt, bCnt are not properly programmed. The way you are linking seems to be proper. Please refer to EDMA of TRM for details on how EDMA transfers will happen.

    Regards,

    Sujith.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • mahesh
    Posted by mahesh
    on May 13 2012 09:18 AM
    Intellectual670 points

    Dear Sujit,

    I incorporated the changes for aCnt, bCnt as per TRM but still the problem persists.

    1145.modified_mcasp.c

    Regards,

    Mahesh

    Be brave and be sincere; then follow any path with devotion, and you must reach
    God. Once lay hold of one link of the chain, and the whole chain must come by degrees.
    Water the roots of the tree (that is, reach the Lord), and the whole tree is watered.
    Getting the Lord, we get all.

    Retreat given at the Thousand Island Park, USA. June 23, 1895. Complete Works, 7.6.
    Swami Vivekananda




    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Baskaran Chidambaram
    Posted by Baskaran Chidambaram
    on May 15 2012 08:19 AM
    Expert4385 points

    Hi Mahesh,

                   Since this need more closer look at the code. I suggest you to contact your local FAE.

    Regards

    Baskaran

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
12
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