<?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>nRF52832 No accurate 4MHz PWM output with SoftwateDevice 332 in SDK11.0.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18518/nrf52832-no-accurate-4mhz-pwm-output-with-softwatedevice-332-in-sdk11-0-0</link><description>SDK:11.0.0 
 MCU:nRF52832 
 Using example:ble_ant_app_hrm 
 SoftwateDevice Version:s332 
 PWM is turned on and accurate 4MHz is available before entering ble_stack_init(); 
 PWM is unstable after enterd SOFTDEVICE_HANDLER_INIT(&amp;amp;clock_lf_cfg, NULL</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Dec 2016 10:36:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18518/nrf52832-no-accurate-4mhz-pwm-output-with-softwatedevice-332-in-sdk11-0-0" /><item><title>RE: nRF52832 No accurate 4MHz PWM output with SoftwateDevice 332 in SDK11.0.0</title><link>https://devzone.nordicsemi.com/thread/71459?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 10:36:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdcffe76-5b97-4bc5-be8d-9c851926e9e7</guid><dc:creator>bbslhb</dc:creator><description>&lt;p&gt;Correct solution.
Those code should be used after void ble_stack_init(); or codes will be blocked at while(! p_is_running).
@Ole Bauck Give you 1024 Thumbs up if possible.LOL;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 No accurate 4MHz PWM output with SoftwateDevice 332 in SDK11.0.0</title><link>https://devzone.nordicsemi.com/thread/71458?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 10:28:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2c27d79-9de9-47b1-8585-7680de9b500b</guid><dc:creator>bbslhb</dc:creator><description>&lt;p&gt;Thank you for help.
The solution is correct!
Those codes should be used after ble_stack_init();
I am so hapy.Thanks again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 No accurate 4MHz PWM output with SoftwateDevice 332 in SDK11.0.0</title><link>https://devzone.nordicsemi.com/thread/71460?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 10:14:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4134177d-b72d-46ce-a3df-330ac9f21370</guid><dc:creator>bbslhb</dc:creator><description>&lt;p&gt;Thanks for help!Keep external 32MHz crystal is the right direction!
Where should I put those codes?
I tryed to put it here but the code got block at while(! p_is_running)&lt;/p&gt;
&lt;p&gt;static void ble_stack_init(void)
{
uint32_t err_code = NRF_SUCCESS;
uint32_t p_is_running = 0;
sd_clock_hfclk_request();
while(! p_is_running) {                             //wait for the hfclk to be available
sd_clock_hfclk_is_running((&amp;amp;p_is_running));
}
nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;&lt;/p&gt;
&lt;p&gt;// Initialize the SoftDevice handler module.	
SOFTDEVICE_HANDLER_INIT(&amp;amp;clock_lf_cfg, NULL);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 No accurate 4MHz PWM output with SoftwateDevice 332 in SDK11.0.0</title><link>https://devzone.nordicsemi.com/thread/71457?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 09:25:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ec75d59-35c3-4e06-8da8-358f8363523e</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;If you see variable frequency on the PWM after enabling the SoftDevice and start advertising or in a connection, it may be because the clock source is changing between the crystal and the internal oscillator. You can keep the crystal running with the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s332.api.v2.0.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=2_3_3_0_0_2_8_2_3#ga3e5afb495a1b0307c749cc268df94a74"&gt;sd_clock_hfclk_request()&lt;/a&gt; function:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t p_is_running = 0;
sd_clock_hfclk_request();
while(! p_is_running) {                             //wait for the hfclk to be available
    sd_clock_hfclk_is_running((&amp;amp;p_is_running));
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>