lpcware

Microphone application using RDB1768 board

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by CLD on Tue May 17 13:01:41 MST 2011
Hi.

I've made some changes in RDB1768cmsis_AudioMeter example project using LPCXpresso. In original project the UDA1380 Audio codec is configured as:
Input: LINE_IN (VINL and VINR);
Output: HEADPHONE (VOUTLHP and VOUTRHP).

It work fine.

So, I changed the codec configuration in uda1380.c in order to use microphone as input (VINM). The application should work this way:
1) UDA1380 captures sound in VINM, and transmit it to LPC1768 through I2S.
2) LPC1768 receives I2S data and send it back to UDA1380.
3) UDA1380 provides sounds to headphone.

But I face a problem: sound periodically cut out. It appears the gain decreases until it cuts out, and it returns to configured gain, decreasing and cutting out again, and again and again...

I noticed that during the cuts, UDA1380 sends ZEROs in DATAO, so I supose the problem is between MIC AMP, and DATA OUTPUT INTERFACE.
I think I'm configuring the CODEC correctly.

Here you can see the part of code that I changed.

// Power control
vF_I2C_ClearBuffer();
I2CWriteLength = 4;
I2CReadLength = 0;
I2CMasterBuffer[0] = UDA1380_ADDR;
I2CMasterBuffer[1] = UDA1380_PWRCTL_02;
temp = [COLOR=Red](1 << 13) | (1 << 10) | ( 1 << 8) | (1 << 7) | (1 << 6) | (1 << 4) | (1<<2) | (1 << 1) | (1<<0)[/COLOR];
I2CMasterBuffer[2] = (uint8_t) ((temp >> 8) & 0xff);
I2CMasterBuffer[3] =(uint8_t)(temp & 0xff);
I2CEngine();

// ADC settings
vF_I2C_ClearBuffer();
I2CWriteLength = 4;
I2CReadLength = 0;
I2CMasterBuffer[0] = UDA1380_ADDR;
I2CMasterBuffer[1] = UDA1380_ADCSET_22;
temp = [COLOR=red](1<<3) | (1<<2) | (1<<1) | (7<<8) | (1<<12)[/COLOR];
I2CMasterBuffer[2] = (uint8_t) ((temp >> 8) & 0xff);
I2CMasterBuffer[3] =(uint8_t)(temp & 0xff);;
I2CEngine();



Can anybody help tell me what I'm doing wrong.

Thanks!

Outcomes