<?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>BLE scanning on AC mains powered unit with dimming</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58568/ble-scanning-on-ac-mains-powered-unit-with-dimming</link><description>I have an application that requires mains power for lighting with a BLE receiver that is permanently advertising and scanning and I need to be able to dim the lights. My circuit uses zero-crossing and a triac to control the mains. I&amp;#39;m using a Fanstel</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Mar 2020 16:32:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58568/ble-scanning-on-ac-mains-powered-unit-with-dimming" /><item><title>RE: BLE scanning on AC mains powered unit with dimming</title><link>https://devzone.nordicsemi.com/thread/237864?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 16:32:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38a39b66-e63c-4a6f-a101-c0b1bb0dfc18</guid><dc:creator>haakonsh</dc:creator><description>&lt;ol&gt;
&lt;li&gt;Ok, good.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;You can request what is called a Timeslot, where for a given time, you are guaranteed not to get preempted by the SoftDevice. See:&lt;br /&gt;&lt;a title="Timeslot API timing" href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/multilink_scheduling/timeslot_api_timing.html?cp=4_5_2_0_14_8"&gt;Timeslot API timing&lt;/a&gt;&lt;a title="Radio Timeslot API usage scenarios" href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/concurrent_multiprotocol_tsl_api/tsl_usage_examples.html?cp=4_5_2_0_8_2"&gt;&lt;br /&gt;Radio Timeslot API usage scenarios&lt;br /&gt;&lt;/a&gt;&lt;a title="Radio Timeslot API processor usage patterns" href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/processor_avail_interrupt_latency/tsl_usage_patterns.html?cp=4_5_2_0_15_2_1"&gt;Radio Timeslot API processor usage patterns&lt;/a&gt;&lt;a title="Radio Timeslot API usage scenarios" href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/concurrent_multiprotocol_tsl_api/tsl_usage_examples.html?cp=4_5_2_0_8_2"&gt;&lt;/a&gt;&lt;a title="sd_radio_session_open" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=4_5_2_1_2_7_2_38#ga55a52eb4d0491cb7105de6a13eb2b11b"&gt;&lt;br /&gt;sd_radio_session_open&lt;/a&gt;&lt;br /&gt;&lt;a title="sd_radio_request" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=4_5_2_1_2_7_2_36#ga3fbd3ade121c15745cc19b900ce8154b"&gt;sd_radio_request&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;If you can use the PWM peripheral I&amp;#39;d recommend it as it cannot be inverted, and its operation is a lot closer to real-time than a TIMER based PWM. With the PWM peripheral you can update the duty-cycle whenever you want to and the changes won&amp;#39;t take effect until the next period. This means that you can, for instance, tie the zero-crossing event to automatically start a new PWM sequence, ensuring phase stability over time, without being dependent on CPU availability. This can ofc be done with the TIMER based PWM as well, but the update procedure will have to be done in a Timeslot.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;The module does have a 32MHz crystal, as it is mandatory for RF communications, only the 32.768KHz crystal is optional. The peripheral system of the MCU runs on a 16MHz clock, derived from &lt;a title="HFCLK clock controller" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_0#concept_rp5_fgp_bs"&gt;HFCLK clock controller&lt;/a&gt;, who, during radio event, uses the HFXO as its source.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;At some point, you really should verify your control signals and triac outputs.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE scanning on AC mains powered unit with dimming</title><link>https://devzone.nordicsemi.com/thread/237839?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 15:27:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:add7ef80-990f-422e-9f9d-03fb1c91ac5d</guid><dc:creator>sally</dc:creator><description>&lt;p&gt;Thanks for your suggestions.&lt;/p&gt;
&lt;p&gt;Re point 1 - I&amp;#39;m using TIMER1 and TIMER2 (not TIMER0).&lt;/p&gt;
&lt;p&gt;Re point 2 - I guess this is the problem, but don&amp;#39;t know how to get around it. &amp;nbsp;I can&amp;#39;t see a way of changing the priorities as the interrupt priority for the SD is reserved.&lt;/p&gt;
&lt;p&gt;Re point 3 - I&amp;#39;m not currently using PWM, but am now looking at this to see if I can use this instead of a timer.&lt;/p&gt;
&lt;p&gt;Re point 4 - I&amp;#39;ve set the clock to&amp;nbsp;NRF_CLOCK_LF_SRC_RC rather than XTAL as the Fanstel chip does not have a crystal.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have an oscilloscope so can&amp;#39;t follow your suggestion.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE scanning on AC mains powered unit with dimming</title><link>https://devzone.nordicsemi.com/thread/237728?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 12:34:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:198c653a-c19b-406c-b27d-5d69cf900a13</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;So there are 4 scenarios that are likely:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If you&amp;#39;re using TIMER0, it is required by the SoftDevice, use TIMER1 instead.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;A SoftDevice timing event has execution priority and delays your application from&amp;nbsp;starting or updating the timer in such a way that your signal output is out of phase with the AC signal.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;In case you&amp;#39;re using a PWM like signal, the PWM signal has been inverted due to a SoftDevice timing event preempting during a PWM update procedure.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Clock jitter/glitch as the HFXO is turned on/off to service RADIO events. If this is the case the solution would be to keep the HFXO always on.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I suggest you scope your signal output (to the opto-triac), check voltage levels, and compare the AC phase.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE scanning on AC mains powered unit with dimming</title><link>https://devzone.nordicsemi.com/thread/237547?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 18:03:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b470ca10-8402-4d67-80f9-1a7206c8acac</guid><dc:creator>sally</dc:creator><description>&lt;p&gt;Have tried another&amp;nbsp;&lt;span&gt;Decawave DWM1001 and the flicker DOES exist on this as well.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>