<?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>How to trigger 2 timers on same PPI event</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53096/how-to-trigger-2-timers-on-same-ppi-event</link><description>I have the following code. I need to add a second counter attached to the spi_end_event. The first counter &amp;quot;count_task&amp;quot; is working, but can you tell me how to get &amp;quot;count_task2&amp;quot; to also count on every spi_end_event? I&amp;#39;m unclear on how to get multiple tasks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Oct 2019 17:25:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53096/how-to-trigger-2-timers-on-same-ppi-event" /><item><title>RE: How to trigger 2 timers on same PPI event</title><link>https://devzone.nordicsemi.com/thread/214461?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 17:25:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93f7e158-56d4-4e7a-8768-62e102ea0570</guid><dc:creator>mzarling</dc:creator><description>&lt;p&gt;Thank you for posting your code. It made me go back and review mine and I found a mistake in the ppi channel enable for the new channel. It is working for me now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to trigger 2 timers on same PPI event</title><link>https://devzone.nordicsemi.com/thread/214429?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 14:23:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa56b26b-84dd-47b9-b879-07bd78085b89</guid><dc:creator>Andy</dc:creator><description>&lt;p&gt;I tried it and it works.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t err_code = nrf_drv_ppi_init();
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_ppi_channel_alloc(&amp;amp;m_adc.saadc_restart_ppi_channel);
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_ppi_channel_alloc(&amp;amp;m_adc.timer_stop_ppi_channel);
APP_ERROR_CHECK(err_code);

// Make sure that the SAADC is always started when it ends a conversion
err_code = nrf_drv_ppi_channel_assign(m_adc.saadc_restart_ppi_channel,
									  nrf_saadc_event_address_get(NRF_SAADC_EVENT_END),
									  nrf_saadc_task_address_get(NRF_SAADC_TASK_START));
APP_ERROR_CHECK(err_code);

// Stop the timer when SAADC finishes a conversion
err_code = nrf_drv_ppi_channel_assign(m_adc.timer_stop_ppi_channel,
									  nrf_saadc_event_address_get(NRF_SAADC_EVENT_END),
									  nrf_drv_timer_task_address_get(&amp;amp;m_adc_timer, NRF_TIMER_TASK_STOP));
APP_ERROR_CHECK(err_code);

// Enable SAADC restart PPI channel
err_code = nrf_drv_ppi_channel_enable(m_adc.saadc_restart_ppi_channel);
APP_ERROR_CHECK(err_code);

// Enable timer stop PPI channel
err_code = nrf_drv_ppi_channel_enable(m_adc.timer_stop_ppi_channel);
APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to trigger 2 timers on same PPI event</title><link>https://devzone.nordicsemi.com/thread/214409?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 13:53:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0c8d0dc-940c-41f0-81d4-001b7e0917ff</guid><dc:creator>mzarling</dc:creator><description>&lt;p&gt;I tried that previously with the following lines at the end of the code I showed above. The timer4 event handler never happens, but the timer2 event handler still does. Timer4 is set up just like timer2, except with different compare count value. This is why I figured I was doing something wrong.&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:#ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; status = nrfx_ppi_channel_assign(m_ppi_channel2, spi_end_event, count_task2);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(status);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to trigger 2 timers on same PPI event</title><link>https://devzone.nordicsemi.com/thread/214360?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 12:16:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a321dfcf-de2a-4cfb-8666-7179ec06ddfb</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Yes, that&amp;#39;s true, and much easier.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to trigger 2 timers on same PPI event</title><link>https://devzone.nordicsemi.com/thread/214356?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 12:13:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f59d0cdd-c096-4888-9d04-da0939d56369</guid><dc:creator>Andy</dc:creator><description>&lt;p&gt;Isn&amp;#39;t it possible to just allocate a second PPI channel with the same EEP and a TEP pointing to the task of another timer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to trigger 2 timers on same PPI event</title><link>https://devzone.nordicsemi.com/thread/214349?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 11:59:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93398330-e9d4-4e1f-b978-fdb736036c0b</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;You can use the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/egu.html?cp=3_1_0_45#concept_x4j_fx1_lr"&gt;EGU — Event generator unit&lt;/a&gt;&amp;nbsp;to create another event, and you can then fork that event into two tasks.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;See&amp;nbsp;&lt;a title="EGU HAL" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__egu__hal.html?cp=5_1_6_9_0_33_2"&gt;EGU HAL&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>