<?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>nRF52832 use PPI to control an output pin GPIOTE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57306/nrf52832-use-ppi-to-control-an-output-pin-gpiote</link><description>I am trying to use PPI to control an output pin. I am successfully using 2 PPI channels at the moment to use the COMP to do freq counting over a 10mS time period. I have added a 3rd PPI channel to turn an output off in below code. 
 
 Then I have a seperate</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Feb 2020 15:04:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57306/nrf52832-use-ppi-to-control-an-output-pin-gpiote" /><item><title>RE: nRF52832 use PPI to control an output pin GPIOTE</title><link>https://devzone.nordicsemi.com/thread/232388?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 15:04:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8935f916-8c63-48ff-ace9-b9d972074f18</guid><dc:creator>Philip</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;That worked! Thanks.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Getting a 10mS On pulse now at 32Hz.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Phil&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 use PPI to control an output pin GPIOTE</title><link>https://devzone.nordicsemi.com/thread/232386?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 14:59:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc460309-e361-4506-a56e-90da7000c741</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Phil,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="philipm"]If I do toggle the pin does toggle ok.[/quote]
&lt;p&gt;&amp;nbsp;This is good. The &amp;quot;logic underneath&amp;quot; works as it should&amp;nbsp;&lt;/p&gt;
[quote user="philipm"]nrf_drv_gpiote_out_set(MI_EN);[/quote]
&lt;p&gt;&amp;nbsp;Could you try to call &amp;quot;nrf_drv_gpiote_set_task_trigger&amp;quot; instead?&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><item><title>RE: nRF52832 use PPI to control an output pin GPIOTE</title><link>https://devzone.nordicsemi.com/thread/232380?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 14:46:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1085cda2-eb6f-4db2-90cf-cec04583051c</guid><dc:creator>Philip</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes I set it high&amp;nbsp;along with reseting the timers 32 times a second (see second code section).&lt;/p&gt;
&lt;p&gt;//Set the output high&lt;br /&gt; nrf_drv_gpiote_out_set(MI_EN);&lt;/p&gt;
&lt;p&gt;If I do toggle the pin does toggle ok.&lt;/p&gt;
&lt;p&gt;Phil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 use PPI to control an output pin GPIOTE</title><link>https://devzone.nordicsemi.com/thread/232374?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 14:35:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67f1309c-5603-4206-995a-d03238cc487f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]The output is always off. If I set the task type to GPIOTE TASK_HIGH then the output is always on.[/quote]
&lt;p&gt;&amp;nbsp;If you configure the GPIOTE output to TASK_HIGH, then the transaction is from low-to-high on the event (configured via PPI):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Macro for configuring a pin to use the GPIO OUT TASK to change the state from low to high.
 * @details The task will set the pin. Therefore, the pin is cleared initially.  */
#define NRFX_GPIOTE_CONFIG_OUT_TASK_HIGH            \
    {                                               \
        .init_state = NRF_GPIOTE_INITIAL_VALUE_LOW, \
        .task_pin   = true,                         \
        .action     = NRF_GPIOTE_POLARITY_LOTOHI,   \
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And the other way around when you configure with TASK_LOW, ie event will set the pin low:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Macro for configuring a pin to use the GPIO OUT TASK to change the state from high to low.
 * @details The task will clear the pin. Therefore, the pin is set initially.  */
#define NRFX_GPIOTE_CONFIG_OUT_TASK_LOW              \
    {                                                \
        .init_state = NRF_GPIOTE_INITIAL_VALUE_HIGH, \
        .task_pin   = true,                          \
        .action     = NRF_GPIOTE_POLARITY_HITOLO,    \
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you&amp;nbsp;toggling the pin somewhere else in your program? If not, it will only occur once, and be kept in that state for the rest of the runtime.&lt;/p&gt;
&lt;p&gt;You could try to set &amp;quot;NRFX_GPIOTE_CONFIG_OUT_TASK_TOGGLE&amp;quot; to see if the pin itself toggles? just to see if the logic behind works as it should.&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>