<?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>Inconsistent GPIO pulse timing when bit-banging (ws2812) on nrf9160 in Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111024/inconsistent-gpio-pulse-timing-when-bit-banging-ws2812-on-nrf9160-in-zephyr</link><description>I&amp;#39;m trying to modify this bit-banging ws2812 gpio Zephy driver to run on an nrf9160 board. The problem is I can&amp;#39;t mange to get consistent pulse timing using assembly instructions, especially at the beginning of the transfer. 
 I know there have been similar</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 May 2024 13:40:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111024/inconsistent-gpio-pulse-timing-when-bit-banging-ws2812-on-nrf9160-in-zephyr" /><item><title>RE: Inconsistent GPIO pulse timing when bit-banging (ws2812) on nrf9160 in Zephyr</title><link>https://devzone.nordicsemi.com/thread/485153?ContentTypeID=1</link><pubDate>Tue, 21 May 2024 13:40:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:236a8503-2cf7-4cf8-86f5-866c8a456a85</guid><dc:creator>Voxorin</dc:creator><description>&lt;p&gt;I don&amp;#39;t think the LFCLK is has a high enough resolution for this case unfortunately.&lt;br /&gt;&lt;br /&gt;I also posted on stackoverflow regarding the assembly and got some good suggestions. Not luck so far though.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://stackoverflow.com/questions/78492544/assembly-nop-delays-in-c-code-have-inconsistent-timing-on-nrf9160-arm-in-zep"&gt;stackoverflow.com/.../assembly-nop-delays-in-c-code-have-inconsistent-timing-on-nrf9160-arm-in-zep&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent GPIO pulse timing when bit-banging (ws2812) on nrf9160 in Zephyr</title><link>https://devzone.nordicsemi.com/thread/485080?ContentTypeID=1</link><pubDate>Tue, 21 May 2024 11:37:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4f2cb12-73dc-481c-b619-2d8301a059a3</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="Voxorin"]I haven&amp;#39;t worked with assembly in C before so I&amp;#39;m a little lost on how to fix this.[/quote]
&lt;p&gt;I have used assembly but not to this extent. You can try to use XTAL LFCLK with better accuracy for RTC to eliminate this reason.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding the GPIOTE driver, it do have more predictable timings with hardware events than gpio driver. So I can also suggest you to try this like others did.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent GPIO pulse timing when bit-banging (ws2812) on nrf9160 in Zephyr</title><link>https://devzone.nordicsemi.com/thread/484783?ContentTypeID=1</link><pubDate>Thu, 16 May 2024 20:47:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ee80dcb-d342-4ca2-a848-db1383172f3a</guid><dc:creator>Voxorin</dc:creator><description>&lt;p&gt;The assembly instructions for both Arm processors are the same as far as I can tell. The timing also seems correct for all of the pulses other than the first &amp;quot;zero&amp;quot; and &amp;quot;one&amp;quot; pulses.&lt;/p&gt;
&lt;p&gt;It seems like a few extra clock cycles are spent on something when calling the nop delays for the first time. I&amp;#39;m not sure how to remove whatever is causing those wasted cycles though.&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t worked with assembly in C before so I&amp;#39;m a little lost on how to fix this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent GPIO pulse timing when bit-banging (ws2812) on nrf9160 in Zephyr</title><link>https://devzone.nordicsemi.com/thread/482766?ContentTypeID=1</link><pubDate>Fri, 10 May 2024 10:51:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:253f45c6-745c-4bde-943d-3ba34b1af6bc</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The Zephyr driver you are using to bit-bang clearly says that it is designed for nRF51 which is using Cortex-M0. On nRF91, which uses Cortex-M33, the core speed and the pipelines is very different. Also I think the way it handles the &amp;quot;nop&amp;quot; instruction is also very different. There are also compiler optimizations that can happen to a series of nop.&lt;/p&gt;
&lt;p&gt;I do not think the delays you are using are guaranteed predefined delays. You might have to find a different and more effective way to have a distinct and predefined delay when you want to bit bang this on nRF91.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>