<?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>PWM not pulsing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46641/pwm-not-pulsing</link><description>I have a custom board SDK 15.2 API 6.1 
 I have a simple PWM going but it seems to just turn the low and set it high when i turn it on. It does not however seem to pulse according to my scope. Nor does it stop. This is in a ble application that has softdevices</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Apr 2019 17:02:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46641/pwm-not-pulsing" /><item><title>RE: PWM not pulsing</title><link>https://devzone.nordicsemi.com/thread/184137?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2019 17:02:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3f24157-0782-4db1-94f2-e8696cb83d58</guid><dc:creator>Karlis</dc:creator><description>&lt;p&gt;Its because seq_values array contains strucure nrf_pwm_values_individual_t, so inner brackets encloses structure values, but outer array items. With double brackets we are creating array with one item, which holds structure containing four variables. As example You can assign &lt;span&gt;{ {DUTY_CYCLE_1, 0, 0, 0} , {DUTY_CYCLE_2, 0, 0, 0}} and &lt;em&gt;playback_count&lt;/em&gt; in &lt;em&gt;nrf_drv_pwm_simple_playback &lt;/em&gt;defines how many times each DUTU_CYCLE are repeated before changing to next in array. Without double brackets Your compiler can misinterpret which value is which.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM not pulsing</title><link>https://devzone.nordicsemi.com/thread/184133?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2019 16:34:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06b44753-34a7-4ac6-9be1-a226b8c5a595</guid><dc:creator>dmleone</dc:creator><description>&lt;p&gt;I am perplexed why doing this worked&lt;/p&gt;
&lt;p&gt;&lt;span&gt;{ {DUTY_CYCLE, 0, 0, 0} }&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have been fighting this for like 2 days now almost ready to implement my own PWM. I am not a firmware expert by any means. Can yo uexplain why the double curly brakcets made it work and why&amp;nbsp; you had to add them?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM not pulsing</title><link>https://devzone.nordicsemi.com/thread/184131?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2019 16:08:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1944267f-f21d-43a9-ac80-65fea1afbd05</guid><dc:creator>Karlis</dc:creator><description>&lt;p&gt;For fast test I take sdk_config from examples/peripheral/pwm_driver/pca10040/blank/config and after fixing two lines about which armgcc complains Your code works as expected.&lt;/p&gt;
&lt;p&gt;I only changed {DUTY_CYCLE, 0, 0, 0} to { {DUTY_CYCLE, 0, 0, 0} } and &amp;quot;void int main(void){&amp;quot; to &amp;quot;int main(void){&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;ups I missed a point about app_pwm.h tested with nrf_drv_pwm.h&lt;/p&gt;
&lt;p&gt;Sorry, I newer used app_pwm, but examples/peripheral/pwm_library looks absolutely different PWM initialisation and usage.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM not pulsing</title><link>https://devzone.nordicsemi.com/thread/184124?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2019 15:27:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf845d50-4169-46a8-bc7b-7c12114420d5</guid><dc:creator>dmleone</dc:creator><description>&lt;p&gt;I feel like there may not be a clock operating. All the example i see do the following&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// Start clock for accurate frequencies
NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1; 
// Wait for clock to start
while(NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0) ;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However, i use LFCLK. Could me not doing that be an issue. If i do, ow to i enable both clocks, because i tried adding that intot he system and it made things worse.&lt;/p&gt;
&lt;p&gt;Are there setting in the sdk_config file i need to set. Right now i have&amp;nbsp;&lt;/p&gt;
&lt;p&gt;NRFX_TIMER_ENABLED = 1; APP_TIMER_ENABLED = 1; and TIMER_ENABLED = 1&lt;/p&gt;
&lt;p&gt;Am i getting conflicts?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM not pulsing</title><link>https://devzone.nordicsemi.com/thread/184064?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2019 12:18:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08827891-6f1f-4452-bd9f-27283dc1e5be</guid><dc:creator>Karlis</dc:creator><description>&lt;p&gt;One idea I have is that You must increase&amp;nbsp;&lt;span&gt;&lt;em&gt;playback_count&lt;/em&gt; in:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;nrf_drv_pwm_simple_playback(&amp;amp;m_pwm0, &amp;amp;seq, 1, NRF_DRV_PWM_FLAG_LOOP);&lt;/p&gt;
&lt;p&gt;for example from 1 to 1000 ant test it, as I remember this defines how long pulses are generated.&lt;/p&gt;
&lt;p&gt;For Looping manual says &amp;quot;&lt;span&gt;To take advantage of the looping mechanism in the PWM peripheral, both sequences must be used (single sequence can be played back only once by the peripheral)&lt;/span&gt;&amp;quot;, so I think curently Your sequence are played only once and for very short time.&lt;/p&gt;
&lt;p&gt;Currently I can&amp;#39;t test on my hardware, only maybe later, but I remember that value in my case is 2000.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM not pulsing</title><link>https://devzone.nordicsemi.com/thread/184053?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2019 12:00:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ce4b51b-d76c-4951-ade0-625268a4430e</guid><dc:creator>dmleone</dc:creator><description>&lt;p&gt;#define DUTY_CYCLE 50&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM not pulsing</title><link>https://devzone.nordicsemi.com/thread/183929?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2019 05:24:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:016903da-0b09-4ed4-91a7-5c52d4b78fbf</guid><dc:creator>Karlis</dc:creator><description>&lt;p&gt;What is value of&amp;nbsp;DUTY_CYCLE (on line 3) ?&lt;/p&gt;
&lt;p&gt;If it set to 100% DC, then there is no pulses to see on scope only level change to high when turned on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>