<?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>Reading Fast Changing Input from Input Pin</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59457/reading-fast-changing-input-from-input-pin</link><description>Hi, I am using nrf52832 dev-kit. I use P0.23 or P0.24 as an input pin. I am trying use this pin to read data from other device. When I use this pin like button, it can detect high or low states. But when I connect it to other device for communication</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Mar 2020 15:05:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59457/reading-fast-changing-input-from-input-pin" /><item><title>RE: Reading Fast Changing Input from Input Pin</title><link>https://devzone.nordicsemi.com/thread/241910?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2020 15:05:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0809575-d406-4998-8bbd-ca272e1cb52e</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;No worries. Glad to hear that you found the root cause!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;H&amp;aring;kon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading Fast Changing Input from Input Pin</title><link>https://devzone.nordicsemi.com/thread/241909?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2020 15:04:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f9d0a2f-a5a9-4f54-9c0a-8ab212a9490f</guid><dc:creator>kb2423</dc:creator><description>&lt;p&gt;Sorry, it was my bad. Pin should be no pull up/down, I didnt know this. Before nrf I was working with stm32 it could handle the data when pin was pull down, so I thought it must be pull down. But I was wrong, thank you for answers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading Fast Changing Input from Input Pin</title><link>https://devzone.nordicsemi.com/thread/241795?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2020 11:43:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97c12530-3a70-4714-8621-ec498bd7049e</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;Isolate the problem and test the specific pin.&lt;/p&gt;
&lt;p&gt;Start with a very small example, like blinky, and just read the input, and if it changes, increment a variable / toggle a LED or something (change to the GPIOs in question):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**
 * Copyright (c) 2014 - 2019, Nordic Semiconductor ASA
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form, except as embedded into a Nordic
 *    Semiconductor ASA integrated circuit in a product or a software update for
 *    such product, must reproduce the above copyright notice, this list of
 *    conditions and the following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
 *    contributors may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * 4. This software, with or without modification, must only be used with a
 *    Nordic Semiconductor ASA integrated circuit.
 *
 * 5. Any software provided in binary form under this license must not be reverse
 *    engineered, decompiled, modified and/or disassembled.
 *
 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
/** @file
 *
 * @defgroup blinky_example_main main.c
 * @{
 * @ingroup blinky_example
 * @brief Blinky Example Application main file.
 *
 * This file contains the source code for a sample application to blink LEDs.
 *
 */

#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;

/**
 * @brief Function for application main entry.
 */
int main(void)
{
    /* Configure board. */
    bsp_board_init(BSP_INIT_LEDS);
    nrf_gpio_cfg_input(BUTTON_1, NRF_GPIO_PIN_PULLUP);
    /* Toggle LEDs. */
    while (true)
    {
        uint32_t pin_state = nrf_gpio_pin_read(BUTTON_1);
        /* Pin is active low */
        if (pin_state == 0) {
            static uint32_t active_count;
            active_count++;
            /* Visual aid */ 
            nrf_gpio_pin_toggle(LED_1);
        } else {
            /* Pin inactive - do nothing */
        }
    }
}

/**
 *@}
 **/
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Does this run? If yes, then there&amp;#39;s no hardware problem (soldering or otherwise). It does not work? Then check your connections.&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: Reading Fast Changing Input from Input Pin</title><link>https://devzone.nordicsemi.com/thread/241678?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2020 19:17:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe52aa12-cd6d-41ec-a9e0-9d2ebd1ec45e</guid><dc:creator>kb2423</dc:creator><description>&lt;p&gt;I dont have oscilloscope so I dont know how is signal. I listened other device with stm, and configure some of stm pins to copy those signals then I made connections between nrf and stm. When that device sends signal stm sends same signal to nrf, now I can read the data thanks to stm board. Whats the problem and how can I fix it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading Fast Changing Input from Input Pin</title><link>https://devzone.nordicsemi.com/thread/241594?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2020 12:24:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4897cf5e-d7a4-4884-8da5-223e8c279a9a</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;If that pin is solely used as an input, there should be no restrictions, and it should work as a normal input pin. Have you scoped the signal to see if there&amp;#39;s anything strange with the voltage or wave form going into the GPIO?&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: Reading Fast Changing Input from Input Pin</title><link>https://devzone.nordicsemi.com/thread/241585?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2020 11:56:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:628b0b32-fa70-477b-bdd1-899673c0502c</guid><dc:creator>kb2423</dc:creator><description>&lt;p&gt;That device doesnt use SPI or UART, they have their own communication protocol, a pin as a clock and a pin as a data.&lt;/p&gt;
&lt;p&gt;I am checking P0.23 and configured it with this nrf_gpio_cfg_input(23,NRF_GPIO_PIN_PULLDOWN); . As I said before I use same pin with same configuration as a button it gives me one and zeros. But it cant detect ones that coming from other device. That device&amp;#39;s period is 9 us for 1 bit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading Fast Changing Input from Input Pin</title><link>https://devzone.nordicsemi.com/thread/241509?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2020 07:52:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f45ebe1-2e92-473c-9993-e7650090a123</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>[quote user=""]But when I connect it to other device for communication it can not detect changes. [/quote]
&lt;p&gt;&amp;nbsp;Do you mean that you connect it as a GPIO input, then as a SPI MOSI pin for instance (or UART or any other peripheral)? If that is the case, the peripheral will claim the selected GPIO. You cannot use a GPIO as input in addition to a UART&amp;nbsp;TXD&amp;nbsp;simultaneously.&lt;/p&gt;
[quote user=""]My nrf52832 is always giving me 0. How can I fix that?[/quote]
&lt;p&gt;&amp;nbsp;Regardless of which GPIO you&amp;#39;re checking, you&amp;#39;re always getting 0? Have you configured the respective gpio as input? You can do that&amp;nbsp;by calling&amp;nbsp; nrf_gpio_cfg_input().&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>