<?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>I want to use PWM on only one output pin</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14061/i-want-to-use-pwm-on-only-one-output-pin</link><description>I want to use PWM on only one output pin. I&amp;#39;m using a nrf51422 and softdevice s130. 
 I want to be able to set the PWM and then change it again (a sequence). This is to be able to generate sounds through a buzzer. 
 Is there a simple example I can look</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 24 May 2016 15:18:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14061/i-want-to-use-pwm-on-only-one-output-pin" /><item><title>RE: I want to use PWM on only one output pin</title><link>https://devzone.nordicsemi.com/thread/53765?ContentTypeID=1</link><pubDate>Tue, 24 May 2016 15:18:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d22ba1f-2df3-422d-befb-01fc3214f11a</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;On second thought modulating a sine wave may not work depending on other things running in the system. The duty cycle update may be delayed which will destroy the modulation.&lt;/p&gt;
&lt;p&gt;Yes it is compatible with S130. Use TIMER1 or TIMER2. You should not be allowed to use TIMER0 if SOFTDEVICE_PRESENT is defined.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to use PWM on only one output pin</title><link>https://devzone.nordicsemi.com/thread/53764?ContentTypeID=1</link><pubDate>Tue, 24 May 2016 15:00:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3590a003-a156-40f2-a368-b05ce8ebe750</guid><dc:creator>mosi</dc:creator><description>&lt;p&gt;I see in nrf_drv_config.h the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define TIMER0_ENABLED 1

#define TIMER1_ENABLED 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;is this compatible with S130?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to use PWM on only one output pin</title><link>https://devzone.nordicsemi.com/thread/53763?ContentTypeID=1</link><pubDate>Tue, 24 May 2016 14:46:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5794e1da-f370-4bbc-9c4a-dd4aed3e8f9f</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;To have one pin instead of two, use &lt;code&gt;APP_PWM_DEFAULT_CONFIG_1CH(period_in_us, pin)&lt;/code&gt; instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to use PWM on only one output pin</title><link>https://devzone.nordicsemi.com/thread/53762?ContentTypeID=1</link><pubDate>Tue, 24 May 2016 14:45:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f8f4c41-5433-47b5-9f1b-7df5d214eb38</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;We have a &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/pwm_example.html?cp=5_0_0_4_5_16"&gt;PWM example&lt;/a&gt; in SDK 11 that uses the PWM library to change the duty cycle between 0 and 100 percent.&lt;/p&gt;
&lt;p&gt;To generate different sounds through a buzzer you have to change the frequency of the signal to the buzzer. Either change the frequency of the PWM directly or modulate a sine wave and change the frequency of the sine wave. You cannot change the frequency of the PWM without reinitializing the PWM instance. I have not tried to modulate a sine wave with the PWM library, but I suspect that it is too slow. You may give it a try and see if it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>