<?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>buzzer pwm&amp;amp;power</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15613/buzzer-pwm-power</link><description>I want to use the pwm to control buzzer, but when I use init function, the power will increase 880 uA, how to decrease the power. 
 void beep_on(void)//beep on
{
 app_pwm_channel_duty_set(&amp;amp;PWM1, 0, warning_voice);
}

void beep_off(void)
{
 app_pwm_channel_duty_set</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 10 Aug 2016 08:41:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15613/buzzer-pwm-power" /><item><title>RE: buzzer pwm&amp;power</title><link>https://devzone.nordicsemi.com/thread/59559?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2016 08:41:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a962582a-3345-4e72-92db-6dc45786d937</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You can make a function for calulating the ticks from us, see &lt;a href="https://devzone.nordicsemi.com/question/73211/sdk-600-timer/?answer=73416#post-id-73416"&gt;this&lt;/a&gt; post. Remeber that if you set the period low you will have lower resolution on the duty cycle. For example if you set the period to 60us you will have three options for duty cycle: 0%, 50% and 100%.&lt;/p&gt;
&lt;p&gt;The low power pwm module should almost not consume any current (1uA for the LFCLK+RTC). How much current are you seeing? It may be something else in your code that is causing the high current draw.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: buzzer pwm&amp;power</title><link>https://devzone.nordicsemi.com/thread/59562?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2016 01:51:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd703dfd-c6a6-448b-b3ea-deb83a2c2fa1</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;the buzzer I need to control it not just on and off, I should change the duty to control the volume&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: buzzer pwm&amp;power</title><link>https://devzone.nordicsemi.com/thread/59561?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2016 01:34:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c91131c-93a3-4aa9-9895-35a34d08d970</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;low_power_init();&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	nrf_delay_ms(500);
	nrf_delay_ms(500);
	low_power_pwm_stop(&amp;amp;low_power_pwm_0);
	nrf_delay_ms(500);
	nrf_delay_ms(500);
	low_power_pwm_start((&amp;amp;low_power_pwm_0), low_power_pwm_0.bit_mask);
	nrf_delay_ms(500);
	nrf_delay_ms(500);
	low_power_pwm_stop(&amp;amp;low_power_pwm_0);
	nrf_gpio_cfg_output(24);
	nrf_gpio_pins_clear(24);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;when I close the pwm. the power is not decrease&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: buzzer pwm&amp;power</title><link>https://devzone.nordicsemi.com/thread/59560?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2016 01:14:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd69dcf8-9179-4fff-9ccc-3711b61259ad</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define KEY_20MS_DELAY                         APP_TIMER_TICKS(20,   APP_TIMER_PRESCALER)
static app_timer_id_t                                             timer_key_20ms_id;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;this is 20ms,the min time is not 1ms? how to be 30us&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: buzzer pwm&amp;power</title><link>https://devzone.nordicsemi.com/thread/59558?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2016 08:34:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43fe02e0-8a0b-4b28-82f5-b2f93e94bc5b</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Minimum period with app_timer is about 30us, not 1s. The low_power_pwm library is not present in SDK 9, only in SDK 11 (it&amp;#39;s a new feature).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: buzzer pwm&amp;power</title><link>https://devzone.nordicsemi.com/thread/59557?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2016 01:09:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9faac8a-80d5-4472-a12b-34290f8513a8</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;thank you so much, dear friend.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define KEY_20MS_DELAY		                   APP_TIMER_TICKS(20,   APP_TIMER_PRESCALER)
static app_timer_id_t                                             timer_key_20ms_id;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;what you say is like that? but this minimum period is 1s, and what I need is about 250us. the buzzer and motor need more than 1HZ frequency.&lt;/p&gt;
&lt;p&gt;I see the SDK11.0, and find the file &amp;quot;low_power_pwm&amp;quot;, this is a peripheral test, I try to transplant it to SDK 9.0 with ble, whitch is ble_peripheral.&lt;/p&gt;
&lt;p&gt;All I need is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;about 250us period&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;low power,I could turn the pwm on or off easy and convenient.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;with ble.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;thank you again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: buzzer pwm&amp;power</title><link>https://devzone.nordicsemi.com/thread/59556?ContentTypeID=1</link><pubDate>Mon, 08 Aug 2016 09:24:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe15b445-f72c-49f0-8d24-d55c2339752d</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;The reason you get that high current draw when initializing the pwm is because the pwm uses the timer peripheral which in turn requires the high frequency clock (HFCLK), see chapter 8.3 &amp;quot;Block resource requirements&amp;quot; in &lt;a href="http://infocenter.nordicsemi.com/pdf/nRF51822_PS_v3.2.pdf"&gt;Product Specification&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can reduce the current consumption some (~70uA) by letting the HFLCK run from the crystal instead of the RC oscillator (search on this forum for how to do this with or without the SoftDevice).&lt;/p&gt;
&lt;p&gt;The best way to reduce current consumption is probably to disable the pwm when not in use. The PWM library from SDK 9 is known to have some bugs related to the disable or uninit functions among other things, &lt;strong&gt;you should upgrade to SDK 10 or 11 (newest)&lt;/strong&gt;. In SDK 11 there is also a new library called &amp;quot;low_power_pwm&amp;quot; which uses RTC (app_timer) to create the PWM. Maybe this is suited for your application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>