Microphone application using RDB1768 board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Microphone application using RDB1768 board

698 Views
lpcware
NXP Employee
NXP Employee
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!
0 Kudos
12 Replies

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by paavo91 on Thu Jan 01 09:52:36 MST 2015
Bump. Could anybody share code for receiving data from UDA1380? I2S configuration and UDA both? Thanks!
0 Kudos

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wchpikus on Thu Jul 17 05:21:57 MST 2014
coul You send me the orginal code to linie_in?
How to setup uda registry to grub analog and send this to i2s?
0 Kudos

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Wouter on Thu Feb 09 07:52:20 MST 2012
I have been looking into this problem and have solved it.

Mic's that come with a jackplug are usually electret microphones. These type of microphones need a (small) power supply in order to work properly. This power supply is missing on the RDB1768 board, causing the microphone to be unable to deliver a decent signal.

Luckily, the power supply for an electret mic is very simple; just a single resistor to a positive power supply. In this case it is best to take a good, stable power supply, the Vadcp would be a logical choice.

[IMG]http://i43.tinypic.com/kcmg4j.png[/IMG]

[IMG]http://i42.tinypic.com/4u9bh0.jpg[/IMG]

With the mic that I was using, it was best to set an 0dB additional gain, which gave quite a good result!

[SIZE=2][LEFT][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Power control[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]vF_I2C_ClearBuffer();
I2CWriteLength = 4;
I2CReadLength = 0;
I2CMasterBuffer[0] = UDA1380_ADDR;
I2CMasterBuffer[1] = UDA1380_PWRCTL_02;
[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//for line-in:
// [U]temp[/U] = (1 << 13) | (1 << 10) | ( 1 << 8) | (1 << 7) | (1 << 6) | (1 << 3) | (1<<2) | (1 << 1) | (1<<0);[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//for [U]mic[/U]:[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]temp = (1 << 13) | (1 << 10) | ( 1 << 8) | (1 << 7) | (1 << 6) | (1 << 4) | (1<<2) | (1 << 1) | (1<<0);
I2CMasterBuffer[2] = ([/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint8_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) ((temp >> 8) & 0xff);
I2CMasterBuffer[3] =([/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint8_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])(temp & 0xff);[/LEFT]
I2CEngine();
[/SIZE]
[SIZE=2][LEFT]vF_I2C_ClearBuffer();
I2CWriteLength = 4;
I2CReadLength = 0;
I2CMasterBuffer[0] = UDA1380_ADDR;
I2CMasterBuffer[1] = UDA1380_ADCSET_22;
[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//for line-in:
// [U]temp[/U] = 0x00;[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//for [U]mic[/U]:[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/LEFT]
[SIZE=2]temp = (1<<3) | (1<<2)| (0<<8);
[/SIZE][LEFT]I2CMasterBuffer[2] = ([/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint8_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) ((temp >> 8) & 0xff);
I2CMasterBuffer[3] =([/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint8_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])(temp & 0xff);[/LEFT]
I2CEngine();

Regards,
Wouter
[/SIZE]
0 Kudos

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Oct 19 01:56:07 MST 2011
I have done a bit of experimentation at this end, and I think that  part of the problem is simply that the signal delivered by many  microphones is simply too low for the audio system/codec to handle.  Certainly the microphones that I have access to are close to useless here.

Anyway, if you modify your code to have a 0 gain on the microphone  input, then plug a line-in source into the microphone socket of the  board, then the circuitry definitely seems to work. For example I can  change our standard RDB1768cmsis2_AudioMeter to take its souce from the  microphone rather than line-in socket. If I then connect up my ipod, the  output through the headphone socket between the original and modified  applications is basically identical (and quite acceptable to my  non-audiophile ear).  It might be worth trying to put some form of amplifier in place to boost your microphone input to line level, something like a Griffin iMic.

Anyway, I don't believe that there is an issue here with the board circuitry - but is likely to be a setup or other issue with the uda1380 codex itself. I suspect to make any further progress, we would need some input from a UDA1380 expert from NXP.

Regards,
CodeRedSupport
0 Kudos

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CLD on Tue Oct 18 08:23:08 MST 2011
Can anyone help me?
The problem also occurs in another RDB1768 board.

Can someone try to change AudioMeter example in order to use microphone instead of LINE_IN?
0 Kudos

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CLD on Mon Sep 26 08:39:37 MST 2011
I've been away from this project last months, but now the problem came back to my life.
I had tested all power pins before I paused the project. No power problems. I can't see any problems in I2S setup. I still suspect that there's a problem in UDA1380 setup for capturing through MIC input.

any help?
0 Kudos

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon May 23 09:24:48 MST 2011
When you see the drop out in digital audio output, can you please probe the power pins on the codec?

Or, if you have done this and they are fine, then please confirm?

Thanks,
0 Kudos

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CLD on Fri May 20 11:26:02 MST 2011
Hello!

Original code, using LINE_IN works fine. The problem occurs only when I switch to MIC_IN, by setting SEL_LNA and SEL_MIC in UDA1380. In this case there's a lot of noise and audio periodically cuts out.
0 Kudos

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri May 20 09:58:12 MST 2011
Have you tried the line level input - do you see the problem?

The schematic is pretty straight forward if you look, there is nothing between the mic input and the ADC/Codec other than a coupling capacitor.

If it also happens on the line input and you are looking at the digits coming out of the codec and they go to zero, then also check the power supply to the part.
0 Kudos

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CLD on Fri May 20 06:58:09 MST 2011
Does anybody here have this board? It would be interesting to me someone test these changes in AudioMeter project.
0 Kudos

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CLD on Wed May 18 14:29:28 MST 2011
Hi.

Yes, I did. input signal's amplitude is ok. output signal DC level is increasing and when it reaches specif limiar it occurs a plop followed by the  cut out.
0 Kudos

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Wed May 18 03:03:37 MST 2011
Hello CLD,

did you check your input and output signals on a 2 channel scope? And see what their amplitudes are?
0 Kudos