<?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 conflict with bluetooth transceiver</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53823/pdm-conflict-with-bluetooth-transceiver</link><description>Hi: 
 I am doing a project which will use both PDM interface and bluetooth transreceiver, PDM interface is used to receive audio data from a MEMS microphone and Bluetooth transceiver to receive user command from mobilephone. However, I found, everytime</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Sep 2021 14:06:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53823/pdm-conflict-with-bluetooth-transceiver" /><item><title>RE: PDM conflict with bluetooth transceiver</title><link>https://devzone.nordicsemi.com/thread/328241?ContentTypeID=1</link><pubDate>Mon, 06 Sep 2021 14:06:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2c81df6-e2fe-439d-a672-5b849d1db34d</guid><dc:creator>Jeffrey Haynes</dc:creator><description>&lt;p&gt;Did anyone ever figure this out?&amp;nbsp; I&amp;#39;m seeing a similar issue although in my case the PDM update basically seems to nuke the radio.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM conflict with bluetooth transceiver</title><link>https://devzone.nordicsemi.com/thread/218796?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2019 11:21:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fa4d695-1c26-4111-80fc-fb474974146a</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;&lt;em&gt;I don&amp;#39;t believe this is a buffer issue. If the PDM peripheral stops because of a lack of buffer, same result should be got when I stop the bluetooth advertising, while, in fact, the gap is gone and PDM woks normal when I stop the bluetooth.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The SoftDevice will interrupt the application and use the CPU for pre-processing of BLE events. Hence, if the buffer is filled up just as the SD interrupts the application, then the pdm_buffer_handler would not be allowed to run until the SD is finished. When not starting any advertsing or scanning, then there would be no events that would interrupt the application and possibly delay the buffer change.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However I agree that it does not appear to be the case as the DIN gaps occur after the STARTED event when there should be plenty of space in the buffer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In screenshot 1, I see that the DIN line is pulled low aperiodically, while the advertisment events should be occuring every 40ms based on the advertisment interval set in the main.c . I see that you are using the ble_app_uart example, which doesnt set any scan response data so is the periods when the DIN line is low when you are connected to the nRF52840 with aphone and transmitting data to the nRF52840?&lt;/p&gt;
&lt;p&gt;I am afraid that I do not have a PDM device to generate a PDM output to sample with the PDM peripheral. I will see if I can get hold of one to do some testing&amp;nbsp;today.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM conflict with bluetooth transceiver</title><link>https://devzone.nordicsemi.com/thread/218158?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2019 09:30:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64257fe9-12b7-4b27-9543-e2f93bd089f1</guid><dc:creator>Kyle@Shanghai</dc:creator><description>&lt;p&gt;Hi bjorn:&lt;/p&gt;
&lt;p&gt;I made the buffer size to 4096 and it has no change.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t believe this is a buffer issue. If the PDM peripheral stops because of a lack of buffer, same result should be got when I stop the bluetooth advertising, while, in fact, the gap is gone and PDM woks normal&amp;nbsp;when I stop the bluetooth.&lt;/p&gt;
&lt;p&gt;As you advise, I add &lt;span&gt;toggle pins in the PDM event handler, here is the result:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img height="230" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/1572859206_2800_1_2900_.jpg" width="494" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1,BLE advertising enabled.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img height="273" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1572859498448v1.png" width="586" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2,BLE advertising disabled&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It will be really appreciate if you could run my case in your side, I believe it will speed up our debug process, saving the&amp;nbsp;time both your and mine.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM conflict with bluetooth transceiver</title><link>https://devzone.nordicsemi.com/thread/217911?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2019 09:58:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e50b1ff-4ee6-40e7-a20c-7dd61391638e</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Ok, then I think we can rule out interference from the RADIO.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you just try to double the buffer size? Just want to make sure this isnt a buffer issue.&lt;/p&gt;
&lt;p&gt;Also it would be nice if you could log or toggle pins when you get the&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;NRF_PDM_EVENT_STARTED&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;NRF_PDM_EVENT_STOPPED&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;NRF_PDM_EVENT_END&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;events in the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;nrfx_pdm_irq_handler in nrfx_pdm.c&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM conflict with bluetooth transceiver</title><link>https://devzone.nordicsemi.com/thread/217863?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2019 02:27:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e849ca9-330f-4b8a-9e01-e764606a1c1d</guid><dc:creator>Kyle@Shanghai</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi bjorn:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I tried P0.26 and P0.27, but it doesn&amp;#39;t help, same as before.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM conflict with bluetooth transceiver</title><link>https://devzone.nordicsemi.com/thread/217683?ContentTypeID=1</link><pubDate>Thu, 31 Oct 2019 08:16:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:260e5e43-546e-4855-9a3a-3280fa369869</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Kyle,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I see that you&amp;#39;re initializing the PDM peripheral with the CLK and DIN pins set to 37 and 38 respectively, i.e.&amp;nbsp;PSEL.CLK and&amp;nbsp;PSEL.DIN are set to Port 1, pin 5 and Port 1, pin 6. Looking at the &lt;a title="Pin assignments" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/pin.html?cp=3_0_0_6_0"&gt;Pin assignments&lt;/a&gt; in the nRF52840 Product Specification, these pins should only used for low frequency signal due to their proximity to the Radio power supply and antenna pins.&amp;nbsp;By l&lt;span&gt;ow frequency signals we mean signals with a frequency up to 10 kHz. So it could be that the RADIO is affecting the DIN pin.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you try using pins that are not restricted to&amp;nbsp;low frequency signals, e.g. P0.26 and P0.27 and see if the behavior persits?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM conflict with bluetooth transceiver</title><link>https://devzone.nordicsemi.com/thread/217644?ContentTypeID=1</link><pubDate>Thu, 31 Oct 2019 02:47:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90851fc0-5072-4fb0-b3bb-25554269cbee</guid><dc:creator>Kyle@Shanghai</dc:creator><description>&lt;p&gt;Hi bjorn:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think so, can you have at look at my code-- main.c, line 702 to 714, this is how I handle the PDM buffer.&amp;nbsp;Every time I receive the buffer request, I call&amp;nbsp;nrfx_pdm_buffer_set function to feed a buffer to PDM driver without delay, so I don&amp;#39;t think this is cause by lack of buffer.&lt;/p&gt;
&lt;p&gt;I do a experiment to prove this:&lt;/p&gt;
&lt;p&gt;1, I modify the PDM callback function like the following, each time when a buffer is requested or released I will invert an LED.&lt;/p&gt;
&lt;p&gt;2, I connect the pins controlling these LED to my logical analyser, they are P0.14 for LED1, P0.15 for LED2, P0.16 for LED3.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void pdm_buffer_handler(nrfx_pdm_evt_t const * const p_evt)
{
	if(p_evt-&amp;gt;buffer_requested == true)
	{
		bsp_board_led_invert(2);
		nrfx_pdm_buffer_set(&amp;amp;pdm_buffer[buffer_ptr][0], PDM_BUFFER_BLOCK_LENGTH);
		buffer_ptr = (buffer_ptr + 1) % PDM_BUFFER_BLOCK_NUM;
	}
	
	if(p_evt-&amp;gt;buffer_released != NULL)
	{
		bsp_board_led_invert(1);
	}	

	if(p_evt-&amp;gt;error != NRFX_PDM_NO_ERROR)
	{
		bsp_board_led_invert(3);
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is the result I got:&lt;/p&gt;
&lt;p&gt;&lt;img height="242" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1572489764796v1.png" width="509" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;As you can see, LED2 and LED3 keep toggling even in the gaps, so I believe no&amp;nbsp;&lt;span&gt;NRF_PDM_EVENT_END happend.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM conflict with bluetooth transceiver</title><link>https://devzone.nordicsemi.com/thread/217567?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2019 14:19:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab8762dd-6674-42e8-9aab-a25338ecee47</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;HI Kyle,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;the PDM driver should place all the received data directly to DMA without being affected by the SoftDevice using the CPU for BLE purposes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you check if the buffers are full when the PDM transmission stops, i.e. if the NRF_PDM_EVENT_END occurs just before the gaps?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If this is the case, then&amp;nbsp; it is possible to get notified by the SoftDevice in advance of any BLE activity by using the Radio Notification feature. This way you can set up a new and empty buffer just before a BLE activity&amp;nbsp;to ensure contineous sampling.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>