<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Kinetis MicrocontrollersのトピックRe: Unable to read from SPH0645LM4H microphone</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647114#M39299</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Niranjan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked at your code,&amp;nbsp;your configuration for SAI clock is not correct. In your code, you configured the sample rate as 16kHz. But you should configure it to in between 32kHz to 64kHz.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the following comment in the MEMS microphone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Over Sampling Rate is fixed at 64 therefore&amp;nbsp;the WS signal must be BCLK/64 and synchronized&amp;nbsp;to the BCLK. Clock frequencies from 2.048Mhz to&amp;nbsp;4.096MHz are supported so sampling rates from 32KHz&amp;nbsp;to 64KHz can be had by changing the clock frequency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the bit width configured is not correct as well. From the timing diagram in the microphone spec, you need to configure bit width to 32bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hao&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Oct 2016 07:17:03 GMT</pubDate>
    <dc:creator>cutworth</dc:creator>
    <dc:date>2016-10-26T07:17:03Z</dc:date>
    <item>
      <title>Unable to read from SPH0645LM4H microphone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647110#M39295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I am trying to record audio from&amp;nbsp;SPH0645LM4H MEMS microphone using K82 - series MCU (Master).&lt;/P&gt;&lt;P&gt;The data sheet of the mic says that, no codec is needed and the audio data can be read directly from the mic through I2S &amp;nbsp;interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mic data can be read when &amp;nbsp;SEL and WS llines are high.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I am unable to read any data, can you guys please help me with this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPH0645LM4H data sheet:&amp;nbsp;&lt;/SPAN&gt;&lt;A class="link-titled" href="http://www.knowles.com/kor/content/download/5988/105771/version/4/file/SPH0645LM4H-BRevB.PDF" title="http://www.knowles.com/kor/content/download/5988/105771/version/4/file/SPH0645LM4H-BRevB.PDF"&gt;http://www.knowles.com/kor/content/download/5988/105771/version/4/file/SPH0645LM4H-BRevB.PDF&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 11:14:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647110#M39295</guid>
      <dc:creator>niranjan_rao</dc:creator>
      <dc:date>2016-10-18T11:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to read from SPH0645LM4H microphone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647111#M39296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Niranjan,&lt;/P&gt;&lt;P&gt;I have downloaded file from the link, From hardware connection, you should connect the follwing signals if you use only one mic.&lt;/P&gt;&lt;P&gt;connect the SAI_Rx_BCLK of K82 to CLK of Mic&lt;/P&gt;&lt;P&gt;connect the SAI_Rx_SYNC of K82 to WS of Mic&lt;/P&gt;&lt;P&gt;connect the SAI_Rx_DATA of K82 to DATA of Mic with 100 ohm pull-down resistor.&lt;/P&gt;&lt;P&gt;connect the SELECT of Mic to GND or 3.3V, either one is okay.&lt;/P&gt;&lt;P&gt;From software, you can program the SAI receiver in master mode, 32 bits width, two slots. I suppose that the code of SAI has issue, can you see the signal of SAI_Rx_SYNC and SAI_Rx_BCLK&amp;nbsp; via a scope?&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Xiangjun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 04:16:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647111#M39296</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-10-19T04:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to read from SPH0645LM4H microphone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647112#M39297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xiangjun,&lt;/P&gt;&lt;P&gt;Thank you, I can s&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;ee the SAI_Rx_SYNC and SAI_Rx_BCLK &amp;nbsp; signals via scope. I can also see some data signal in the SAI_Rx data line&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2016 14:31:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647112#M39297</guid>
      <dc:creator>niranjan_rao</dc:creator>
      <dc:date>2016-10-20T14:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to read from SPH0645LM4H microphone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647113#M39298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/xiangjun.rong"&gt;xiangjun.rong&lt;/A&gt;‌&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I modified the example code to receive PCM data from the mic and I don't receive any data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt;I have attached my code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt;Thank you&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2016 17:48:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647113#M39298</guid>
      <dc:creator>niranjan_rao</dc:creator>
      <dc:date>2016-10-25T17:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to read from SPH0645LM4H microphone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647114#M39299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Niranjan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked at your code,&amp;nbsp;your configuration for SAI clock is not correct. In your code, you configured the sample rate as 16kHz. But you should configure it to in between 32kHz to 64kHz.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the following comment in the MEMS microphone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Over Sampling Rate is fixed at 64 therefore&amp;nbsp;the WS signal must be BCLK/64 and synchronized&amp;nbsp;to the BCLK. Clock frequencies from 2.048Mhz to&amp;nbsp;4.096MHz are supported so sampling rates from 32KHz&amp;nbsp;to 64KHz can be had by changing the clock frequency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the bit width configured is not correct as well. From the timing diagram in the microphone spec, you need to configure bit width to 32bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hao&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 07:17:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647114#M39299</guid>
      <dc:creator>cutworth</dc:creator>
      <dc:date>2016-10-26T07:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to read from SPH0645LM4H microphone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647115#M39300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;As Cutworth said that the bit width is 32 bits instead of 16 bits. BTW, the code you refered is based on Sgtl5000, which has I2C port so that Kinetis can configure the Sgtl5000. But the SPH0645LM4H does not have I2C interface, so the I2C code is unnecessary. The data you received is from two slots, but only one slot is valid, another is invalid.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Xiangjun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 08:52:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647115#M39300</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-10-26T08:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to read from SPH0645LM4H microphone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647116#M39301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There was a small confusion in the code I sent previously, I am sorry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please check the code attached here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include &amp;lt;fsl_port.h&amp;gt;&lt;BR /&gt;#include &amp;lt;fsl_gpio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;fsl_debug_console.h&amp;gt;&lt;BR /&gt;#include &amp;lt;fsl_sai.h&amp;gt;&lt;BR /&gt;#include &amp;lt;dbgutil.h&amp;gt;&lt;BR /&gt;#include &amp;lt;timer.h&amp;gt;&lt;/P&gt;&lt;P&gt;bool isFinished = false;&lt;BR /&gt;uint32_t temp[2000];&lt;BR /&gt;sai_handle_t rxHandle = {0};&lt;/P&gt;&lt;P&gt;static sai_config_t config;&lt;BR /&gt;sai_transfer_format_t format;&lt;BR /&gt;sai_transfer_t xfer;&lt;/P&gt;&lt;P&gt;static void callback(I2S_Type *base, sai_handle_t *handle, status_t status, void *userData)&lt;BR /&gt;{&lt;BR /&gt; if (kStatus_SAI_RxIdle == status)&lt;BR /&gt; {&lt;BR /&gt; isFinished = true;&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void sai_init(sai_config_t config)&lt;BR /&gt;{&lt;BR /&gt; PRINTF("Enable I2S pins...\r\n");&lt;/P&gt;&lt;P&gt;CLOCK_EnableClock(kCLOCK_PortA);&lt;/P&gt;&lt;P&gt;// DM_DO (Data) and // DM_WS (FS, Word/Frame Sync)&lt;BR /&gt; port_pin_config_t pin_config = {0};&lt;/P&gt;&lt;P&gt;pin_config.pullSelect = kPORT_PullDown;&lt;BR /&gt; pin_config.mux = kPORT_MuxAlt6;&lt;/P&gt;&lt;P&gt;PORT_SetPinConfig(PORTA, 15U, &amp;amp;pin_config); //DO&lt;BR /&gt; PORT_SetPinConfig(PORTA, 16U, &amp;amp;pin_config); //WS&lt;/P&gt;&lt;P&gt;PORT_SetPinMux(PORTA, 17U, kPORT_MuxAlt6); // DM_CLK (MCLK/BCLK)&lt;/P&gt;&lt;P&gt;PORT_SetPinMux(PORTA, 18U, kPORT_MuxAsGpio); // DM_SEL&lt;/P&gt;&lt;P&gt;const gpio_pin_config_t OUT = {kGPIO_DigitalOutput, 0};&lt;BR /&gt; GPIO_PinInit(GPIOA, 18U, &amp;amp;OUT);&lt;/P&gt;&lt;P&gt;PRINTF("Configuring SAI...\r\n");&lt;/P&gt;&lt;P&gt;SAI_RxGetDefaultConfig(&amp;amp;config);&lt;BR /&gt; config.protocol = kSAI_BusI2S;&lt;BR /&gt; config.syncMode = kSAI_ModeAsync;&lt;BR /&gt; SAI_RxInit(I2S0, &amp;amp;config);&lt;/P&gt;&lt;P&gt;/* Configure the audio format */&lt;BR /&gt; format.bitWidth = kSAI_WordWidth32bits;&lt;BR /&gt; format.channel = 0U;&lt;BR /&gt; format.sampleRate_Hz = kSAI_SampleRate32KHz;&lt;BR /&gt; format.masterClockHz = 64U * format.sampleRate_Hz;&lt;BR /&gt; format.protocol = config.protocol;&lt;BR /&gt; format.stereo = kSAI_Stereo;&lt;BR /&gt; format.watermark = FSL_FEATURE_SAI_FIFO_COUNT / 2U;&lt;/P&gt;&lt;P&gt;SAI_TransferRxCreateHandle(I2S0, &amp;amp;rxHandle, callback, NULL);&lt;BR /&gt; SAI_TransferRxSetFormat(I2S0, &amp;amp;rxHandle, &amp;amp;format, CLOCK_GetCoreSysClkFreq(), format.masterClockHz);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;void error(char *msg) {&lt;BR /&gt; PRINTF("ERROR: %s\r\n", msg);&lt;BR /&gt; while(true) {}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;int main (void)&lt;BR /&gt;{&lt;BR /&gt; board_init();&lt;BR /&gt; board_console_init(BOARD_DEBUG_BAUD);&lt;/P&gt;&lt;P&gt;sai_init(config);&lt;/P&gt;&lt;P&gt;PRINTF("Listening...\r\n");&lt;/P&gt;&lt;P&gt;xfer.data = (uint8_t *) temp;&lt;BR /&gt; xfer.dataSize = sizeof(temp);&lt;/P&gt;&lt;P&gt;GPIO_WritePinOutput(GPIOA, 18U, true);&lt;/P&gt;&lt;P&gt;PRINTF("%x\r\n", SAI_TransferReceiveNonBlocking(I2S0, &amp;amp;rxHandle, &amp;amp;xfer));&lt;/P&gt;&lt;P&gt;GPIO_WritePinOutput(GPIOA, 18U, false);&lt;/P&gt;&lt;P&gt;while (isFinished != true) {}&lt;/P&gt;&lt;P&gt;PRINTF("FINISHED.\r\n");&lt;BR /&gt; dbg_xxd("AUDIO", xfer.data, xfer.dataSize);&lt;/P&gt;&lt;P&gt;while(true)&lt;BR /&gt; {&lt;BR /&gt; delay(10000);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 09:43:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-read-from-SPH0645LM4H-microphone/m-p/647116#M39301</guid>
      <dc:creator>niranjan_rao</dc:creator>
      <dc:date>2016-10-26T09:43:18Z</dc:date>
    </item>
  </channel>
</rss>

