<?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>GPIO config propagation delay</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60241/gpio-config-propagation-delay</link><description>I have a button matrix (2 rows, multiple columns) connected to an nRF52840. After driving the two row pins appropriately, the first column pin I read (regardless of actual pin #) gives me a phantom hit. Adding a 1&amp;#181;s delay between the config and the read</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Apr 2020 07:44:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60241/gpio-config-propagation-delay" /><item><title>RE: GPIO config propagation delay</title><link>https://devzone.nordicsemi.com/thread/244876?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2020 07:44:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:836a5f21-eb2c-4010-8a07-10f74c6d5099</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As a pure firmware point of view: the peripherals run on the 16 MHz peripheral clock tree, while the CPU runs on 64 MHz. This will then need wait-states to ensure writes/reads. This is done in hardware when setting registers and reading events (for most peripherals, but there are some behavioral issues, as &lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev2/ERR/nRF52840/Rev2/latest/anomaly_840_173.html?cp=4_0_1_0_1_15"&gt;errata #173&lt;/a&gt;),&amp;nbsp;but&amp;nbsp;in this case, you are awaiting a physical change, while reading a RAM location (NRF_Px-&amp;gt;IN register).&lt;/p&gt;
&lt;p&gt;To ensure a wait state on the 16 MHz PCLK (peripheral clock), you can read a event, for instance the (void)NRF_TIMER1-&amp;gt;EVENTS_COMPARE[0] register. Doesn&amp;#39;t matter if you do this for any other peripheral, the wait state of 1 PCLK cycle will be introduced.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That being said, I don&amp;#39;t think adding a small delay of 1 x 16M cycle will help here, because the ROW pins must be set physically high, and you have routing on your board (which act as small capacitors), which will impact the rise/fall time of the GPIO signal. You could try, but I&amp;#39;d recommend having that delay of 1 us, or even higher, to ensure that the signal has crossed the VDD*0.7 threshold to ensure that you read a proper logical &amp;#39;1&amp;#39; on the input side.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>