<?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>How to control the two channels in one PWM instance separately  in nRF52840?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78997/how-to-control-the-two-channels-in-one-pwm-instance-separately-in-nrf52840</link><description>Hi 
 How to control two channels separately with one PWM instance? 
 I want to turn on/off the PWM output of each channel with any interrupt process. 
 app_pwm_disable() and app_pwm_enable() seem to only be able to turn the instances on and off.(Can&amp;#39;t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Sep 2021 03:41:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78997/how-to-control-the-two-channels-in-one-pwm-instance-separately-in-nrf52840" /><item><title>RE: How to control the two channels in one PWM instance separately  in nRF52840?</title><link>https://devzone.nordicsemi.com/thread/327504?ContentTypeID=1</link><pubDate>Wed, 01 Sep 2021 03:41:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:716eb36f-0186-4f06-9702-0cb4b64b5540</guid><dc:creator>morio</dc:creator><description>&lt;p&gt;Thank you very much &amp;nbsp;for your response.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll try!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to control the two channels in one PWM instance separately  in nRF52840?</title><link>https://devzone.nordicsemi.com/thread/327194?ContentTypeID=1</link><pubDate>Mon, 30 Aug 2021 11:47:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:030d30d2-66ec-4a5c-9b80-e1a5a5895416</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;The app_pwm library is pretty old, so I recommend that you switch to PWM driver. Then you can try using nrfx_pwm_uninit() when you aren&amp;#39;t using the motor. I don&amp;#39;t think Low-Power PWM will meet the frequency requirement for use with motors.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to control the two channels in one PWM instance separately  in nRF52840?</title><link>https://devzone.nordicsemi.com/thread/327051?ContentTypeID=1</link><pubDate>Sat, 28 Aug 2021 01:08:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7382b841-8361-440e-8c8b-0b30960a39ec</guid><dc:creator>morio</dc:creator><description>&lt;p&gt;I have a few more questions about power saving and example selection.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;P&lt;span&gt;ower Saving&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What do you recommend for disabling the instance in sleep mode?&lt;br /&gt;I thought of two ways to do it.&lt;/p&gt;
&lt;p&gt;1. Do you mean to initialize the PWM instance using app_pwm_init(), and then disable it using app_pwm_disable()?&lt;br /&gt;Then, when an interrupt is triggered, it could output PWM by enabling it and changing the duty ratio.&lt;/p&gt;
&lt;p&gt;2. Or, when an interrupt is triggered, create an instance, initialize and enable it, and output PWM.&lt;br /&gt;Then, just before the process is over and the system goes into sleep mode, the instance is destroyed, is that right?&lt;/p&gt;
&lt;p&gt;My understand about the CPU&amp;#39;s behavior during sleep mode may be insufficient.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;E&lt;span&gt;xample Selection&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To output PWM from four independent channels with power saving, which example from PWM library, PWM driver, or Low-Power PWM would be appropriate to select?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m confused because I just learned that Low-Power PWM can have any number of instances.&lt;/p&gt;
&lt;p&gt;I will use PWM signals to control motors. Also, the example I&amp;#39;m currently using is a PWM library.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Your help is very powerful. Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to control the two channels in one PWM instance separately  in nRF52840?</title><link>https://devzone.nordicsemi.com/thread/327023?ContentTypeID=1</link><pubDate>Fri, 27 Aug 2021 14:15:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46d0b6e1-0617-4d70-8302-bb26dae55a44</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Channels on the same instance use the same timer, so that is not something you should have to worry about.&lt;/p&gt;
&lt;p&gt;For power saving, setting unused channels to 0 duty cycle, and disabling the instance if you are not using any of the channels is what I recommend.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to control the two channels in one PWM instance separately  in nRF52840?</title><link>https://devzone.nordicsemi.com/thread/326974?ContentTypeID=1</link><pubDate>Fri, 27 Aug 2021 11:39:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbb3df76-f533-4dec-8698-8fdb64e70717</guid><dc:creator>morio</dc:creator><description>&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;I want to output PWM only when an interrupt is generated by BLE to save power consumption during standby (sleep mode?).&lt;/p&gt;
&lt;p&gt;I also thought about setting the duty ratio to 0.But in that case, the timer is always running(?), so I thought it might consume too much power.&lt;/p&gt;
&lt;p&gt;Is this understanding correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to control the two channels in one PWM instance separately  in nRF52840?</title><link>https://devzone.nordicsemi.com/thread/326971?ContentTypeID=1</link><pubDate>Fri, 27 Aug 2021 11:16:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94100925-eb69-4d56-bdcc-0a8da6c6d209</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you give me some more details about what you are trying to achieve? As I am reading this, it seems to me that maybe setting the duty cycle of the channel to zero would be sufficient?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>