This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

XGBLCTL value isnt getting latched to GBLCTL in McASP

Other Parts Discussed in Thread: OMAPL138, OMAP-L138

hai

am working on OMAPL138 and trying to work out McASP  with the help of " quickStartOMAPL1x McASP Chip Support Library Example " on debugging i find that though High Frequency Clocks XHCLKRST bit and RHCLKRST bit gets reflected in GBLCTL ,internal serial clock divider (XCLKRST) isnt getting latched to GBLCTL.when i tried to make a simple McASP project in burst mode where the clocking is taken from internal source, there is no trouble in getting the XCLKRST bit getting latched to GBLCTL.please help me to solve this issue.

thanks

Somu Sebastian

  • hai

    i found out the reason why its not happending.Its because i diddnt turned off the S7.2 switch in my LogicPD  board and by doing this am able to clear the above part but am stuck with 'XRDY' bit in serializer ,specifcally SRCTL11 in McASP. Well , i started another project in which i use a sample code from TI  to make a beep sound for few seconds .Once i write a data to XBUFF11, the XRDY bit clears and i need to manually set it which is what i understood from datasheet of McASP which says  " XRDY indicates the current transmit buffer state. Always reads 0 when programmed as a receiver or as inactive. If SRMOD bit is set to transmit (1h), XRDY switches from 0 to
    1 when XSRCLR in GBLCTL is switched from 0 to 1 to indicate an empty transmitter. XRDY remains
    set until XSRCLR is forced to 0, data is written to the corresponding transmit buffer, or SRMOD bit is
    changed to receive (2h) or inactive (0)." even after by clearing and setting XSRCLR bit am not able to able to hear that beep sound.please tell me why its happending.

    Thanks in advance

    Somu Sebastian

  • Hi Somu,

    Thanks for your post.

    There are some tips given below to make sure the following:

    1. Before activating serializers, please make sure to clear the respective transmitter status registers by writing XSTAT = FFFFh

    2. Did you verify XDATA bit changed from 0 to 1 in XSTAT after you clear and set XSRCLR bit in GLBCTL? Because, even after clearing and setting XSRCLR bit, still if XDATA retains 0 in XSTAT, it indicates XBUF is not  flushed to an empty state which is not ready to accept any new data. Please check the followng values after clearing and setting XSRCLR bit in GBLCTL:

    XSMRST = 1, XSRCLR = 1, XDATA = 1 (indicating transmit serializers are active). Also, check XBUF is not loaded with new data before the start of the next active time slot.

    3. Before programming any bitfields in GBLCTL, please make sure, your internal/external  serial clocks are running.

    4. After you program any bits in GBLCTL, please read back the corresponding bits you configure and verify whether the same is latched in GBLCTL.

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------------------------------- 
    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------
     

     

  • Hai shivaraj

    Thanks a lot for replying. as i mentioned earlier am trying to run the file i got along with my LogicPD board which i assume is fool proof and will definitly work because this file satisfy all the mandatory conditions specified in datasheet .but unfortunately its not working.i will explain where exactly is the problem.

    //------------------------------------------------------------------------------
    // \file    test_audio.c
    // \brief   implementation of OMAP-L138 audio test.
    //
    //-----------------------------------------------------------------------------

    #include "stdio.h"
    #include "types.h"
    #include "evmomapl138.h"
    #include "evmomapl138_mcasp.h"
    #include "evmomapl138_aic3106.h"
    #include "test_audio.h"

    //-----------------------------------------------------------------------------
    // Private Defines and Macros
    //-----------------------------------------------------------------------------

    //-----------------------------------------------------------------------------
    // Static Variable Declarations
    //-----------------------------------------------------------------------------

    static int16_t sinetable[48] = {
        0x0000, 0x10b4, 0x2120, 0x30fb, 0x3fff, 0x4dea, 0x5a81, 0x658b,
        0x6ed8, 0x763f, 0x7ba1, 0x7ee5, 0x7ffd, 0x7ee5, 0x7ba1, 0x76ef,
        0x6ed8, 0x658b, 0x5a81, 0x4dea, 0x3fff, 0x30fb, 0x2120, 0x10b4,
        0x0000, 0xef4c, 0xdee0, 0xcf06, 0xc002, 0xb216, 0xa57f, 0x9a75,
        0x9128, 0x89c1, 0x845f, 0x811b, 0x8002, 0x811b, 0x845f, 0x89c1,
        0x9128, 0x9a76, 0xa57f, 0xb216, 0xc002, 0xcf06, 0xdee0, 0xef4c
    };

    //-----------------------------------------------------------------------------
    // Private Function Prototypes
    //-----------------------------------------------------------------------------
    static uint32_t testAudioLineOut(void);
    static uint32_t testAudioLineIn(void);
    static void shutdownAudio(void);

    //-----------------------------------------------------------------------------
    // Public Function Definitions
    //-----------------------------------------------------------------------------

    //-----------------------------------------------------------------------------
    // \brief   tests the AIC3106 CODEC
    //
    // \param   none.
    //
    // \return  uint32_t
    //-----------------------------------------------------------------------------
    uint32_t TEST_audio(void)
    {
        uint32_t rtn = ERR_NO_ERROR;

       printf("--------------------------------------------------------------------\r\n");
       printf("                     Audio CODEC test\r\n\r\n");
       
       printf("Additional Equipment\r\n");
       printf("--------------------\r\n");
       printf("- 3.5mm pass through cable\r\n\r\n");
       printf("- 3.5mm headphones\r\n\r\n");
       
       printf("Test Description\r\n");
       printf("----------------\r\n");
       printf("The test will begin by playing a 5 second tone though the line\r\n");
       printf("out port. The 3.5mm pass through cable will not be needed for\r\n");
       printf("this portion of the test. After playing the tone, audio from the\n\r");
       printf("line in port will be played through the line out port for 15 seconds.\r\n");
       printf("--------------------------------------------------------------------\r\n\r\n");

        //------------------------------------
        // initialize the required bsl modules
        //------------------------------------
       printf("Initialize the Required BSL Modules\r\n");
       printf("-----------------------------------\r\n\r\n");
       
        rtn = MCASP_init();
        if (rtn != ERR_NO_ERROR)
        {
            printf("error initializing mcasp!\r\n");
            return (rtn);
        }

        rtn = AIC3106_init();
        if (rtn != ERR_NO_ERROR)
        {
            printf("error initializing aic3106!\r\n");
            return (rtn);
        }


        //-----------------------
        // execute line out test.
        //-----------------------
       printf("\r\nExecute Test\r\n");
       printf("------------\r\n\r\n");
        
        printf("--- test audio line out (put on your headphones...) ---\r\n");
        rtn = testAudioLineOut();
       if (rtn != ERR_NO_ERROR)
       {
          printf("\tline out test failed\r\n\r\n");
          return (rtn);
       }
       else
       {
          printf("\tline out test passed\r\n\r\n");
       }

        //------------------------------------
        // initialize the required bsl modules
        //------------------------------------
        rtn = MCASP_init();
        if (rtn != ERR_NO_ERROR)
        {
            printf("error initializing mcasp!\r\n");
            return (rtn);
        }

        rtn = AIC3106_init();
        if (rtn != ERR_NO_ERROR)
        {
            printf("error initializing aic3106!\r\n");
            return (rtn);
        }

        //-----------------------
        // execute line in test.
        //-----------------------
        printf("--- test audio line in (put on your headphones and plug in source to line in...) ---\r\n");

        rtn = testAudioLineIn();
       if (rtn != ERR_NO_ERROR)
       {
          printf("\tline in test failed\r\n\r\n");
          return (rtn);
       }
       else
       {
          printf("\tline in test passed\r\n\r\n");
       }

        // kill codec and mcasp.
       shutdownAudio();

        return (rtn);
    }

    //-----------------------------------------------------------------------------
    // Private Function Definitions
    //-----------------------------------------------------------------------------

    uint32_t testAudioLineOut(void)
    {
       uint32_t rtn = ERR_NO_ERROR;
       int16_t msec, sec;
       int16_t sample;

       // enable the audio clocks, verifying each bit is properly set.
       SETBIT(MCASP->XGBLCTL, XHCLKRST);
       while (!CHKBIT(MCASP->XGBLCTL, XHCLKRST)) {}
       SETBIT(MCASP->RGBLCTL, RHCLKRST);
       while (!CHKBIT(MCASP->RGBLCTL, RHCLKRST)) {}

       SETBIT(MCASP->XGBLCTL, XCLKRST);
       while (!CHKBIT(MCASP->XGBLCTL, XCLKRST)) {}
       SETBIT(MCASP->RGBLCTL, RCLKRST);
       while (!CHKBIT(MCASP->RGBLCTL, RCLKRST)) {}


    MCASP->XSTAT = 0x0000FFFF;        // Clear all
        MCASP->RSTAT = 0x0000FFFF;        // Clear all


       SETBIT(MCASP->XGBLCTL, XSRCLR);
       while (!CHKBIT(MCASP->XGBLCTL, XSRCLR)) {}
       SETBIT(MCASP->RGBLCTL, RSRCLR);
       while (!CHKBIT(MCASP->RGBLCTL, RSRCLR)) {}

       /* Write a 0, so that no underrun occurs after releasing the state machine */
     //  MCASP->XBUF11 = 0;
       //MCASP->RBUF12 = 0;

       SETBIT(MCASP->XGBLCTL, XSMRST);
       while (!CHKBIT(MCASP->XGBLCTL, XSMRST)) {}
       SETBIT(MCASP->RGBLCTL, RSMRST);
       while (!CHKBIT(MCASP->RGBLCTL, RSMRST)) {}

       SETBIT(MCASP->XGBLCTL, XFRST);
       while (!CHKBIT(MCASP->XGBLCTL, XFRST)) {}
       SETBIT(MCASP->RGBLCTL, RFRST);
       while (!CHKBIT(MCASP->RGBLCTL, RFRST)) {}

       // wait for transmit ready and send a dummy byte.
       while(!CHKBIT(MCASP->SRCTL11, XRDY)) {}
       MCASP->XBUF11 = 0;

       // transmit beep.
       for (sec = 0; sec < 5; sec++)
       {
          for (msec = 0; msec < 1000; msec++)
          {
             for (sample = 0; sample < 48; sample++)
             {
                // wait for xmit ready and send a sample to the left channel.
                while (!CHKBIT(MCASP->SRCTL11, XRDY)) {}
                MCASP->XBUF11 = (sinetable[sample] << 15) | 0x00000000;

                // wait for xmit ready and send a sample to the left channel.
                while (!CHKBIT(MCASP->SRCTL11, XRDY)) {}
                MCASP->XBUF11 = (sinetable[sample] << 15) | 0x00000000;
             }
          }
       }
       return (rtn);
    }

    well as you can see in the red bold line in the code, XRDY bit is low here. i checked the conditions you asked and it seems all fine but yet its not working.iam attanching you the code in which am working kindily have a look on it

    with regards

    Somu Sebastian

    //------------------------------------------------------------------------------
    // \file    test_audio.c
    // \brief   implementation of C6748 audio test.
    //
    //-----------------------------------------------------------------------------
    
    #include "stdio.h"
    #include "types.h"
    #include "evmc6748.h"
    #include "evmc6748_mcasp.h"
    #include "evmc6748_aic3106.h"
    #include "test_audio.h"
    
    //-----------------------------------------------------------------------------
    // Private Defines and Macros
    //-----------------------------------------------------------------------------
    
    //-----------------------------------------------------------------------------
    // Static Variable Declarations
    //-----------------------------------------------------------------------------
    
    static int16_t sinetable[48] = {
        0x0000, 0x10b4, 0x2120, 0x30fb, 0x3fff, 0x4dea, 0x5a81, 0x658b,
        0x6ed8, 0x763f, 0x7ba1, 0x7ee5, 0x7ffd, 0x7ee5, 0x7ba1, 0x76ef,
        0x6ed8, 0x658b, 0x5a81, 0x4dea, 0x3fff, 0x30fb, 0x2120, 0x10b4,
        0x0000, 0xef4c, 0xdee0, 0xcf06, 0xc002, 0xb216, 0xa57f, 0x9a75,
        0x9128, 0x89c1, 0x845f, 0x811b, 0x8002, 0x811b, 0x845f, 0x89c1,
        0x9128, 0x9a76, 0xa57f, 0xb216, 0xc002, 0xcf06, 0xdee0, 0xef4c
    };
    
    //-----------------------------------------------------------------------------
    // Private Function Prototypes
    //-----------------------------------------------------------------------------
    static uint32_t testAudioLineOut(void);
    static uint32_t testAudioLineIn(void);
    static void shutdownAudio(void);
    
    //-----------------------------------------------------------------------------
    // Public Function Definitions
    //-----------------------------------------------------------------------------
    
    //-----------------------------------------------------------------------------
    // \brief   tests the AIC3106 CODEC
    //
    // \param   none.
    //
    // \return  uint32_t
    //-----------------------------------------------------------------------------
    uint32_t TEST_audio(void)
    {
    	uint32_t rtn = ERR_NO_ERROR;
    
       printf("--------------------------------------------------------------------\r\n");
       printf("                     Audio CODEC test\r\n\r\n");
       
       printf("Additional Equipment\r\n");
       printf("--------------------\r\n");
       printf("- 3.5mm pass through cable\r\n\r\n");
       printf("- 3.5mm headphones\r\n\r\n");
       
       printf("Test Description\r\n");
       printf("----------------\r\n");
       printf("The test will begin by playing a 5 second tone though the line\r\n");
       printf("out port. The 3.5mm pass through cable will not be needed for\r\n");
       printf("this portion of the test. After playing the tone, audio from the\n\r");
       printf("line in port will be played through the line out port for 15 seconds.\r\n");
       printf("--------------------------------------------------------------------\r\n\r\n");
    
    	//------------------------------------
    	// initialize the required bsl modules
    	//------------------------------------
       printf("Initialize the Required BSL Modules\r\n");
       printf("-----------------------------------\r\n\r\n");
       
    	rtn = MCASP_init();
    	if (rtn != ERR_NO_ERROR)
    	{
    		printf("error initializing mcasp!\r\n");
    		return (rtn);
    	}
    
    	rtn = AIC3106_init();
    	if (rtn != ERR_NO_ERROR)
    	{
    		printf("error initializing aic3106!\r\n");
    		return (rtn);
    	}
    
    
    	//-----------------------
    	// execute line out test.
    	//-----------------------
       printf("\r\nExecute Test\r\n");
       printf("------------\r\n\r\n");
    	
    	printf("--- test audio line out (put on your headphones...) ---\r\n");
    	rtn = testAudioLineOut();
       if (rtn != ERR_NO_ERROR)
       {
          printf("\tline out test failed\r\n\r\n");
          return (rtn);
       }
       else
       {
          printf("\tline out test passed\r\n\r\n");
       }
    
    	//------------------------------------
    	// initialize the required bsl modules
    	//------------------------------------
    	rtn = MCASP_init();
    	if (rtn != ERR_NO_ERROR)
    	{
    		printf("error initializing mcasp!\r\n");
    		return (rtn);
    	}
    
    	rtn = AIC3106_init();
    	if (rtn != ERR_NO_ERROR)
    	{
    		printf("error initializing aic3106!\r\n");
    		return (rtn);
    	}
    
    	//-----------------------
    	// execute line in test.
    	//-----------------------
    	printf("--- test audio line in (put on your headphones and plug in source to line in...) ---\r\n");
    
    	rtn = testAudioLineIn();
       if (rtn != ERR_NO_ERROR)
       {
          printf("\tline in test failed\r\n\r\n");
          return (rtn);
       }
       else
       {
          printf("\tline in test passed\r\n\r\n");
       }
    
    	// kill codec and mcasp.
       shutdownAudio();
    
    	return (rtn);
    }
    
    //-----------------------------------------------------------------------------
    // Private Function Definitions
    //-----------------------------------------------------------------------------
    
    uint32_t testAudioLineOut(void)
    {
       uint32_t rtn = ERR_NO_ERROR;
       int16_t msec, sec;
       int16_t sample;
    
       // enable the audio clocks, verifying each bit is properly set.
       SETBIT(MCASP->XGBLCTL, XHCLKRST);
       while (!CHKBIT(MCASP->XGBLCTL, XHCLKRST)) {}
       SETBIT(MCASP->RGBLCTL, RHCLKRST);
       while (!CHKBIT(MCASP->RGBLCTL, RHCLKRST)) {}
    
       SETBIT(MCASP->XGBLCTL, XCLKRST);
       while (!CHKBIT(MCASP->XGBLCTL, XCLKRST)) {}
       SETBIT(MCASP->RGBLCTL, RCLKRST);
       while (!CHKBIT(MCASP->RGBLCTL, RCLKRST)) {}
    
       SETBIT(MCASP->XGBLCTL, XSRCLR);
       while (!CHKBIT(MCASP->XGBLCTL, XSRCLR)) {}
       SETBIT(MCASP->RGBLCTL, RSRCLR);
       while (!CHKBIT(MCASP->RGBLCTL, RSRCLR)) {}
    
       /* Write a 0, so that no underrun occurs after releasing the state machine */
       MCASP->XBUF11 = 0;
       //MCASP->RBUF12 = 0;
    
       SETBIT(MCASP->XGBLCTL, XSMRST);
       while (!CHKBIT(MCASP->XGBLCTL, XSMRST)) {}
       SETBIT(MCASP->RGBLCTL, RSMRST);
       while (!CHKBIT(MCASP->RGBLCTL, RSMRST)) {}
    
       SETBIT(MCASP->XGBLCTL, XFRST);
       while (!CHKBIT(MCASP->XGBLCTL, XFRST)) {}
       SETBIT(MCASP->RGBLCTL, RFRST);
       while (!CHKBIT(MCASP->RGBLCTL, RFRST)) {}
    
       // wait for transmit ready and send a dummy byte.
       while(!CHKBIT(MCASP->SRCTL11, XRDY)) {}
       MCASP->XBUF11 = 0;
    
       // transmit beep.
       for (sec = 0; sec < 5; sec++)
       {
          for (msec = 0; msec < 1000; msec++)
          {
             for (sample = 0; sample < 48; sample++)
             {
                // wait for xmit ready and send a sample to the left channel.
                while (!CHKBIT(MCASP->SRCTL11, XRDY)) {}
                MCASP->XBUF11 = (sinetable[sample] << 15) | 0x00000000;
    
                // wait for xmit ready and send a sample to the left channel.
                while (!CHKBIT(MCASP->SRCTL11, XRDY)) {}
                MCASP->XBUF11 = (sinetable[sample] << 15) | 0x00000000;
             }
          }
       }
       return (rtn);
    }
    
    uint32_t testAudioLineIn(void)
    {
       uint32_t rtn = ERR_NO_ERROR;
       int16_t msec, sec, sample;
       int32_t dat;
    
       // enable the audio clocks, verifying each bit is properly set.
       SETBIT(MCASP->XGBLCTL, XHCLKRST);
       while (!CHKBIT(MCASP->XGBLCTL, XHCLKRST)) {}
       SETBIT(MCASP->RGBLCTL, RHCLKRST);
       while (!CHKBIT(MCASP->RGBLCTL, RHCLKRST)) {}
    
       SETBIT(MCASP->XGBLCTL, XCLKRST);
       while (!CHKBIT(MCASP->XGBLCTL, XCLKRST)) {}
       SETBIT(MCASP->RGBLCTL, RCLKRST);
       while (!CHKBIT(MCASP->RGBLCTL, RCLKRST)) {}
    
       SETBIT(MCASP->XGBLCTL, XSRCLR);
       while (!CHKBIT(MCASP->XGBLCTL, XSRCLR)) {}
       SETBIT(MCASP->RGBLCTL, RSRCLR);
       while (!CHKBIT(MCASP->RGBLCTL, RSRCLR)) {}
    
       /* Write a 0, so that no underrun occurs after releasing the state machine */
       MCASP->XBUF11 = 0;
    
       SETBIT(MCASP->XGBLCTL, XSMRST);
       while (!CHKBIT(MCASP->XGBLCTL, XSMRST)) {}
       SETBIT(MCASP->RGBLCTL, RSMRST);
       while (!CHKBIT(MCASP->RGBLCTL, RSMRST)) {}
    
       SETBIT(MCASP->XGBLCTL, XFRST);
       while (!CHKBIT(MCASP->XGBLCTL, XFRST)) {}
       SETBIT(MCASP->RGBLCTL, RFRST);
       while (!CHKBIT(MCASP->RGBLCTL, RFRST)) {}
    
       // wait for transmit ready and send a dummy byte.
       while(!CHKBIT(MCASP->SRCTL11, XRDY)) {}
       MCASP->XBUF11 = 0;
    
       // loop audio
       for (sec = 0; sec < 15; sec++)
       {
          for (msec = 0; msec < 1000; msec++)
          {
             for (sample = 0; sample < 48; sample++)
             {
                // wait for recv ready and send a sample to the left channel.
                while (!CHKBIT(MCASP->SRCTL11, XRDY)) {}
       			MCASP->XBUF11 = dat;
                dat = MCASP->XBUF12;
    
                // wait for recv ready and send a sample to the right channel.
                while (!CHKBIT(MCASP->SRCTL11, XRDY)) {}
       			MCASP->XBUF11 = dat;
                dat = MCASP->XBUF12;
             }
          }
       }
       return (rtn);
    }
    
    void shutdownAudio(void)
    {
       // close codec.
       AIC3106_writeRegister(AIC3106_REG_PAGESELECT, 0);
       AIC3106_writeRegister(AIC3106_REG_RESET, 0x80);
    
       // close mcasp.
       MCASP->SRCTL0 = 0;
       MCASP->SRCTL1 = 0;
       MCASP->SRCTL2 = 0;
       MCASP->SRCTL3 = 0;
       MCASP->SRCTL5 = 0;
       MCASP->SRCTL11 = 0;
       MCASP->SRCTL12 = 0;
       MCASP->GBLCTL = 0;
    }
    
    
    //-----------------------------------------------------------------------------
    // \file    evmc6748_mcasp.c
    // \brief   implementation of a mcasp driver for the C6748 EVM.
    //
    //-----------------------------------------------------------------------------
    #include "stdio.h"
    #include "types.h"
    #include "evmc6748.h"
    #include "evmc6748_mcasp.h"
    
    //-----------------------------------------------------------------------------
    // Private Defines and Macros
    //-----------------------------------------------------------------------------
    // pinmux defines.
    #define PINMUX_MCASP_REG_0       (0)
    #define PINMUX_MCASP_MASK_0      (0x00FFFFFF)
    #define PINMUX_MCASP_VAL_0       (0x00111111)
    #define PINMUX_MCASP_REG_1       (1)
    #define PINMUX_MCASP_MASK_1      (0x000FF000)
    #define PINMUX_MCASP_VAL_1       (0x00011000)
    
    //-----------------------------------------------------------------------------
    // Private Function Prototypes
    //-----------------------------------------------------------------------------
    
    //-----------------------------------------------------------------------------
    // Public Function Definitions
    //-----------------------------------------------------------------------------
    
    uint32_t MCASP_init(void)
    {
       // enable the psc and config pinmux for mcasp.
       EVMC6748_lpscTransition(PSC1, DOMAIN0, LPSC_MCASP0, PSC_ENABLE);
       EVMC6748_pinmuxConfig(PINMUX_MCASP_REG_0, PINMUX_MCASP_MASK_0, PINMUX_MCASP_VAL_0);
       EVMC6748_pinmuxConfig(PINMUX_MCASP_REG_1, PINMUX_MCASP_MASK_1, PINMUX_MCASP_VAL_1);
       
       // reset mcasp.
       MCASP->GBLCTL  = 0;
    
       // configure receive registers.
       MCASP->RMASK      = 0xFFFFFFFF;
       MCASP->RFMT       = 0x00008078;
       MCASP->AFSRCTL    = 0x00000112;
       MCASP->ACLKRCTL   = 0x000000AF;
       MCASP->AHCLKRCTL  = 0x00000000;
       MCASP->RTDM       = 0x00000003;
       MCASP->RINTCTL    = 0x00000000;
       MCASP->RCLKCHK    = 0x00FF0008;
    
       // configure transmit registers.
       MCASP->XMASK      = 0xFFFFFFFF;
       MCASP->XFMT       = 0x00008078;
       MCASP->AFSXCTL    = 0x00000112;
       MCASP->ACLKXCTL   = 0x000000AF;
       MCASP->AHCLKXCTL  = 0x00000000;
       MCASP->XTDM       = 0x00000003;
       MCASP->XINTCTL    = 0x00000000;
       MCASP->XCLKCHK    = 0x00FF0008;
    
       // config serializers (11 = xmit, 12 = rcv).
       MCASP->SRCTL11    = 0x000D;
       MCASP->SRCTL12    = 0x000E;
    
       // config pin function and direction.
       MCASP->PFUNC      = 0;
       MCASP->PDIR       = 0x14000800;
    
       //
       MCASP->DITCTL     = 0x00000000;
       MCASP->DLBCTL     = 0x00000000;
       MCASP->AMUTE      = 0x00000000;
    
       MCASP->XSTAT = 0x0000FFFF;        // Clear all
       MCASP->RSTAT = 0x0000FFFF;        // Clear all
       
       return (ERR_NO_ERROR);
    }
    
    //-----------------------------------------------------------------------------
    // Private Function Definitions
    //-----------------------------------------------------------------------------