Other Parts Discussed in Thread: CC3200
Tool/software: Code Composer Studio
Hi all,
I am trying to read I2S data from TLV320AIC3106 audio codec with a condenser mic connected to left channel.
Below given is my codec settings which is successfully written to the codec that I could read back the registers using I2C.
void tlv320aic3106init(void){
    AudioCodecPageSelect((unsigned char )0x00);
    AudioCodecRegWrite((unsigned char) CODEC_SW_RESET, 0x00);
    // clock generation and control
    AudioCodecRegWrite((unsigned char) CODEC_CLOCK_GENERATION_CONTROL, (unsigned char) 0x02);
    AudioCodecRegWrite((unsigned char) CODEC_ADDITIONAL_GPIO_CONTROL_B, (unsigned char)0x01);  
    AudioCodecRegWrite((unsigned char) CODEC_GPIO1_CONTROL,  0x28);   // clock out on gpio1 pin
    AudioCodecRegWrite((unsigned char) CODEC_SAMPLE_RATE,0XAA);//0xAA);  // fs = fsref/n
    AudioCodecRegWrite((unsigned char) CODEC_MIC_BIAS_CONTROL,   (unsigned char)0xC0);  // MIC bias
    //When selecting an input, unmute the PGAs after routing the input and powering up the ADC.
    AudioCodecRegWrite((unsigned char) CODEC_LINE2L_LEFT_ADC_CONTROL, 0x80);
    AudioCodecRegWrite((unsigned char) CODEC_LINE1L_LEFT_ADC_CONTROL, 0x7C);  // power up left ADC
    AudioCodecRegWrite((unsigned char) CODEC_LEFT_ADC_PGA_GAIN_CONTROL, 0x00); // unmute PGA
}
I am trying to initialise I2S in CPU mode,not DMA mode and read data using ISR. 
below is my I2S initialization.
void AudioCaptureRendererConfigure(unsigned char bitsPerSample,
                                    unsigned short bitRate,
                                    unsigned char noOfChannels,
                                    unsigned char RxTx,
                                    unsigned char	dma)
{
 //
    // Initialising the McASP
    //
    MAP_PRCMPeripheralClkEnable(PRCM_I2S,PRCM_RUN_MODE_CLK);
    
    unsigned long	bitClk;
    bitClk = bitsPerSample * bitRate * noOfChannels;
    dma=1;
    if(bitsPerSample == 16)
        {
            MAP_PRCMI2SClockFreqSet(512000); //(bitClk*10));//512000);  (I2S_BASE,(bitClk*10),bitClk,I2S_SLOT_SIZE_16|
            MAP_I2SConfigSetExpClk(I2S_BASE,512000,bitClk,I2S_SLOT_SIZE_16| I2S_PORT_CPU); //(I2S_BASE,512000,bitClk,I2S_SLOT_SIZE_16|
        }
    MAP_I2SIntRegister(I2S_BASE, I2SIntHandler);
    MAP_I2SIntEnable(I2S_BASE,I2S_INT_XDATA);
    if(RxTx == I2S_MODE_RX_TX)
    {
        MAP_I2SSerializerConfig(I2S_BASE,I2S_DATA_LINE_1,I2S_SER_MODE_RX,
                                 I2S_INACT_LOW_LEVEL);
    }
    if(RxTx & I2S_MODE_TX)
    {
        MAP_I2SSerializerConfig(I2S_BASE,I2S_DATA_LINE_0,I2S_SER_MODE_TX,
                                 I2S_INACT_LOW_LEVEL);
    }
}
and the I2Shandler is like below.
void I2SIntHandler(void)
{
unsigned long ulStatus;
unsigned long ulDummy;
// Get the interrupt status
ulStatus = I2SIntStatus(I2S_BASE);
// Check if there was a Transmit interrupt; if so write next data into the tx buffer and acknowledge
// the interrupt
if(ulStatus & I2S_STS_XDATA)
    {
    I2SDataPutNonBlocking(I2S_BASE,I2S_DATA_LINE_0,0xA5);
    I2SIntClear(I2S_BASE,I2S_STS_XDATA);
    I2SIntEnable(I2S_BASE,I2S_INT_XDATA);
    }
// Check if there was a receive interrupt; if so read the data from the rx buffer and acknowledge
// the interrupt
if(ulStatus & I2S_STS_RDATA)
{
    I2SDataGetNonBlocking( I2S_BASE, I2S_DATA_LINE_1,&ulDummy);
    I2SIntClear(I2S_BASE,I2S_STS_RDATA);
    I2SIntEnable(I2S_BASE,I2S_INT_XDATA);
}
}
It is not going into the handler. I put a breakpoint and trying to debug but the control is not getting inside handler.
Is my settings correct?
Thanks & regards,
Vishnu Pradeep
 
				 
		 
					 
                           
				 
				

