<?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>application timer + pwm</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27524/application-timer-pwm</link><description>Hi 
 I generate a pwm signal via changing the state of one characteristic. In general, the pwm works fine. But the problem occurs when I add the timer which is responsible to switch on and off the pwm signal for 500ms interval. In this case, the timer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Dec 2017 18:03:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27524/application-timer-pwm" /><item><title>RE: application timer + pwm</title><link>https://devzone.nordicsemi.com/thread/108693?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2017 18:03:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e411445-3bd7-4549-8620-1a320222c06c</guid><dc:creator>samo</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;I found out a problem. I have a problem with the hardware (buzzer). The software works fine. Sorry, but I did not know that this issue can cause the hardware. Thanks for help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: application timer + pwm</title><link>https://devzone.nordicsemi.com/thread/108692?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 16:03:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdf225c7-03b1-48d4-9725-10fc2956695b</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Note that you are not checking the return code when you are calling the function app_timer_start().
Please change this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;app_timer_start(m_buzzer_lpg_timer_id, BUZZER_INTERVAL,NULL);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t err_code;
err_code = app_timer_start(m_buzzer_lpg_timer_id, BUZZER_INTERVAL,NULL);	
APP_ERROR_CHECK(err_code); 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So we can check if the app timer is actually starting, or if it&amp;#39;s returning any error codes.&lt;/p&gt;
&lt;p&gt;If you are getting &lt;code&gt;NRF_SUCCESS&lt;/code&gt; , you could try to add the delay as explained &lt;a href="https://devzone.nordicsemi.com/question/178883/timer-events-triggered-in-a-row/?answer=178916#post-id-178916"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you are still having problems after this, consider uploading the ble_lpgs.c and ble_lpgs.h files, and I could try to reproduce the issue here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: application timer + pwm</title><link>https://devzone.nordicsemi.com/thread/108691?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 14:21:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36a43a30-60f1-4a79-b749-90adea976977</guid><dc:creator>samo</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6622.main.c"&gt;main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;thanks for your reply. I transferred the critical part of the code in my original project into a template project and the main file is attached. As you can see I have two timers for battery acquisition and one timer for buzzer. To be clear I will explain this part little bit more in detail. When the user writes the number 2 in the actual characteristic (you will see that I have only one characteristic besides the battery one in my program) the PWM is generated. At the same time buzzer timer starts (app_timer_start(m_buzzer_lpg_timer_id, BUZZER_INTERVAL,NULL);
) which power on and off the periphery of the buzzer. In such a way I can get the PWM with on and off control.&lt;/p&gt;
&lt;p&gt;I added a critical region in timer_list_handler() but I get the same fault. If I wait for one or two hours and then I send number 2 to the characteristic, the pwm signal is not generated. I am almost sure that the mentioned problem is not caused by the pwm library. The reason lies in the fact that if the timer (app_timer_start(m_buzzer_lpg_timer_id, BUZZER_INTERVAL,NULL) is not included in the code everything works fine. Please do not forget I am using SDK 10 and corresponding softdevice. I am wondering if the SDK 10 has some major errors regarding the application times.&lt;/p&gt;
&lt;p&gt;Thanks for help in advance&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Samo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: application timer + pwm</title><link>https://devzone.nordicsemi.com/thread/108690?ContentTypeID=1</link><pubDate>Fri, 24 Nov 2017 15:02:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49b88c42-a2ba-4de2-abdd-581037931e30</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Could you post the code on how you create the app_timer ?&lt;/li&gt;
&lt;li&gt;Is this a &lt;code&gt;APP_TIMER_MODE_SINGLE_SHOT&lt;/code&gt; or a &lt;code&gt;APP_TIMER_MODE_REPEATED&lt;/code&gt; timer?&lt;/li&gt;
&lt;li&gt;is &lt;code&gt;BUZZER_INTERVAL&lt;/code&gt; and &lt;code&gt;BUZZER_START_200MS&lt;/code&gt; the same ?&lt;/li&gt;
&lt;li&gt;What are you trying to do in the buzzer_lpg_timer_handler exactly?&lt;/li&gt;
&lt;li&gt;What are you doing in &lt;code&gt;ble_is_Buzzer_Busy_update()&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;In the post you linked to, did you test Phil Beeson fix with adding &lt;code&gt;CRITICAL_REGION_ENTER();&lt;/code&gt; and &lt;code&gt;CRITICAL_REGION_EXIT();&lt;/code&gt; in timer_list_handler in app_timer.c?&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>