<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48933/pdm-example-in-sdk-15-3-0</link><description>I cannot find an example project for using the PDM module on SDK 15.3.0. Can you please direct me to where I will be able to find such an example project? 
 Thank you.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Jul 2019 13:07:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48933/pdm-example-in-sdk-15-3-0" /><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/198732?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 13:07:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c418e51-2435-474e-bf57-af35fe3f553e</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Could you please create a new ticket where you explain your problem, and what your application is supposed to do in order for us to get a better overview of what exactly is wrong. This will also ensure this ticket won&amp;#39;t derail into something completely off-topic.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/198713?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 12:42:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c253fe0c-a90a-4f73-a049-cb8982b05981</guid><dc:creator>sara</dc:creator><description>&lt;p&gt;And when I read the pdm documentation it says I need to change the PSEL.CLK register value? Then how should I do it and with what value? same for PSEL.DIN register. I am confused a lot. Please suggest me the solution to all my doubts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/198594?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 06:48:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57ad514c-1ffb-440d-9d40-2a19db7c737f</guid><dc:creator>sara</dc:creator><description>&lt;p&gt;The error was solved, I had not enabled&amp;nbsp;&lt;/p&gt;
&lt;p&gt;#ifndef PDM_ENABLED&lt;br /&gt;#define PDM_ENABLED 1&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I programmed the code but now question is how should i check whether pdm is working properly or not? I am not storing anything in flash. For now, I just need the data of pdm so how should I test it to get the results&lt;pre class="ui-code" data-mode="text"&gt;static void bsp_event_handler(bsp_event_t event)
{
    ret_code_t err_code;

    switch (event)
    {
        case BSP_EVENT_SLEEP:
            sleep_mode_enter();
            break; // BSP_EVENT_SLEEP

        case BSP_EVENT_DISCONNECT:
            err_code = sd_ble_gap_disconnect(m_conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            if (err_code != NRF_ERROR_INVALID_STATE)
            {
                APP_ERROR_CHECK(err_code);
            }
            break; // BSP_EVENT_DISCONNECT

        case BSP_EVENT_WHITELIST_OFF:
            if (m_conn_handle == BLE_CONN_HANDLE_INVALID)
            {
                err_code = ble_advertising_restart_without_whitelist(&amp;amp;m_advertising);
                if (err_code != NRF_ERROR_INVALID_STATE)
                {
                    APP_ERROR_CHECK(err_code);
                }
            }
            break; // BSP_EVENT_KEY_0
          case BSP_EVENT_KEY_1:
            NRF_LOG_INFO(&amp;quot;\n Press Button key 1\n&amp;quot;);
            NRF_LOG_INFO(&amp;quot;\n Erase the flash content !!\n&amp;quot;);
//            err_code = pcm_pstorage_eraseall();
//            APP_ERROR_CHECK(err_code);
            break;

         case BSP_EVENT_KEY_2:
            NRF_LOG_INFO(&amp;quot;\n Start:PDM --&amp;gt; PCM\n&amp;quot;);
            err_code =  nrf_drv_pdm_start(); 
            APP_ERROR_CHECK(err_code);
            break;

         case BSP_EVENT_KEY_3:
            NRF_LOG_INFO(&amp;quot;\n Stop:PDM --&amp;gt; PCM\n&amp;quot;);
            // stop audio sample
            nrf_drv_pdm_stop();
            break;

        default:
            break;
    }
}









static void drv_audio_pdm_event_handler(uint32_t *p_buffer, uint16_t length)
{
	m_buffer_handler((int16_t *)p_buffer, length);
        int i;
//        for(i=0;i&amp;lt;= length;i++)
//        {
//          NRF_LOG_INFO(&amp;quot;%s &amp;quot;,&amp;amp;p_buffer[i]);
//        }
//        NRF_LOG_INFO(&amp;quot;\n &amp;quot;);
          NRF_LOG_INFO(&amp;quot;pdm event handler \n&amp;quot;);

}


uint32_t drv_audio_init(drv_audio_buffer_handler_t buffer_handler)
{
//    nrf_drv_pdm_config_t pdm_cfg = NRF_DRV_PDM_DEFAULT_CONFIG(CONFIG_IO_PDM_CLK,
//                                                              CONFIG_IO_PDM_DATA,
//                                                              m_pdm_buff[0],
//                                                              m_pdm_buff[1],
//                                                              CONFIG_PDM_BUFFER_SIZE_SAMPLES);
    nrf_drv_pdm_config_t pdm_cfg = NRF_DRV_PDM_DEFAULT_CONFIG(CONFIG_IO_PDM_CLK,CONFIG_IO_PDM_DATA);
    
    if (buffer_handler == NULL)
    {
        return NRF_ERROR_INVALID_PARAM;
    }
    
    m_buffer_handler    = buffer_handler;
    pdm_cfg.gain_l      = CONFIG_PDM_GAIN;
    pdm_cfg.gain_r      = CONFIG_PDM_GAIN;
    

    return nrf_drv_pdm_init(&amp;amp;pdm_cfg, drv_audio_pdm_event_handler);
}










int main(void)
{
    bool erase_bonds;

    // Initialize.
    log_init();
    timers_init();
    buttons_leds_init(&amp;amp;erase_bonds);
    power_management_init();
    ble_stack_init();
    gap_params_init();
    gatt_init();
    advertising_init();
    services_init();
    conn_params_init();
    peer_manager_init();

    // Start execution.
    NRF_LOG_INFO(&amp;quot;Template example started.&amp;quot;);
    application_timers_start();

//    advertising_start(erase_bonds);
    uint32_t err_code;
    err_code = drv_audio_init(drv_audio_pdm_event_handler);
    APP_ERROR_CHECK(err_code);
    
    // Enter main loop.
    for (;;)
    {
        idle_state_handle();
    }
}
&lt;/pre&gt;.For your reference, I am attaching my code snippet&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have checked the clk pin on Oscilloscope , the clock is not being generated.In order to generate clk at pin number 22 of nrf52 DK board should I define pin clk as&amp;nbsp;#define CONFIG_IO_PDM_CLK 0x22 or 0x16 (hex value of 22 )instead of 0x22?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/198583?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 04:53:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52e1bdc9-bbb2-4c1c-806a-a407afa96c7c</guid><dc:creator>sara</dc:creator><description>&lt;p&gt;yes I have set the paths correctly.I have added&amp;nbsp;#include &amp;quot;nrf_drv_pdm.h&amp;quot; in main .c file , then added the following in the&amp;nbsp; &amp;nbsp;.emProject file&amp;nbsp;&amp;lt;file file_name=&amp;quot;../../../../../../modules/nrfx/drivers/src/nrfx_pdm.c&amp;quot; /&amp;gt;&amp;nbsp; is there anything else I am missing?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And I m using SES too. SDK ver 15.3.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/198582?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 04:45:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c91504f-24a8-4ff9-980e-6a6edaff72b0</guid><dc:creator>sarnab</dc:creator><description>&lt;p&gt;Hmm, that is strange. What IDE are you using? I am on Segger Embedded Studio (SES). Are you sure your include paths are set correctly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/198579?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 03:49:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0139abb0-4d00-4363-929e-9a72950dc47e</guid><dc:creator>sara</dc:creator><description>&lt;p&gt;yes it takes me to file to the file and when I right click on&amp;nbsp;nrf_drv_pdm_start it takes me to its macro definition in nrfx_drv_pdm.h&amp;nbsp; as&amp;nbsp;&amp;nbsp;nrfx_pdm_start&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/198570?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2019 23:55:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce4e5b78-df1a-494d-a43d-f6d9729b48f2</guid><dc:creator>sarnab</dc:creator><description>&lt;p&gt;when you right click on nrfx_pdm.h and select &amp;#39;go to definition&amp;#39; does it take you to the file?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/198569?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2019 23:52:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2e0f09d-1fe1-4462-a67b-813742226824</guid><dc:creator>sara</dc:creator><description>&lt;p&gt;Yes, I have included the nrfx_pdm.h but getting nrfx_pdm_init undefined and nrfx_pdm_start undefined references. For that what should I do?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/198566?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2019 22:37:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0adfd1ba-eced-47b6-ba03-afefe19e9cd4</guid><dc:creator>sarnab</dc:creator><description>&lt;p&gt;Hi Sara, I was able to get it working though I have not extensively tested if the data is valid. To get the nrfx_pdm_xxx() functions you have to include nrfx_pdm.h in your project. Hope that helps. Also if you are able to get meaningful data please let me know what you did!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/198443?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2019 12:08:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb33d72f-0df0-4c5f-b22c-0564721abcd5</guid><dc:creator>sara</dc:creator><description>&lt;p&gt;Hi, Sarnab I too, have the same question as yours. So how far have you reached?I tried the example which Simonr have provided the link for the example. But I am getting the following errors:&lt;/p&gt;
&lt;p&gt;undefined reference to `nrfx_pdm_init&amp;#39; and undefined reference to `nrfx_pdm_start&amp;#39;&lt;/p&gt;
&lt;p&gt;@ Simonr if you have any idea about how can I solve the above errors?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/195269?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2019 07:33:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d8da225-b175-4e43-8f76-0ca8f9e1ffa8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;No, I&amp;#39;m sorry but we do not have any tutorials using the PDM module and the SoftDevice S140. I still think the example from the last reply will be your best bet here. Or we could hope that someone in the community has done something similar before.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/195223?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 18:53:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ba2f40d-9791-454e-8676-0a653e5eeafa</guid><dc:creator>sarnab</dc:creator><description>&lt;p&gt;Is there any other tutorial or example that uses the nRF52840 PDM module with the SD140?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM example in SDK 15.3.0</title><link>https://devzone.nordicsemi.com/thread/194521?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2019 07:33:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20b606f8-5f64-45a3-9fb1-4bb9a484e87f</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Sarnab&lt;/p&gt;
&lt;p&gt;I&amp;#39;m afraid we don&amp;#39;t have a PDM example as part of our nRF5 SDK. However, &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/pdm-example-on-the-nrf52832"&gt;this example for PDM&lt;/a&gt; in SDK 11 was made by one of my colleagues and should be usable in newer SDKs with some tweaks.&lt;/p&gt;
&lt;p&gt;You could also check out the &lt;a href="https://www.nordicsemi.com/Software-and-Tools/Development-Kits/Nordic-Thingy-52/Download#infotabs"&gt;Thingy:52 SDK&lt;/a&gt; which uses the PDM audio drivers.&lt;/p&gt;
&lt;p&gt;Best of luck and regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>