• 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) » C6000 Single Core DSP » C67x Single Core DSP Forum » Trouble with ACLKXCTL in McASP1
Share
C6000 Single Core DSP
  • Forums
  • Announcements
Options
  • Subscribe via RSS

Trouble with ACLKXCTL in McASP1

Trouble with ACLKXCTL in McASP1

This question is answered
Michael Geunther
Posted by Michael Geunther
on Mar 19 2011 01:42 AM
Prodigy100 points

 

Hello all,

I work with C6720 DSP and AIC23B audio codec (as slave) and I use the software demo "How to create delay based audio effects - spraaa5" from TI to control the codec.

After I adjust some registers in McASP init the SW works and I put audio signal into codec input through ADC - DAC and out to speakers. But the signals has little noise.

Then I checked the clocks and found out that the Clock ACLKX1 is too slow (should be 12 MHz to feed into BCLK of codec) - only 1.66 MHz:

I checked the registers of the clock stage and the HCLKXDIV is set to 1 so I measured 12 MHz at output pin AHCLKX pin with

logic probe. I init the divider CLKXDIV to 1, but the ACLKX pin is 1.66 MHz and the memory registers show following:

The register is set to 0xE7 but I init with 0xE0. The devider value of 0x07 is correct for the 1.66 MHz. In memory window I changed the value to 0xE0 hard and measured the

clock ACLKX: Result: 12 MHz. In software I set all CLKXDIV bits to "0" - never changes. Then (for test) I set one of the higher register bits to "1" to check that the right register

is used: the register is OK.

This is the software init of McASP1 (I used McASP1 instead of the original McASP0 in spraaa5 code):

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


// configuration of MCASP1
#define  PADKDEMO_MCASP1_HWSETUP {                                        \
    /* Value to be loaded in global control register (GLBCTL) */            \
    {                                                                        \
        /* Pin function register (PFUNC) */                                    \
          (0<< 0)          /* AXR1_0: McASP1 */                    \
        | (0<< 1)          /* AXR1_1: McASP1    */                    \
        | (0<< 2)          /* AXR1_2: McASP1    */                    \
        | (0<< 3)          /* AXR1_3: McASP1    */                    \
        | (0<< 27)          /* AHCLKX1: McASP1    */                    \
        | (0<< 26)          /* ACLKX1: McASP1    */                    \
        | (0<< 28)          /* AFSX1: McASP1    */                    \
        | (0<< 31),         /* AFSR1: McASP1    */                    \
                                                                                    \
        /* Pin direction register (PDIR) */                                    \
          (1<<31)          /* AFSR  : Input */                                \
        | (1<<30)          /* AHCLKR: OUTPUT */                                \
        | (1<<29)          /* ACLKR : OUTPUT */                                \
        | (1<<28)          /* AFSX  : Output */                                \
        | (1<<27)          /* AHCLKX: OUTPUT */                                \
        | (1<<26)          /* ACLKX : Output */                                \
        | (1<<25)          /* AMUTE : *unused */                                \
        | (0<<10)          /* AXR10 : unused */                    \
        | (0<< 9)          /* AXR9  : unused */                \
        | (0<< 8)          /* AXR8  : unused */                \
        | (0<< 7)          /* AXR7  : unused */                \
        | (0<< 6)          /* AXR6  : unused */                    \
        | (0<< 5)          /* AXR5  : unused */                    \
        | (0<< 4)          /* AXR4  : unused */                    \
        | (0<< 3)          /* AXR3  : Input Codec 2 */                    \
        | (1<< 2)          /* AXR2  : Output Codec 2 */                    \
        | (0<< 1)          /* AXR1  : Input Codec 1 */                    \
        | (1<< 0),         /* AXR0  : Output Codec 1 */                    \
                                                                            \
        /* Global control register (GBLCTL) */                                \
        0x00000000,         /* Everything in reset */                        \
                                                                            \
        /* Decides whether McASP operates in DIT mode (DITCTL) */            \
        0x00000000,         /* DIT mode disable */                            \
                                                                            \
        /* Digital loopback mode setup (DLBEN) */                            \
        0x00000000,         /* Loopback mode disable */                        \
                                                                            \
        /* Mute control register (AMUTE) */                                    \
        0x00000000,         /* AMUTE pin is disabled */                        \
                                                                            \
        /* Setup serializer control register (SRCTL0-15) */                    \
        0x00000001,         /* Serializer  0 is in tx Codec 1 */            \
        0x00000002,         /* Serializer  1 is in rx Codec 1 */            \
        0x00000000,         /* Serializer  2 is in tx Codec 2 */            \
        0x00000000,         /* Serializer  3 is in rx Codec 2 */            \
        0x00000000,         /* Serializer  4 is unused */            \
        0x00000000,         /* Serializer  5 is unused */            \
        0x00000000,         /* Serializer  6 is unused */            \
        0x00000000,         /* Serializer  7 is unused */                      \
        0x00000000,         /* Serializer  8 is unused */                    \
        0x00000000,         /* Serializer  9 is unused */                    \
        0x00000000,         /* Serializer 10 is unused */            \
        0x00000000,         /* Serializer 11 is unused */                    \
        0x00000000,         /* Serializer 12 is unused */                    \
        0x00000000,         /* Serializer 13 is unused */                    \
        0x00000000,         /* Serializer 14 is unused */                    \
        0x00000000          /* Serializer 15 is unused */                    \
    },                                                                        \
                                                                            \
    /* Receiver settings */                                                    \
    {                                                                        \
        /* To mask or not to mask (RMASK) */                                \
        0xFFFFFFFF,         /* 24-bits left justified */                    \
                                                                            \
        /* Format details as per (RFMT) */                                    \
          ( 0<<16)         /* XDATDLY: Transmit with 1 bit delay */            \
        | ( 1<<15)         /* XRVRS  : MSB first */                            \
        | ( 0<< 3)         /* XBUSSEL: Writes from dMAX port */                \
        | (15<< 4)         /* XSSZ   : 32-bit slot size */                    \
        | ( 0<< 0),        /* XROT   : No rotation */                        \
                                                                            \
        /* Configure the rcv frame sync (AFSRCTL) */                        \
          (2<< 7)          /* RMOD : 2-slot TDM, I2S */                            \
        | (1<< 4)          /* FRWID: Single word frame sync */                \
        | (1<< 1)          /* FSRM : Internally-generated tx frame sync */    \
        | (0<< 0),         /* FSRP : Start on falling edge */                \
                                                                            \
        /* Specifies which TDM slots are active (RTDM) */                    \
        0x00000003,         /* Enable all slots */                            \
                                                                            \
        /* Controls generation of McASP interrupts (RINTCTL) */                \
        0x00000000,         /* No interrupts */                                \
                                                                            \
        /* Status register (controls writable fields of STAT reg) (RSTAT) */\
        0x00000000,                                                            \
                                                                            \
        /* Event control register (REVTCTL) */                                \
        0x00000000,                                                            \
                                                                            \
        /* Clock settings for rcv */                                        \
        {                                                                    \
            /* Clock details (ACLKRCTL) */                                    \
              (0<< 7)          /* CLKRP  : RX on rising edge */                \
            | (1<< 6)          /* ASYNC  : TX and RX are asynchronous ? */    \
            | (1<< 5)          /* CLKRM  : Int clk source from PLL div */    \
            | (0<< 0),         /* CLKRDIV: Need to be initialized by user */\
                                                                            \
            /* High clock details (AHCLKRCTL) */                            \
              (1<<15)          /* HCLKRM  : Clock intern */        \
            | (0<<14)          /* HCLKRP  : Rising edge */                    \
            | (0<< 0),         /* HCLKRDIV: AHCLKR = AUXCLK / 1 */            \
                                                                            \
            /* Config receive/transmit clock failure detection (RCLKCHK) */    \
            0x00FF0000          /* Not used */                                \
        }                                                                    \
    },                                                                        \
                                                                            \
    /* Transmitter settings */                                                \
    {                                                                        \
        /* To mask or not to mask (XMASK) */                                \
        0xFFFFFFFF,         /* 24-bits left justified */                    \
                                                                            \
        /* Format details as per (XFMT) */                                    \
          ( 0<<16)         /* XDATDLY: Transmit with 1 bit delay */            \
        | ( 1<<15)         /* XRVRS  : MSB first */                            \
        | ( 0<< 3)         /* XBUSSEL: Writes from dMAX port */                \
        | (15<< 4)         /* XSSZ   : 32-bit slot size */                    \
        | ( 0<< 0),        /* XROT   : No rotation */                        \
                                                                            \
        /* Configure the xmt frame sync (AFSXCTL) */                        \
          (2<< 7)          /* XMOD : 2-slot TDM */                            \
        | (1<< 4)          /* FXWID: Single word frame sync */                \
        | (1<< 1)          /* FSXM : Internally-generated tx frame sync */    \
        | (0<< 0),         /* FSXP : Start on rising edge */                \
                                                                            \
        /* Specifies which TDM slots are active (XTDM) */                    \
        0x00000003,         /* Enable all slots */                            \
                                                                            \
        /* Controls generation of McASP interrupts (XINTCTL) */                \
        0x00000000,         /* No interrupts */                                \
                                                                            \
        /* Status register (controls writable fields of STAT reg) (XSTAT) */\
        0x00000000,                                                            \
                                                                            \
        /* Event control register (XEVTCTL) */                                \
        0x00000000,                                                            \
                                                                            \
        /* Clock settings for xmt */                                        \
        {                                                                    \
            /* Clock details (ACLKXCTL) */                                    \
              (1<< 7)          /* CLKXP  : TX on falling edge */            \
            | (1<< 6)          /* ASYNC  : TX and RX are asynchronous ? */    \
            | (1<< 5)          /* CLKXM  : Int clk source from PLL div */    \
            | (0<< 0),         /* CLKXDIV: Need to be initialized by user */\
                                                                            \
            /* High clock details (AHCLKXCTL) */                            \
              (1<<15)          /* HCLKXM  : Clock intern*/        \
            | (0<<14)          /* HCLKXP  : Rising edge */                    \
            | (0<< 0),         /* HCLKXDIV: AHCLKX = AUXCLK / 1 */            \
                                                                            \
            /* Conf receive/transmit clock failure detection (XCLKCHK) */    \
            0x00FF0000          /* Not used */                                \
        }                                                                    \
    },                                                                        \
                                                                            \
    /* Power down emulation mode params - PWRDEMU */                        \
    CSL_MCASP_PWRDEMU_FREE_OFF                                                \
}

// CSL McASP 0 Module
CSL_McaspHandle  hMcasp1;
CSL_McaspObj      MCASP1Obj;
CSL_McaspHwSetup MCASP1HwCfg = PADKDEMO_MCASP1_HWSETUP;

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

 

What is wrong there? Can anybody help me? With software init I can never change the divider bits of CLKXDIV. Always the value of 7h.

 

Thanks and best regards,

Michael.

C6720 and McASP
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • dabuan
    Posted by dabuan
    on Mar 21 2011 08:42 AM
    Verified Answer
    Verified by Michael Geunther
    Genius14450 points

    Michael,

        Did you follow the initialization steps in section 3.1 of the McASP User Guide? Make sure you read back the values you write to the registers as per section 3.1.3.

    -Drew 

    _____________________________________________________________________________

    If the response answers your forum question: Please Verify Answer to alert others.

    Are you aware of the TI Processors Wiki?  This is a good place to search for additional support on TI ARM+DSP Application Processors.

     

     

     

    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