<?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>Does the GPIOTE effect the GPIO pin configuration in particular the drive I need to keep it Disconnect 0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57790/does-the-gpiote-effect-the-gpio-pin-configuration-in-particular-the-drive-i-need-to-keep-it-disconnect-0</link><description>Hi 
 Using PCA 10040A , SDK 16.0.0 and Segger Studio. 
 I would like to generate a short accurate *** on a GPIO , probably 250 nano seconds duration. So I am looking at using the GPIOTE feature. 
 However I need to keep the GPIO drive configuration as</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 19 Feb 2020 15:26:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57790/does-the-gpiote-effect-the-gpio-pin-configuration-in-particular-the-drive-i-need-to-keep-it-disconnect-0" /><item><title>RE: Does the GPIOTE effect the GPIO pin configuration in particular the drive I need to keep it Disconnect 0</title><link>https://devzone.nordicsemi.com/thread/235246?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 15:26:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0846e5c-7e14-4f7c-afdc-adb9f5686218</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Robin&lt;/p&gt;
&lt;p&gt;Yes, if you want a callback after the pulse is complete you should enable interrupts as you describe. This will happen more or less immediately if you set the pulse length to 250ns ;)&lt;/p&gt;
&lt;p&gt;[quote user="radams"][/quote]&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also I will want to change the period of the pulse, so once this is all setup can i simply call&amp;nbsp; nrf_drv_timer_extended_compare(&amp;amp;timer, (nrf_timer_cc_channel_t)1, 1 + LED_ON_TICKS, &lt;br /&gt; NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK | NRF_TIMER_SHORT_COMPARE1_STOP_MASK, false);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;again but with a new time period ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes, this should work fine.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does the GPIOTE effect the GPIO pin configuration in particular the drive I need to keep it Disconnect 0</title><link>https://devzone.nordicsemi.com/thread/235004?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2020 17:08:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1422647e-7d92-47ec-91a1-7ea0b10f450b</guid><dc:creator>robin</dc:creator><description>&lt;p&gt;Hi Torbjorn&lt;/p&gt;
&lt;p&gt;Great this is what I need, i assume&amp;nbsp; I will need to set the interrupt enable parameter (the last param) in the 2nd call to&amp;nbsp;&amp;nbsp;&lt;span&gt;nrf_drv_timer_extended_compare()&amp;nbsp; so that the &amp;quot;timer_dummy_handler()&amp;quot; function&amp;nbsp;is called when the 2nd event occurs and I will know the pulse has completed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also I will want to change the period of the pulse, so once this is all setup can i simply call&amp;nbsp; nrf_drv_timer_extended_compare(&amp;amp;timer, (nrf_timer_cc_channel_t)1, 1 + LED_ON_TICKS, &lt;br /&gt; NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK | NRF_TIMER_SHORT_COMPARE1_STOP_MASK, false);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;again but with a new time period ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And then use&amp;nbsp; &amp;nbsp;nrf_drv_timer_resume()&amp;nbsp; to start it again with the new time period for the 2nd compare&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thanks Robin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does the GPIOTE effect the GPIO pin configuration in particular the drive I need to keep it Disconnect 0</title><link>https://devzone.nordicsemi.com/thread/234947?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2020 14:01:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79727b5c-4a10-467b-bc3b-ec736a78e4eb</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Robin&lt;/p&gt;
&lt;p&gt;If you replace the CLEAR mask with the STOP mask it means you have to clear and restart the timer manually for each pulse.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think a better approach is to use two CC registers on the timer: One to raise the pin immediately (or after 1 tick), and a second one to clear it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then you can use shortcuts to stop and clear the timer after the second compare event, and simply start the timer every time you want a pulse to be generated.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Starting a timer can be done either manually by the CPU, or through a PPI channel from some other peripheral.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I modified the gpiote example to illustrate the software method:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-7d5127f61a9e4903a3b28f7a44c3cafa/244388_5F00_gpiote.zip"&gt;devzone.nordicsemi.com/.../244388_5F00_gpiote.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does the GPIOTE effect the GPIO pin configuration in particular the drive I need to keep it Disconnect 0</title><link>https://devzone.nordicsemi.com/thread/234747?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 17:31:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db281973-a2f9-475b-8f66-7033a1dc6994</guid><dc:creator>robin</dc:creator><description>&lt;p&gt;Hi Torbjorn&lt;/p&gt;
&lt;p&gt;Thank you for your help this is starting to make sense and will save me a lot of time. So its looks like the best way for me to generate a short pulse , say 250ns, would be to have 2 timers connected to one gpiote , the first timing isnt critical it would be used to take the GPIO high and then second timer would be the critical one and this would take the GPIO LOW.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I assume I would set the timers up as&amp;nbsp;NRF_TIMER_SHORT_COMPARE0_STOP_MASK and that I would need to enable interrupts by setting the parameter true in &amp;quot;nrfx_timer_extended_compare(...)&amp;quot; for the 2nd timer only so I knew that it had completed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are there any similar examples I could look at for the above.&lt;/p&gt;
&lt;p&gt;I did try playing with the &amp;quot;gpiote&amp;quot; example provided that toggles one GPIO every 200ms.&lt;br /&gt;&lt;span&gt;I changed&amp;nbsp;&amp;nbsp;&amp;nbsp;NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK to NRF_TIMER_SHORT_COMPARE0_STOP_MASK in the function&amp;nbsp;led_blinking_setup() and enabled interrupts in the&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;nrf_drv_timer_extended_compare()&amp;quot; function call.&lt;br /&gt;I then expected to see the GPIO toggle hi then low for the period I had selected, but all I saw on my scope was the GPIO going high and staying high. &lt;br /&gt;Why doesnt this work ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thanks RObin&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does the GPIOTE effect the GPIO pin configuration in particular the drive I need to keep it Disconnect 0</title><link>https://devzone.nordicsemi.com/thread/234597?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 10:01:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efa2c4c7-41a3-4f5c-becb-c27c5cc44965</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Robin&lt;/p&gt;
&lt;p&gt;If you write to the CC registers in the TIMER module you can decide exactly how many timer pulses should elapse before the corresponding COMPARE event should be generated, and use this to set or clear the pin through the GPIOTE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;TIMER3 and 4 have a total of 6 CC registers, allowing you to prepare 6 such events ahead of time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Assuming the PRESCALER register is set to 0 each count will equal 62.5ns, as you say.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For a sample of how to write to the TIMER, PPI and GPIOTE registers&amp;nbsp;you can have a look at the &lt;a href="https://github.com/NordicPlayground/nrf52-timer-gpiote-ppi-hands-on/blob/master/main.c#L68"&gt;following function&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does the GPIOTE effect the GPIO pin configuration in particular the drive I need to keep it Disconnect 0</title><link>https://devzone.nordicsemi.com/thread/234479?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 16:43:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e39e48a-dbd5-4def-84aa-79983611603b</guid><dc:creator>robin</dc:creator><description>&lt;p&gt;Hi Torbjorn&lt;/p&gt;
&lt;p&gt;Thanks for that clarification I wanted to make sure the drive stays the same when the GPIOTE takes over.&lt;/p&gt;
&lt;p&gt;Also I need to generate a pulse period in nanoseconds, I assume with 16Mhz clock that will be a minimum pulse of 62.5ns , can you provide some insight how I should do that ?&amp;nbsp; I see from all the examples there are functions to convert ms and us to ticks but nothing smaller.&lt;/p&gt;
&lt;p&gt;Also I want to make sure nothing affects this timing , what should I disable etc while I am waiting for the event to indicate its completed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks RObin&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does the GPIOTE effect the GPIO pin configuration in particular the drive I need to keep it Disconnect 0</title><link>https://devzone.nordicsemi.com/thread/234445?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 14:16:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da009b64-66f5-44d5-994c-f0545e1facc4</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Robin&lt;/p&gt;
&lt;p&gt;You should be able to change drive settings even if the GPIOTE module is connected to a pin.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you look at figure 1 &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html?cp=4_0_0_5_8_0#concept_o12_bgv_bs"&gt;here&lt;/a&gt; you can see that there are OVERRIDE signals for pin direction, out pin state and input connection, allowing peripherals such as the GPIOTE module to override the settings you configure, but DRIVE settings are not covered by this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In other words the drive settings should still be available for you to change.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are having issues getting this to work let me know, and I will have a look.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>