<?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>I can&amp;#39;t control LED belt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97539/i-can-t-control-led-belt</link><description>I am using nrf52832 and developing with FreeRTOS. I want to use Bluetooth and control a WS2812 LED strip simultaneously. When I don&amp;#39;t start Bluetooth, i.e. //nrf_sdh_freertos_init(advertising_start, &amp;amp;erase_bonds), I can control the LED strip normally</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Mar 2023 09:12:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97539/i-can-t-control-led-belt" /><item><title>RE: I can't control LED belt</title><link>https://devzone.nordicsemi.com/thread/415087?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 09:12:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb88f918-364f-4aa9-a166-56e1c73d670f</guid><dc:creator>suhaihui</dc:creator><description>&lt;p&gt;I give up, i used pwm replace timer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I can't control LED belt</title><link>https://devzone.nordicsemi.com/thread/415080?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 09:01:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:faf1834c-9224-4f2e-8e6c-f8e958abe2f0</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;Please show the full code how you call LED_Write0 and LED_Write1.&lt;br /&gt;Have you looked at how we use timer in the&amp;nbsp;&lt;span&gt;ble_app_hrs_freertos&amp;nbsp;example ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I can't control LED belt</title><link>https://devzone.nordicsemi.com/thread/415046?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 04:59:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06bbd3a3-4af8-459d-ba67-2bd1a57e9af8</guid><dc:creator>suhaihui</dc:creator><description>&lt;p&gt;1. I was used timer1&lt;br /&gt;&amp;nbsp; &amp;nbsp;ie:&amp;nbsp;NRF_DRV_TIMER_INSTANCE(1)&lt;br /&gt;2.&amp;nbsp;&lt;span&gt;&amp;nbsp;I tried to test with&amp;nbsp;APP_IRQ_PRIORITY_LOW&lt;br /&gt;&amp;nbsp; &amp;nbsp;same result&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. It stay in interrupt less then 0.5ms&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I control ws2812 like this&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define   RGB_H      (NRF_GPIO-&amp;gt;OUTSET = (1UL &amp;lt;&amp;lt; TARGET_LED1_PIN))   
#define   RGB_L      (NRF_GPIO-&amp;gt;OUTCLR = (1UL &amp;lt;&amp;lt; TARGET_LED1_PIN))  

static void LED_Write0(void)
{
	RGB_H;
	__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
	__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
	RGB_L;
	__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
	__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
    __NOP();
}

static void LED_Write1(void)
{
	RGB_H;
	__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
	__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
    __NOP();__NOP();__NOP();__NOP();__NOP();
    __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
	__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
	
	RGB_L;
	__NOP();__NOP();__NOP();
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I can't control LED belt</title><link>https://devzone.nordicsemi.com/thread/414821?ContentTypeID=1</link><pubDate>Mon, 13 Mar 2023 08:50:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1348a89c-35af-4bad-b7c4-68ed65b45868</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Suhaihui,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think using the hardware timer can be tricky when using with FreeRTOS.&amp;nbsp;&lt;br /&gt;How long do you stay in the interrupt handler ? Have you tried to test with&amp;nbsp;APP_IRQ_PRIORITY_LOW ?&amp;nbsp;&lt;br /&gt;Which timer do you use ? Please be aware that TIMER0 is blocked by the softdevice and you should choose other TIMER.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I can't control LED belt</title><link>https://devzone.nordicsemi.com/thread/414768?ContentTypeID=1</link><pubDate>Sun, 12 Mar 2023 04:38:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61ffa0f1-7d4f-4950-ad0c-0a2d202e4f33</guid><dc:creator>suhaihui</dc:creator><description>&lt;p&gt;I was use hardware timer to control ws2812.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t led_hardware_timer_init(void)
{
	uint32_t err_code = NRF_SUCCESS;
	
	nrf_drv_timer_config_t timer_config;
	timer_config.frequency = NRF_TIMER_FREQ_62500Hz;
	timer_config.mode = NRF_TIMER_MODE_TIMER;
	timer_config.bit_width = NRF_TIMER_BIT_WIDTH_24;
	timer_config.interrupt_priority = APP_IRQ_PRIORITY_HIGHEST;
	timer_config.p_context = NULL;
	
	err_code = nrf_drv_timer_init(&amp;amp;led_timer, &amp;amp;timer_config, led_timeout_handler);
    
    if(NRF_SUCCESS == err_code)
	{
        m_led_timer_state = TIMER_STATE_INITIALIZED;
	}
	
	return err_code;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I can't control LED belt</title><link>https://devzone.nordicsemi.com/thread/414556?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 09:07:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2679a02f-bc92-427c-a577-7ed78310ce59</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Suhaihui,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you please show how do you control the WS2812. Please show the task that handle the LEDs.&amp;nbsp;&lt;br /&gt;You mentioned it became abnormal, could you give more info on what exactly happened ?&amp;nbsp;&lt;br /&gt;Have you looked at our ble_app_hrs_freertos example ? Please see how we run the xtimers to do different tasks there.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>