<?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>strange signal / noise on PWM. Noise diaspears when connecting to JLINK! WHY?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84388/strange-signal-noise-on-pwm-noise-diaspears-when-connecting-to-jlink-why</link><description>Hi, 
 i am using a PWM signal to control the brightness of a LED. When the brightness is at zero, i have a random flickering on the LED. 
 This signal is also present at the pin itself. The strange thing, as soon i connect a JLINK probe the signal is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Feb 2022 11:45:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84388/strange-signal-noise-on-pwm-noise-diaspears-when-connecting-to-jlink-why" /><item><title>RE: strange signal / noise on PWM. Noise diaspears when connecting to JLINK! WHY?</title><link>https://devzone.nordicsemi.com/thread/351306?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 11:45:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb817cbd-e99f-405b-88c3-dd23ec495c4f</guid><dc:creator>MaxRPEng</dc:creator><description>&lt;p&gt;i included the playback call to the init. now i have a pwm output. but still the same issue with the random signal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: strange signal / noise on PWM. Noise diaspears when connecting to JLINK! WHY?</title><link>https://devzone.nordicsemi.com/thread/351303?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 11:40:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8c895a3-5eca-4bb4-a5e8-5edd0af69fba</guid><dc:creator>MaxRPEng</dc:creator><description>&lt;p&gt;but you told me to use&lt;span&gt;nrf_drv_pwm_sequence_values_update instead of nrf_drv_pwm_simple_playback()&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: strange signal / noise on PWM. Noise diaspears when connecting to JLINK! WHY?</title><link>https://devzone.nordicsemi.com/thread/351301?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 11:35:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec47c2bc-8df8-459c-b9d9-c6fa42959eb3</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;How do you start the PWM now? I think you need to call&amp;nbsp;nrf_drv_pwm_simple_playback() before you call&amp;nbsp;&lt;span&gt;nrf_drv_pwm_sequence_values_update.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: strange signal / noise on PWM. Noise diaspears when connecting to JLINK! WHY?</title><link>https://devzone.nordicsemi.com/thread/351292?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 11:12:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42d30dc1-9b43-446e-b1fe-56e347d66455</guid><dc:creator>MaxRPEng</dc:creator><description>&lt;p&gt;according some examples i implemented the following:&lt;/p&gt;
&lt;p&gt;static nrf_pwm_values_individual_t seq_values[];&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;seq_values[0].channel_0 = 50;&lt;br /&gt;&amp;nbsp; seq_values[0].channel_1 = 50;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; nrf_pwm_values_t new_pwm_values; &lt;br /&gt;&lt;br /&gt;&amp;nbsp; new_pwm_values.p_individual = seq_values;&lt;/p&gt;
&lt;p&gt;nrf_drv_pwm_sequence_values_update(&amp;amp;m_pwm0, 0, new_pwm_values);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But now i dont have any PWM output !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: strange signal / noise on PWM. Noise diaspears when connecting to JLINK! WHY?</title><link>https://devzone.nordicsemi.com/thread/351285?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 10:48:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d36f029-171b-4767-b0df-14dbb5b32b17</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Try using&amp;nbsp;nrf_drv_pwm_sequence_values_update() instead of&amp;nbsp;nrf_drv_pwm_simple_playback() to change the duty cycle.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: strange signal / noise on PWM. Noise diaspears when connecting to JLINK! WHY?</title><link>https://devzone.nordicsemi.com/thread/351283?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 10:43:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3e4f28e-ec51-43fb-8d9e-2ce859b064c7</guid><dc:creator>MaxRPEng</dc:creator><description>&lt;p&gt;unwanted signal: always the same width, but random frequency&lt;/p&gt;
&lt;p&gt;This channel should be always zero!&lt;/p&gt;
&lt;p&gt;&lt;img alt="duty-cylce is set to zero, but i have this random pulse. the width is alsways the same " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/DS1Z_5F00_QuickPrint2.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;this is the signal of the second channel. works correct.&lt;/p&gt;
&lt;p&gt;&lt;img alt="This is the signal of the other PWM channel, this one is correct." src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/DS1Z_5F00_QuickPrint3.jpg" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: strange signal / noise on PWM. Noise diaspears when connecting to JLINK! WHY?</title><link>https://devzone.nordicsemi.com/thread/351278?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 10:26:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b4cc5b8-c31b-49fa-a0bd-90e86d9dcbb7</guid><dc:creator>MaxRPEng</dc:creator><description>&lt;p&gt;PWM init:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void pwm_init(void)
{
    /* Config PWM 0*/
    nrf_drv_pwm_config_t const config0 =
    {
        .output_pins =
        {
            LED_SPOT , // channel 0
            LED_WIDE ,  // channel 1
 
        },
        .irq_priority = APP_IRQ_PRIORITY_LOWEST,
        .base_clock   = NRF_PWM_CLK_8MHz,
        .count_mode   = NRF_PWM_MODE_UP,
        .top_value    = 100,
        .load_mode    = NRF_PWM_LOAD_INDIVIDUAL,
        .step_mode    = NRF_PWM_STEP_AUTO
    };
    APP_ERROR_CHECK(nrf_drv_pwm_init(&amp;amp;m_pwm0, &amp;amp;config0, NULL));

}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Update duty cycle:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// Set duty cycle between 0 and 100%
void pwm_spot_update_duty_cycle(uint8_t duty_cycle)
{
    uint8_t invert = 100 - duty_cycle;
    static uint8_t pwm_test_spot; 
    // Check if value is outside of range. If so, set to 100%
    if(invert &amp;gt;= 100)
    {
        seq_values.channel_0 = 100;
    }
    else
    {
        seq_values.channel_0 = invert;
    }

    pwm_test_spot = 
    
    nrf_drv_pwm_simple_playback(&amp;amp;m_pwm0, &amp;amp;seq, 1, NRF_DRV_PWM_FLAG_LOOP);
}

// Set duty cycle between 0 and 100%
void pwm_wide_update_duty_cycle(uint8_t duty_cycle)
{
    uint8_t invert = 100 - duty_cycle;
  
    // Check if value is outside of range. If so, set to 100%
    if(invert &amp;gt;= 100)
    {
        seq_values.channel_1 = 100;
    }
    else
    {
        seq_values.channel_1 = invert;
    }
    
    nrf_drv_pwm_simple_playback(&amp;amp;m_pwm0, &amp;amp;seq, 1, NRF_DRV_PWM_FLAG_LOOP);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: strange signal / noise on PWM. Noise diaspears when connecting to JLINK! WHY?</title><link>https://devzone.nordicsemi.com/thread/351276?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 10:23:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3883f190-8fe8-4832-83d8-0295cd36fc59</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Hmm, that&amp;#39;s strange.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Can you share the PWM code?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;-edit:&lt;br /&gt;It would also be useful to scope the PWM with the debugger enabled and not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: strange signal / noise on PWM. Noise diaspears when connecting to JLINK! WHY?</title><link>https://devzone.nordicsemi.com/thread/351268?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 10:08:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:261b825a-c3f6-46c4-bf9e-74706f889112</guid><dc:creator>MaxRPEng</dc:creator><description>&lt;p&gt;Hi, thank you for your fast answer: DCDC is disabled.&lt;/p&gt;
&lt;p&gt;nrfjprog&amp;nbsp; --memrd 40000578&lt;br /&gt;0x02625C42: 0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |..|&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I turned the CONSTLAT on: NRF_POWER-&amp;gt;TASKS_CONSTLAT = 1;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But i still have that strange random signal on my PWM output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: strange signal / noise on PWM. Noise diaspears when connecting to JLINK! WHY?</title><link>https://devzone.nordicsemi.com/thread/351237?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 08:16:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4123d4be-c1db-46ea-985e-e20bfa899a1e</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;One source could be the&amp;nbsp;DCDC regulator or the clocks. The debugger will force the nRF52&amp;#39;s regulator into LDO mode and keep the HFCLK running.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Try disabling the DCDC regulator. If that does not work try to enable Constant Latency (force HFCLK on, see &lt;a title="Sub power modes" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=4_2_0_17_2_0#unique_1754445551"&gt;Sub power modes&lt;/a&gt;).&amp;nbsp;&lt;br /&gt;&lt;br /&gt;See in the POWER&amp;nbsp;&lt;a title="  Registers  " href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=4_2_0_17_8#unique_1940195685"&gt;Registers&lt;/a&gt;, see&amp;nbsp;&lt;a title="  DCDCEN  " href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=4_2_0_17_8_10#register.DCDCEN"&gt;DCDCEN&lt;/a&gt;&amp;nbsp;register, and the&amp;nbsp;&lt;span&gt;TASKS_CONSTLAT.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>