Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

OMAP-L138 eXperimenter Board, Audio expansion Connector Problem

$
0
0

Hello,

I have the following problem:

I want to recieve data via McASP (I2S) as a master via the Audio Expansion connector on the eXperimenter Board with the OMAP-138. The Problem is that if i want to use the Connector, I have to change DIP-Switch S7:2 to on-status. But that also means I won´t be able to use the onboard clock with 24,576 MHz and I cant realize a loop (ext. data source  -> omap -> onboard DAC (AIC3106).

Not using the 24,576 Mhz means, that i have to generate an internal clock which has a clockrate of 24Mhz which results in a sampling rate of 46,875kHz and not the intended 48kHz.

Is there any way to recieve audio data from an extern source by using the 24,576MHz clock while using the onbard DAC?

When I try to use the internal clock while the dip switch is still in off-position i can recieve something in my serializer, but sampling these values just causes loud noise. Is my configuration for i2s via McASP correct?

Here my initialisation Code:

// globally reset McASP0
   MCASP->GBLCTL  = 0;

   // configure receive registers.
   MCASP->RMASK      = 0xFFFFFFFF;
   MCASP->RFMT       = 0x000180F8;    //1 bit delay, 32 bit slot, msb first (left aligned), no rot, no pad
   MCASP->AFSRCTL    = 0x00000113;    //falling edge, int. gen. frame sync, single word, 2 slot tdm (i2s)
   MCASP->ACLKRCTL   = 0x000000A0;    //divide by 8, int. clock source, rising edge (-> 24MHz/ 8 = 3 MHz)
   MCASP->AHCLKRCTL  = 0x00008007;    //int
   MCASP->RTDM       = 0x00000003;    //tdm timeslots 1+2 (i2s)
   MCASP->RINTCTL    = 0x00000000;
   MCASP->RCLKCHK    = 0x00FF0008;

   // configure transmit registers.
   MCASP->XMASK      = 0xFFFFFFFF;
   MCASP->XFMT       = 0x00008078;
   MCASP->AFSXCTL    = 0x00000112;
   MCASP->ACLKXCTL   = 0x000000EF;    //divide by 16, int. clock source, rising edge, async
   MCASP->AHCLKXCTL  = 0x00000000;
   MCASP->XTDM       = 0x00000003;
   MCASP->XINTCTL    = 0x00000000;
   MCASP->XCLKCHK    = 0x00FF0008;

   // config serializers (11 = xmit, 9 = rcv).
   MCASP->SRCTL11    = 0x000D;
   MCASP->SRCTL9    = 0x000E;

   // config pin function and direction.
   MCASP->PFUNC      = 0;
   MCASP->PDIR       = 0xB4000800;

   //
   MCASP->DITCTL     = 0x00000000;
   MCASP->DLBCTL     = 0x00000000;
   MCASP->AMUTE      = 0x00000000;


   // 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)) {}

   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->RBUF9 = 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;

}

Thanks for your Help,

Martin Werner


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>