I am trying to get the INMP441 I2S digital microphone working with the Teensy 3.1. The mic has good S/N Ratio and I don't need pre-amps etc..., so it really simplifies design. If I can get it working that is.... I have written some code because the Audio Library is not really set up to use this microphone due to clock specifics. The data sheet is here:
My code is:
I checked with the oscilloscope. I know that the Frame Sync and Bit Clock are working properly (64 clocks per frame, 2 words per frame), and also that the Microphone is indeed returning data in the serial data line. The receiver (Teensy) mode is asynchronous, which I decided from pg. 1324 of Manual.
The issue is that the I2S0_RDR0 register doesn't show any data, just a 0. I have tried both L and R channels and no luck.
Code:
http://www.invensense.com/mems/microphone/documents/INMP441.pdf
My code is:
Code:
... Clock & Pin init, etc...
//Receive Init
I2S0_RCSR = 0x0; //Disable Receive as per Data sheet
I2S0_RCR1 |= 0x1; //Sets FIFO Watermark to 1
I2S0_RCR4 |= 0x11F19; //Internal Frame Sync. MSB. Early Frame Sync. SYWD = 32. FRSZ = 2.
I2S0_RCR5 |= 0x1F1F1F00; //32 Bits per Word. 32 Bits in First Word. Shifted 32. (The Mic really sends 24, could this be the problem?)
I2S0_RCSR = 0x4000000; //FIFO Reset
I2S0_RCSR |= 0x80000100; //Enable I2S and FIFO Enable
while(1){
delay(1);
pr(&I2S0_RDR0); //This reads register contents (Data?)
led_red = 0;
}
I checked with the oscilloscope. I know that the Frame Sync and Bit Clock are working properly (64 clocks per frame, 2 words per frame), and also that the Microphone is indeed returning data in the serial data line. The receiver (Teensy) mode is asynchronous, which I decided from pg. 1324 of Manual.
The issue is that the I2S0_RDR0 register doesn't show any data, just a 0. I have tried both L and R channels and no luck.