<?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>nRF52: &amp;quot;spike&amp;quot; after last period with inverted polarity PWM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46269/nrf52-spike-after-last-period-with-inverted-polarity-pwm</link><description>Hi, 
 I use the a gpiote_in_event to trigger a number of PWM pulses which works fine so far. However, the exact behaviour of the generated signal is important so that the device interfaced to the signal line does also behave correctly. 
 I saw that if</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Mar 2022 18:10:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46269/nrf52-spike-after-last-period-with-inverted-polarity-pwm" /><item><title>RE: nRF52: "spike" after last period with inverted polarity PWM</title><link>https://devzone.nordicsemi.com/thread/360380?ContentTypeID=1</link><pubDate>Mon, 28 Mar 2022 18:10:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a0dfae0-fbd8-45c0-be40-bb5009173333</guid><dc:creator>Magneon</dc:creator><description>&lt;p&gt;I still think this might be a bug, but in my case I was able to work around this by sticking a full &amp;quot;0&amp;quot; at the end (1&amp;lt;&amp;lt;15 in this case to set the inverted flag on a 0 output), and increasing my buffer size by 1.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Before I was seeing this weird tiny spike at the end, and after it was gone.&lt;/p&gt;
&lt;p&gt;Obviously this won&amp;#39;t work in all cases, but should work in most.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52: "spike" after last period with inverted polarity PWM</title><link>https://devzone.nordicsemi.com/thread/200704?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 09:30:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e949a9e-ba99-43c9-a447-7c13563779f3</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Hey Franz, I&amp;#39;m so sorry for the long delay.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve tried to reproduce your issue on an internal test board, but I cannot produce the same spike.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I suggest you turn on high drive on the gpio via the&amp;nbsp;&lt;a title="GPIO HAL" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__gpio__hal.html?cp=5_1_6_9_0_11_0"&gt;GPIO HAL&lt;/a&gt;, or use:&lt;br /&gt;&lt;br /&gt;NRF_GPIO-&amp;gt;PIN_CNF[31] |= (3 &amp;lt;&amp;lt; 8); //&amp;nbsp;&lt;span&gt;High drive &amp;#39;0&amp;#39;, high &amp;#39;drive &amp;#39;1&amp;#39;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Source for this issue is interference, loading of the PWM trace, poor grounding, etc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52: "spike" after last period with inverted polarity PWM</title><link>https://devzone.nordicsemi.com/thread/190651?ContentTypeID=1</link><pubDate>Tue, 04 Jun 2019 06:02:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64ec135a-7b4a-43f2-b877-4044a0ef65e7</guid><dc:creator>Franz</dc:creator><description>&lt;p&gt;Hi haakonsh - any news on that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52: "spike" after last period with inverted polarity PWM</title><link>https://devzone.nordicsemi.com/thread/189879?ContentTypeID=1</link><pubDate>Wed, 29 May 2019 12:28:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3588844-6751-4587-aac8-275a87648ae5</guid><dc:creator>Franz</dc:creator><description>&lt;p&gt;I could, but would need to remove some confidential stuff before, I guess.&lt;/p&gt;
&lt;p&gt;However, here is the PWM related passage of sdk_config.h (the legacy layer PWM stuff is commented out&amp;quot;)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// &amp;lt;e&amp;gt; NRFX_PWM_ENABLED - nrfx_pwm - PWM peripheral driver
//==========================================================
#ifndef NRFX_PWM_ENABLED
#define NRFX_PWM_ENABLED 1
#endif
// &amp;lt;q&amp;gt; NRFX_PWM0_ENABLED  - Enable PWM0 instance
 

#ifndef NRFX_PWM0_ENABLED
#define NRFX_PWM0_ENABLED 1
#endif

// &amp;lt;o&amp;gt; NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin  &amp;lt;0-31&amp;gt; 


#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN
#define NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN 31
#endif

// &amp;lt;o&amp;gt; NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin  &amp;lt;0-31&amp;gt; 


#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN
#define NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN 31
#endif

// &amp;lt;o&amp;gt; NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin  &amp;lt;0-31&amp;gt; 


#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN
#define NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN 31
#endif

// &amp;lt;o&amp;gt; NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin  &amp;lt;0-31&amp;gt; 


#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN
#define NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN 31
#endif

// &amp;lt;o&amp;gt; NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK  - Base clock
 
// &amp;lt;0=&amp;gt; 16 MHz 
// &amp;lt;1=&amp;gt; 8 MHz 
// &amp;lt;2=&amp;gt; 4 MHz 
// &amp;lt;3=&amp;gt; 2 MHz 
// &amp;lt;4=&amp;gt; 1 MHz 
// &amp;lt;5=&amp;gt; 500 kHz 
// &amp;lt;6=&amp;gt; 250 kHz 
// &amp;lt;7=&amp;gt; 125 kHz 

#ifndef NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK
#define NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK 4
#endif

// &amp;lt;o&amp;gt; NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE  - Count mode
 
// &amp;lt;0=&amp;gt; Up 
// &amp;lt;1=&amp;gt; Up and Down 

#ifndef NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE
#define NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE 0
#endif

// &amp;lt;o&amp;gt; NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE - Top value 
#ifndef NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE
#define NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE 1000
#endif

// &amp;lt;o&amp;gt; NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE  - Load mode
 
// &amp;lt;0=&amp;gt; Common 
// &amp;lt;1=&amp;gt; Grouped 
// &amp;lt;2=&amp;gt; Individual 
// &amp;lt;3=&amp;gt; Waveform 

#ifndef NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE
#define NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE 0
#endif

// &amp;lt;o&amp;gt; NRFX_PWM_DEFAULT_CONFIG_STEP_MODE  - Step mode
 
// &amp;lt;0=&amp;gt; Auto 
// &amp;lt;1=&amp;gt; Triggered 

#ifndef NRFX_PWM_DEFAULT_CONFIG_STEP_MODE
#define NRFX_PWM_DEFAULT_CONFIG_STEP_MODE 0
#endif

// &amp;lt;o&amp;gt; NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY  - Interrupt priority
 
// &amp;lt;0=&amp;gt; 0 (highest) 
// &amp;lt;1=&amp;gt; 1 
// &amp;lt;2=&amp;gt; 2 
// &amp;lt;3=&amp;gt; 3 
// &amp;lt;4=&amp;gt; 4 
// &amp;lt;5=&amp;gt; 5 
// &amp;lt;6=&amp;gt; 6 
// &amp;lt;7=&amp;gt; 7 

#ifndef NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY
#define NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif

// &amp;lt;e&amp;gt; NRFX_PWM_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_PWM_CONFIG_LOG_ENABLED
#define NRFX_PWM_CONFIG_LOG_ENABLED 0
#endif
// &amp;lt;o&amp;gt; NRFX_PWM_CONFIG_LOG_LEVEL  - Default Severity level
 
// &amp;lt;0=&amp;gt; Off 
// &amp;lt;1=&amp;gt; Error 
// &amp;lt;2=&amp;gt; Warning 
// &amp;lt;3=&amp;gt; Info 
// &amp;lt;4=&amp;gt; Debug 

#ifndef NRFX_PWM_CONFIG_LOG_LEVEL
#define NRFX_PWM_CONFIG_LOG_LEVEL 3
#endif

// &amp;lt;o&amp;gt; NRFX_PWM_CONFIG_INFO_COLOR  - ANSI escape code prefix.
 
// &amp;lt;0=&amp;gt; Default 
// &amp;lt;1=&amp;gt; Black 
// &amp;lt;2=&amp;gt; Red 
// &amp;lt;3=&amp;gt; Green 
// &amp;lt;4=&amp;gt; Yellow 
// &amp;lt;5=&amp;gt; Blue 
// &amp;lt;6=&amp;gt; Magenta 
// &amp;lt;7=&amp;gt; Cyan 
// &amp;lt;8=&amp;gt; White 

#ifndef NRFX_PWM_CONFIG_INFO_COLOR
#define NRFX_PWM_CONFIG_INFO_COLOR 0
#endif

// &amp;lt;o&amp;gt; NRFX_PWM_CONFIG_DEBUG_COLOR  - ANSI escape code prefix.
 
// &amp;lt;0=&amp;gt; Default 
// &amp;lt;1=&amp;gt; Black 
// &amp;lt;2=&amp;gt; Red 
// &amp;lt;3=&amp;gt; Green 
// &amp;lt;4=&amp;gt; Yellow 
// &amp;lt;5=&amp;gt; Blue 
// &amp;lt;6=&amp;gt; Magenta 
// &amp;lt;7=&amp;gt; Cyan 
// &amp;lt;8=&amp;gt; White 

#ifndef NRFX_PWM_CONFIG_DEBUG_COLOR
#define NRFX_PWM_CONFIG_DEBUG_COLOR 0
#endif

// &amp;lt;/e&amp;gt;

// &amp;lt;/e&amp;gt;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52: "spike" after last period with inverted polarity PWM</title><link>https://devzone.nordicsemi.com/thread/189020?ContentTypeID=1</link><pubDate>Fri, 24 May 2019 11:28:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5410d447-fd9b-448c-925c-ea9caca3f50e</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Yeah, I need the configuration of the PWM peripheral in sdk_config.h.&lt;br /&gt;&lt;br /&gt;Do you mind sending me your project?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52: "spike" after last period with inverted polarity PWM</title><link>https://devzone.nordicsemi.com/thread/188267?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 12:24:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7be9e5a8-4eb0-46d9-9c03-13c9f5abc386</guid><dc:creator>Franz</dc:creator><description>&lt;p&gt;Sorry, I missed that:&lt;/p&gt;
&lt;p&gt;#define NBR_ADC_SAMPLES_AO&amp;nbsp; 1024&lt;/p&gt;
&lt;p&gt;Still something missing you need to know?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52: "spike" after last period with inverted polarity PWM</title><link>https://devzone.nordicsemi.com/thread/188120?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 07:43:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54265b83-78cf-4e36-b420-cef805ce2076</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I need the value of&amp;nbsp;NBR_ADC_SAMPLES_AO as well. I want to reproduce the issue on my end.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52: "spike" after last period with inverted polarity PWM</title><link>https://devzone.nordicsemi.com/thread/187553?ContentTypeID=1</link><pubDate>Thu, 16 May 2019 13:32:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e59261b1-7cb8-4508-b9a9-560a841b34c8</guid><dc:creator>Franz</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;  nrf_pwm_values_individual_t seq_values[] = {0x8000|64, 0x0000|26}; //15 bit value, 16th bit = polarity
  nrf_pwm_sequence_t const seq =
  {
      .values.p_individual = seq_values,
      .length          = NRF_PWM_VALUES_LENGTH(seq_values),
      .repeats         = 0,
      .end_delay       = 0
  };&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Sorry, it&amp;acute;s been some time - here it is!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52: "spike" after last period with inverted polarity PWM</title><link>https://devzone.nordicsemi.com/thread/184010?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2019 09:28:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae4d1350-11b1-402d-b63c-7b6840cb25fc</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;It kinda looks like the sequence is &amp;#39;off by one&amp;#39;. Can you share your &amp;#39;seq&amp;#39; struct?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52: "spike" after last period with inverted polarity PWM</title><link>https://devzone.nordicsemi.com/thread/183296?ContentTypeID=1</link><pubDate>Wed, 24 Apr 2019 05:42:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb4725ec-5566-4bcb-b315-fa63d04ccf8a</guid><dc:creator>Franz</dc:creator><description>&lt;p&gt;Hi haakonsh,&lt;/p&gt;
&lt;p&gt;See the code snippet below.&lt;/p&gt;
&lt;p&gt;A falling edge on the HELPER_PIN should start the PWM&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; 
 
 //configure gpiote
 nrfx_gpiote_in_config_t helper_pin_cfg = NRFX_GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
 err = nrfx_gpiote_in_init(HELPER_PIN, &amp;amp;helper_pin_cfg, NULL);
 nrfx_gpiote_in_event_enable(HELPER_PIN, false);
 
 
 //configure ppi channel
 uint32_t start_task_addr = nrfx_pwm_simple_playback(&amp;amp;m_pwm0, &amp;amp;seq, NBR_ADC_SAMPLES_AO, NRFX_PWM_FLAG_START_VIA_TASK|NRFX_PWM_FLAG_STOP);
 
 nrfx_ppi_channel_alloc(&amp;amp;ppi_ch_start_clk);
 nrfx_ppi_channel_assign(ppi_ch_start_clk, nrfx_gpiote_in_event_addr_get(HELPER_PIN), start_task_addr);
 nrfx_ppi_channel_fork_assign(ppi_ch_start_clk, nrfx_timer_task_address_get(&amp;amp;m_tmr1, NRF_TIMER_TASK_START));
 nrfx_ppi_channel_enable(ppi_ch_start_clk);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52: "spike" after last period with inverted polarity PWM</title><link>https://devzone.nordicsemi.com/thread/183174?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 14:33:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1f9d8e0-6df0-4bb4-bdeb-ff38f8d92d2a</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;We need more information&amp;nbsp;on how exactly you&amp;#39;ve implemented &amp;quot;&lt;span&gt;gpiote_in_event to trigger a number of PWM pulses&amp;quot;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Are the IN_EVENT pin or PWM pin driven high or low?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>