<?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>nRF9160 &amp;gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49949/nrf9160-count-pulse-on-gpio</link><description>Dear Team, 
 what is the way to do it in Zephyr? 
 I have a signal up-to 10kHz, what is the best way to keep the counter in the background? 
 Thank you and best 
 Oleh</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Oct 2019 09:49:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49949/nrf9160-count-pulse-on-gpio" /><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/217275?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 09:49:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1f79077-831f-4de9-a27c-df476c77e87e</guid><dc:creator>Oleh</dc:creator><description>&lt;p&gt;Hi Didrik,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;you just rock! thank you for all your support!&lt;/p&gt;
&lt;p&gt;Best&lt;/p&gt;
&lt;p&gt;Oleh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/217259?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 08:55:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1955ba16-7c65-437c-a466-578de0251c04</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;After digging some more through the nrfx drivers, I also found the nrfx_dppi_channel_disable (and _enable) functions, which should let you stop and start the specific DPPI channel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/217250?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 08:25:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c372f449-8ef2-4771-9b68-a2b00dca1999</guid><dc:creator>Oleh</dc:creator><description>&lt;p&gt;Hi and thank you for your input.&lt;/p&gt;
&lt;p&gt;I managed to update and make the code working! great! thank you!&lt;/p&gt;
&lt;p&gt;Regarding the Suspend/Resume, just for info: I need it in order to save power, as the sensor is external and connected to a stepup convertor, so when not in use -- I would like to power it off. Thus also disable DPPI.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Oleh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/217179?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 16:31:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bbc4cff-7a36-484e-bffd-44b7e935c57c</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi, and sorry for the late reply.&lt;/p&gt;
&lt;p&gt;For resetting counters, I would use the nrfx_timer_clear function.&lt;/p&gt;
&lt;p&gt;For suspending/resuming DPPI, you would have to either stop the events from being generated, not publish the events, or subscribe to them (or all at once).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/216532?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2019 08:58:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5aa23955-c896-4dff-90ca-1d32f9ec97f6</guid><dc:creator>Oleh</dc:creator><description>&lt;p&gt;Hello and thank you!&lt;/p&gt;
&lt;p&gt;short question: what is the best way to suspend / resume the ppi in this sample?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style="text-align:left;"&gt;and how to safely reset counters?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/216519?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2019 08:34:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:710e41e0-6814-4cc2-a644-e7077e0d5146</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;A pull request for a sample demonstrating how to use the nrfx drivers in Zephyr was just opened.&lt;/p&gt;
&lt;p&gt;Hopefully, it is able to help you.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/pull/20089/files"&gt;https://github.com/zephyrproject-rtos/zephyr/pull/20089/files&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/216394?ContentTypeID=1</link><pubDate>Wed, 23 Oct 2019 13:26:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58cffda3-42c1-4729-8232-5435a2b3447e</guid><dc:creator>Oleh</dc:creator><description>&lt;p&gt;thank you, now I am trying to make it working on the latest ncs git... but getting errors...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;is there anything I have to change?&lt;/p&gt;
&lt;p&gt;***** Booting Zephyr OS build v1.14.99-ncs3-snapshot2-2647-gd6e67554cfeb *****&lt;br /&gt;starting application...&lt;br /&gt;starting init gpiote...&lt;br /&gt;prepare time 1 cfg...&lt;br /&gt;uninit time 1...&lt;br /&gt;init time 1...&lt;br /&gt;prepare time 2 cfg...&lt;br /&gt;uninit time 2...&lt;br /&gt;init time 2...&lt;br /&gt;nrfx_timer_ms_to_ticks...&lt;br /&gt;nrfx_timer_extended_compare...&lt;br /&gt;gpiote_setup...&lt;br /&gt;gpiote_setup...&lt;br /&gt;gpiote_evt_addr: 0x5000d100&lt;br /&gt;NRF_GPIOTE_EVENTS_IN_0: 0x00000100&lt;br /&gt;NRF_GPIOTE1_NS: 0x40031000&lt;br /&gt;gpiote_evt_addr - NRF_GPIOTE0_S: 0x0ffdc100&lt;br /&gt;[00:00:00.069,274] &amp;lt;err&amp;gt; os: ***** BUS FAULT *****&lt;br /&gt;[00:00:00.069,274] &amp;lt;err&amp;gt; os:&amp;nbsp;&amp;nbsp; Precise data bus error&lt;br /&gt;[00:00:00.069,274] &amp;lt;err&amp;gt; os:&amp;nbsp;&amp;nbsp; BFAR Address: 0x40010088&lt;br /&gt;[00:00:00.069,305] &amp;lt;err&amp;gt; os: r0/a1:&amp;nbsp; 0x00000000&amp;nbsp; r1/a2:&amp;nbsp; 0x00000001&amp;nbsp; r2/a3:&amp;nbsp; 0x80000000&lt;br /&gt;[00:00:00.069,305] &amp;lt;err&amp;gt; os: r3/a4:&amp;nbsp; 0x40010088 r12/ip:&amp;nbsp; 0x00000030 r14/lr:&amp;nbsp; 0x0000061f&lt;br /&gt;[00:00:00.069,305] &amp;lt;err&amp;gt; os:&amp;nbsp; xpsr:&amp;nbsp; 0x29000000&lt;br /&gt;[00:00:00.069,305] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x00000632&lt;br /&gt;[00:00:00.069,335] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception&lt;br /&gt;[00:00:00.069,335] &amp;lt;err&amp;gt; os: Current thread: 0x20000274 (unknown)&lt;br /&gt;[00:00:00.140,075] &amp;lt;err&amp;gt; os: Halting system&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/206348?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 11:36:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e379ef18-0ea8-4e38-816b-26fd31163e1b</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi, and apologies for the late answer.&lt;/p&gt;
&lt;p&gt;I believe that most of the code you posted should work, but especially the parts concerning PPI would not work due to differences between PPI and DPPI.&lt;/p&gt;
&lt;p&gt;I was able to port an example written by&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/jared"&gt;Jared&lt;/a&gt;&amp;nbsp;for another case. The sample is made to measure much higher frequencies than what you have, so you might want to edit some of the timer configurations in main().&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-f5798b535c964dd2961758560dc2b2aa/dppi_5F00_frequency.zip"&gt;devzone.nordicsemi.com/.../dppi_5F00_frequency.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To make the sample compile, you must also add&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define GPIOTE_IRQn GPIOTE0_IRQn&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;in ncs/zephyr/ext/hal/nordic/nrfx_config_nrf9160.h, on line 200.&lt;/p&gt;
&lt;p&gt;Also, you must configure the DPPI peripheral as non-secure as done in a previous comment.&lt;/p&gt;
&lt;p&gt;A pre-compiled hex file is included for your convenience.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/205187?ContentTypeID=1</link><pubDate>Wed, 21 Aug 2019 07:17:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bff78c06-598f-4a17-83aa-a7c57f3de7a2</guid><dc:creator>Oleh</dc:creator><description>&lt;p&gt;am I on the right way?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
static void timer_init()
{
 NRF_TIMER1_NS-&amp;gt;TASKS_STOP = 1;
 NRF_TIMER1_NS-&amp;gt;MODE = TIMER_MODE_MODE_Timer;
 NRF_TIMER1_NS-&amp;gt;PRESCALER = 8; // Fhck / 2^8 
 NRF_TIMER1_NS-&amp;gt;CC[0] = 62500; // 62500 - 1s
 
 NRF_TIMER1_NS-&amp;gt;BITMODE = (TIMER_BITMODE_BITMODE_16Bit &amp;lt;&amp;lt; TIMER_BITMODE_BITMODE_Pos); 
 
 NRF_TIMER1_NS-&amp;gt;TASKS_CLEAR = 1;
 NRF_TIMER1_NS-&amp;gt;INTENSET = (TIMER_INTENSET_COMPARE0_Enabled &amp;lt;&amp;lt; TIMER_INTENSET_COMPARE0_Pos);
 
 NRF_TIMER1_NS-&amp;gt;EVENTS_COMPARE[0] = 0;
}

static void counter_init()
{
 NRF_TIMER2_NS-&amp;gt;TASKS_STOP = 1; 
 NRF_TIMER2_NS-&amp;gt;MODE = TIMER_MODE_MODE_Counter;
 NRF_TIMER2_NS-&amp;gt;BITMODE = (TIMER_BITMODE_BITMODE_24Bit &amp;lt;&amp;lt; TIMER_BITMODE_BITMODE_Pos);
 NRF_TIMER2_NS-&amp;gt;TASKS_CLEAR = 1;
 NRF_TIMER2_NS-&amp;gt;EVENTS_COMPARE[0] = 0;
}

#define SENSE_PIN 13
static void gpiote_init(uint32_t pin)
{
 NRF_GPIOTE1_NS-&amp;gt;CONFIG[0]  =  0x01 &amp;lt;&amp;lt; 0;         // MODE: Event
 NRF_GPIOTE1_NS-&amp;gt;CONFIG[0]  |=  SENSE_PIN &amp;lt;&amp;lt; 8;       // Pin number
 NRF_GPIOTE1_NS-&amp;gt;CONFIG[0]  |=  NRF_GPIOTE_POLARITY_LOTOHI &amp;lt;&amp;lt; 16;  // Event rising edge  
}

static void ppi_timer_stop_counter_init()
{
 //NRF_DPPIC_NS-&amp;gt;CHEN |= 1 &amp;lt;&amp;lt; 0;
 //*(&amp;amp;(NRF_DPPIC_NS-&amp;gt;CH0_EEP)) = (uint32_t)&amp;amp;NRF_TIMER1_NS-&amp;gt;EVENTS_COMPARE[0];
 //*(&amp;amp;(NRF_DPPIC_NS-&amp;gt;CH0_TEP)) = (uint32_t)&amp;amp;NRF_TIMER2_NS-&amp;gt;TASKS_STOP;
 //NRF_DPPIC_NS-&amp;gt;CHENSET |= 1 &amp;lt;&amp;lt; 0;
 
 #define EVT_IX_TIMER1__COMPARE 1
 #define TSK_IX_TIMER2__STOP_COUNTER 1
    // Configure GPIOTE Index 0 to be an Event -&amp;gt; 
    nrf_gpiote_event_configure(EVT_IX_TIMER1__COMPARE, nrf_timer_event_address_get(NRF_TIMER1_NS, NRF_TIMER_EVENT_COMPARE_1) ...);
    // Configure GPIOTE Index 1 to be a Task -&amp;gt; 
    nrf_gpiote_task_configure(TSK_IX_TIMER2__STOP_COUNTER, nrf_timer_event_address_get(NRF_TIMER2_NS, NRF_TIMER_TASK_COUNT) ...);
    // Index 0 will Publish on DPPI Channel 0 
    nrf_gpiote_publish_set(NRF_GPIOTE_EVENTS_IN_0, DPPI_CHANNEL);
    // Index 1 will Subscribe on DPPI Channel 0 
    nrf_gpiote_subscribe_set(NRF_GPIOTE_TASKS_OUT_1, DPPI_CHANNEL);
    // Enable Publish and Subscribe 
    nrf_gpiote_event_enable(EVT_IX_TIMER1__COMPARE);
    nrf_gpiote_task_enable(TSK_IX_TIMER2__STOP_COUNTER);
    // Enable DPPI Channel 
    nrf_dppi_channels_enable(NRF_DPPIC, DPPI_BIT_SET(DPPI_CHANNEL));
}

static void ppi_gpiote_counter_init()
{
 NRF_DPPIC_NS-&amp;gt;CHEN |= 1 &amp;lt;&amp;lt; 1;
 *(&amp;amp;(NRF_DPPIC_NS-&amp;gt;CH1_EEP)) = (uint32_t)&amp;amp;NRF_GPIOTE1_NS-&amp;gt;EVENTS_IN[0];
 *(&amp;amp;(NRF_DPPIC_NS-&amp;gt;CH1_TEP)) = (uint32_t)&amp;amp;NRF_TIMER2_NS-&amp;gt;TASKS_COUNT;
 NRF_DPPIC_NS-&amp;gt;CHENSET |= 1 &amp;lt;&amp;lt; 1;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/205143?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 21:12:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ca7f03d-3645-4dc4-9d98-32eb310dfb6b</guid><dc:creator>Oleh</dc:creator><description>&lt;p&gt;Hi Didrik, thanks! that was to make the ppi_trace to work.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;could you please help on wiring Counter and Timer to get it with DPPI as here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/9036/measuring-input-gpio-pin-frequency-with-soft-device-running"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/9036/measuring-input-gpio-pin-frequency-with-soft-device-running&lt;/a&gt;&amp;nbsp;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/204961?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 08:58:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39cba5a0-ecd0-4d1d-afe9-77985a68bb29</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Almost.&lt;/p&gt;
&lt;p&gt;In addition to&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;PERPIH(&amp;quot;NRF_DPPI&amp;quot;, NRF_DPPIC_NS, CONFIG_SPM_NRF_DPPIC_NS),&lt;/pre&gt; in spm.c:304 and&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;if (IS_ENABLED(CONFIG_SPM_NRF_GPIOTE1_NS)) {
    NRF_SPU-&amp;gt;DPPI[0].PERM = 0;
}&lt;/pre&gt;in spm.c:326&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I also had to add&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;PERIPH(&amp;quot;NRF_RTC0&amp;quot;, NRF_RTC0, CONFIG_SPM_NRF_RTC0_NS),&lt;/pre&gt; in spm.c:305,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;config SPM_NRF_DPPIC_NS
	bool &amp;quot;DPPI is Non-Secure&amp;quot;
	default y

config SPM_NRF_RTC0_NS
	bool &amp;quot;RTC0 is Non-Secure&amp;quot;
	default y&lt;/pre&gt; in ncs/nrf/subsys/spm/Kconfig:180, and&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_PPI_TRACE_PIN_RTC_COMPARE_EVT=10
CONFIG_PPI_TRACE_PIN_RTC_TICK_EVT=11
CONFIG_PPI_TRACE_PIN_LFCLOCK_STARTED_EVT=12&lt;/pre&gt; in prj.conf&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/204838?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2019 15:00:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aae9e958-093d-4409-859a-4dc9d4b91071</guid><dc:creator>Oleh</dc:creator><description>&lt;p&gt;aha! that was the missing part, thank you!&lt;/p&gt;
&lt;p&gt;I will try for the Secure board.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In order to use DPPI on the NonSecure, would this be sufficient:&lt;/p&gt;
&lt;p&gt;PERIPH(&amp;quot;NRF_DPPI&amp;quot;, NRF_DPPIC_NS, CONFIG_SPM_NRF_DPPIC_NS), // adding to spm.c in the&amp;nbsp;periph_cfg periph[]&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And also:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;if (IS_ENABLED(CONFIG_SPM_NRF_GPIOTE1_NS)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;/* Configure DPPI to be Non-Secure */&lt;br /&gt;&amp;nbsp;&amp;nbsp;NRF_SPU-&amp;gt;DPPI[0].PERM = 0;&lt;br /&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/204835?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2019 14:54:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c250647-d295-4707-aad6-47c3336ec7fa</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;The ppi_trace sample worked for me.&lt;/p&gt;
&lt;p&gt;I did not get any build errors.&lt;/p&gt;
&lt;p&gt;However, I did have to change the pins used to 10, 11, and 12. You can do this in the Kconfig file in the sample, or by adding the relevant configurations in the prj.conf file.&lt;/p&gt;
&lt;p&gt;Also, the sample should be built as a secure application (use target nrf9160_pca10090, no ns).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/204599?ContentTypeID=1</link><pubDate>Sun, 18 Aug 2019 11:31:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2735b131-f558-40bf-8ad6-44176478c96d</guid><dc:creator>Oleh</dc:creator><description>&lt;p&gt;thanks for the hint! I&amp;#39;m trying it out...&lt;/p&gt;
&lt;p&gt;first blocker was:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/49657/how-to-link-nrfx-gpiote-and-ppi-in-zephyr/198090#198090"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/49657/how-to-link-nrfx-gpiote-and-ppi-in-zephyr/198090#198090&lt;/a&gt;&amp;nbsp;when adding the config -- it picked up.&lt;/p&gt;
&lt;p&gt;second blocker is &amp;quot;GPIOTE_IRQn undeclared&amp;quot; for nRF9160 (there are two: GPIOTE0_IRQn/&lt;span&gt;GPIOTE0_IRQn defined in&amp;nbsp;\zephyr\ext\hal\nordic\nrfx\mdk\nrf9160.h)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;am I missing something? Or was the ppi_trace never configured+tested on nRF9160?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/203282?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 11:16:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00433578-5999-46a9-9cde-753585e2333c</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Yes, you can use GPIOTE and &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf9160%2Fdppi.html&amp;amp;cp=2_0_0_5_1"&gt;DPPI&lt;/a&gt; on the nRF91.&lt;/p&gt;
&lt;p&gt;It looks like Zephyr&amp;#39;s GPIO driver uses GPIOTE internally.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.0.0/nrf/samples/debug/ppi_trace/README.html"&gt;PPI trace sample&lt;/a&gt; works with both nRF91 and nRF52 and might be a good starting point on how to use DPPI.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/203256?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 10:14:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9eec4be3-984d-495c-b9dd-4d4befb0393a</guid><dc:creator>Oleh</dc:creator><description>&lt;p&gt;Hi, thank you!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Just a short confirmation question: can I use Gpiote/PPI in Zephyr with nrf91?&lt;/p&gt;
&lt;p&gt;Best&lt;/p&gt;
&lt;p&gt;Oleh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/202984?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 08:45:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd20e528-43f3-4f68-b1f1-1ef357c20b37</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Here is the code I used to count pulses. It does not calculate the frequency, but that should be easy to do if you see how many pulses you get per unit of time.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-f5798b535c964dd2961758560dc2b2aa/reader.zip"&gt;devzone.nordicsemi.com/.../reader.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/202961?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 06:51:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1942748e-9feb-48ea-9b34-96a9f0a4b381</guid><dc:creator>Oleh</dc:creator><description>&lt;p&gt;Hi Didrik,&lt;/p&gt;
&lt;p&gt;thank you for the suggestion, It is clear with the pwm part, got it working.&lt;/p&gt;
&lt;p&gt;what i am not able to catch is the sensing that frequency on the input part. Tried the gpio to config in input, then reading buffer, seems ok to get bits 0s/1s but somehow to get to the frequency not... i&amp;rsquo;m stuck.&lt;/p&gt;
&lt;p&gt;May I ask you for a snippet?&lt;/p&gt;
&lt;p&gt;thank you!&lt;/p&gt;
&lt;p&gt;best&lt;/p&gt;
&lt;p&gt;Oleh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/199591?ContentTypeID=1</link><pubDate>Fri, 19 Jul 2019 18:39:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1064a3b-e453-4510-b0ee-e37b0f4f775b</guid><dc:creator>Oleh</dc:creator><description>&lt;p&gt;Hi Didrik,&lt;/p&gt;
&lt;p&gt;thank you! will try all of it &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Oleh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/199245?ContentTypeID=1</link><pubDate>Thu, 18 Jul 2019 11:40:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8566c0b0-9651-4be0-be52-8b51ba359115</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Take a look at the&amp;nbsp;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.0.0/zephyr/reference/peripherals/pwm.html"&gt;PWM driver documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/199199?ContentTypeID=1</link><pubDate>Thu, 18 Jul 2019 09:38:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2025a24-1095-4451-9c65-9bcaea152113</guid><dc:creator>Oleh</dc:creator><description>&lt;p&gt;Hi Didrik,&lt;/p&gt;
&lt;p&gt;thank you, I&amp;#39;m new to Zephyr so trying to map my nrf knowledge to zephyr &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To complement and test the counter on gpio, I thought to put the second DevKit board into generation mode. Could you please point on the right track with how can the generation on-off be done in background on Zephyr?&lt;/p&gt;
&lt;p&gt;thanks &amp;amp; best&lt;/p&gt;
&lt;p&gt;Oleh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 &gt; Count pulse on GPIO</title><link>https://devzone.nordicsemi.com/thread/199153?ContentTypeID=1</link><pubDate>Thu, 18 Jul 2019 08:39:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c127222-17bd-4fc5-afcb-6df9dd5ad686</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;You can use Zephyr&amp;#39;s GPIO driver to configure interrupts.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have a look at the documentation&amp;nbsp;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.0.0/zephyr/reference/peripherals/gpio.html"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>