<?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>External input &amp;amp; output on nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64990/external-input-output-on-nrf52840</link><description>Hello! I would like to use a predefined example from the nRF SDK and instead of the board&amp;#39;s button, to use an external stimulus (let&amp;#39;s say, an external button ). Similarly, instead of turning on the board&amp;#39;s LED, I want to set high a GPIO (let&amp;#39;s say, external</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Aug 2020 13:01:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64990/external-input-output-on-nrf52840" /><item><title>RE: External input &amp; output on nRF52840</title><link>https://devzone.nordicsemi.com/thread/266752?ContentTypeID=1</link><pubDate>Thu, 27 Aug 2020 13:01:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f7d1949-c3c2-4304-a38d-74a0fe0e2435</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Alexa,&lt;/p&gt;
[quote user="alexa"]When I change the LEDS_ACTIVE_STATE to 1, the other LEDs remain on for the whole time, without me specifying that. (i.e I don&amp;#39;t modify the rest of the code)[/quote]
&lt;p&gt;How did you add your external LED in the pca10056.h? Could you insert the related part in the&amp;nbsp;&lt;span&gt;pca10056.h?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="alexa"]but I cannot find them. Could you please tell me in which .c or .h file should I look for them?[/quote]
&lt;p&gt;&amp;nbsp;You can take a look at the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/bsp_example.html"&gt;BSP Example&lt;/a&gt;&amp;nbsp;on how to control the LED.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="alexa"]Could you plase tell me in which source files should I look for the mentioned functions?[/quote]
&lt;p&gt;I think you are looking at the nRF5_SDK\examples\ble_peripheral\ble_app_blinky, but I mean&amp;nbsp;nRF5_SDK\examples\peripheral\blinky.&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External input &amp; output on nRF52840</title><link>https://devzone.nordicsemi.com/thread/266713?ContentTypeID=1</link><pubDate>Thu, 27 Aug 2020 11:28:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47648de5-15a7-4b67-b390-ef6e513cf227</guid><dc:creator>alexa</dc:creator><description>&lt;p&gt;Hi &lt;span class="user-name"&gt;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/amanda"&gt;Amanda Hsieh&lt;/a&gt;&lt;/span&gt;! I am trying the idea which you suggested me the previous week, but I cannot achieve turning on one LED when supplying &amp;#39;1&amp;#39; (5V). When I change the LEDS_ACTIVE_STATE to 1, the other LEDs remain on for the whole time, without me specifying that. (i.e I don&amp;#39;t modify the rest of the code)&lt;/p&gt;
&lt;p&gt;In order to debug this, I though of trying to understand these functions, like you suggested:&lt;/p&gt;
[quote userid="77782" url="~/f/nordic-q-a/64990/external-input-output-on-nrf52840/265674"] functions like&amp;nbsp;&lt;span&gt;buttons_handler and leds_buttons_init() &lt;/span&gt;[/quote]
&lt;p&gt;- but I cannot find them. Could you please tell me in which .c or .h file should I look for them? I also couldn&amp;#39;t find this: &lt;/p&gt;
[quote userid="77782" url="~/f/nordic-q-a/64990/external-input-output-on-nrf52840/265674"]commenting out&amp;nbsp;Toggle LEDs while loop part[/quote]
&lt;p&gt;- it should&amp;nbsp; probably be in main, but I only see one LED toggling, not more: &lt;/p&gt;
&lt;p&gt;#define LEDBUTTON_LED&amp;nbsp; BSP_BOARD_LED_2 /**&amp;lt; LED to be toggled with the help of the LED Button Service. */&lt;/p&gt;
&lt;p&gt;Could you plase tell me in which source files should I look for the mentioned functions? Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External input &amp; output on nRF52840</title><link>https://devzone.nordicsemi.com/thread/266383?ContentTypeID=1</link><pubDate>Wed, 26 Aug 2020 08:15:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adff787c-81be-41be-90a0-ca249e3b6436</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;See this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/171/get-port-state-from-output-port/947#947"&gt;answer&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External input &amp; output on nRF52840</title><link>https://devzone.nordicsemi.com/thread/266297?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2020 15:02:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6cd8ad7b-7bed-4b04-a1c7-80276b8f0b7a</guid><dc:creator>alexa</dc:creator><description>&lt;p&gt;Hi Amanda. Thanks for your reply, it&amp;#39;s helping me.&lt;/p&gt;
[quote userid="77782" url="~/f/nordic-q-a/64990/external-input-output-on-nrf52840/265674"]OUT register[/quote]
&lt;p&gt;- how can I access this OUT register on the laptop, specifically? Is it related to the debugging option? Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External input &amp; output on nRF52840</title><link>https://devzone.nordicsemi.com/thread/265674?ContentTypeID=1</link><pubDate>Fri, 21 Aug 2020 07:42:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75123467-d1f5-4bc1-af6b-56b01e660076</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Alexa,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="alexa"]Do you have an idea where I should start to investigate and change the code accordingly? So that, only my desired GPIO or LED turns on at HIGH.[/quote]
&lt;p&gt;You could check the functions like&amp;nbsp;&lt;span&gt;buttons_handler and leds_buttons_init() if they are there.&amp;nbsp;&amp;nbsp;&lt;/span&gt;You can test with&amp;nbsp;the&amp;nbsp;&lt;a title="Blinky Example" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/gpio_example.html?cp=7_1_4_6_0"&gt;Blinky Example&lt;/a&gt; by commenting out&amp;nbsp;Toggle LEDs while loop part.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="alexa"](2) I will do a communication with another board using that GPIO, so I&amp;#39;d like to see &lt;strong&gt;what bits&lt;/strong&gt; are &lt;strong&gt;changed&lt;/strong&gt; and where. So, how could I know &lt;strong&gt;what registers get modified,&lt;/strong&gt; when I set high the value of a specific digital output? (in order for me to actually use that bit change for my communication, further in my project).[/quote]
&lt;p&gt;&amp;nbsp;Not sure I understand what you are trying to do. You&amp;nbsp;can read the OUT register to check if the pin is high or low.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External input &amp; output on nRF52840</title><link>https://devzone.nordicsemi.com/thread/265567?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2020 13:20:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11c6f176-3f67-46fa-a618-c91788469f35</guid><dc:creator>alexa</dc:creator><description>&lt;p&gt;Ok, Ms. &lt;span class="user-name"&gt;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/amanda"&gt;Amanda Hsieh &lt;/a&gt; &lt;/span&gt; , thank you for clarifying everything to me. &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;
[quote userid="77782" url="~/f/nordic-q-a/64990/external-input-output-on-nrf52840/265559"]A8 is&amp;nbsp;&lt;span&gt;P0.31 which&amp;nbsp;means that it can either function as a normal GPIO or as an analog pin.&lt;/span&gt;[/quote]
&lt;p&gt;- regarding this I have two questions:&lt;/p&gt;
&lt;p&gt;(1) I did the modifications in the pca header and I noticed that the LEDs are active on low, therefore I changed LEDS_ACTIVE_STATE to 1, to make them turn on only on supply. But now, some LEDs remain turned on, some are off (even if I only set 1 LED on). I am not sure what their behaviour depends on. Do you have an idea where I should start to investigate and change the code accordingly? So that, only my desired GPIO or LED turns on at HIGH.&lt;/p&gt;
&lt;p&gt;(2) I will do a communication with another board using that GPIO, so I&amp;#39;d like to see &lt;strong&gt;what bits&lt;/strong&gt; are &lt;strong&gt;changed&lt;/strong&gt; and where. So, how could I know &lt;strong&gt;what registers get modified,&lt;/strong&gt; when I set high the value of a specific digital output? (in order for me to actually use that bit change for my communication, further in my project).&lt;/p&gt;
&lt;p&gt;Thank you in advance &amp;amp; best regards!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External input &amp; output on nRF52840</title><link>https://devzone.nordicsemi.com/thread/265559?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2020 12:44:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c158c2c6-e230-4a59-b152-77b9d023cb6f</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]1. Is this the only place where I need to do the modifications? It seems like only a mapping problem to me, but I think I might to re-write other files as well.[/quote]
&lt;p&gt;&amp;nbsp;Right. You need to modify the&amp;nbsp;&lt;span&gt;board header file (nRF5_SDK\components\boards\pca10056.h) to initialize the pin. It is related to how&amp;nbsp;leds_buttons_init() in main.c initializes the buttons. Also, add to buttons_handler and leds_buttons_init() function in main.c:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]2. What do the &lt;strong&gt;&lt;em&gt; (&lt;span style="color:#333399;"&gt;xx&lt;/span&gt;)&lt;/em&gt;&lt;/strong&gt; need to be? (I read about this mapping in &lt;a href="https://infocenter.nordicsemi.com/pdf/nRF52840_PS_v1.0.pdf"&gt;nRF52840&amp;#39;s specs&lt;/a&gt;, @pag. 525, but I am not sure how to interpret that table into actual code). For instance, let&amp;#39;s say that I&amp;#39;d like my A8 pin as a digital output (i.e. drive an external LED). Then, do I need to&amp;nbsp;&lt;strong&gt;&lt;em&gt;#define LED_1 &lt;code&gt;NRF_GPIO_PIN_MAP&lt;/code&gt; (0, &lt;span style="color:#333399;"&gt;32&lt;/span&gt;)&lt;/em&gt;&lt;/strong&gt;? Or is A8 used already as AIN7, which is actually an analog input (see second line)?&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;A8 is&amp;nbsp;&lt;span&gt;P0.31 which&amp;nbsp;means that it can either function as a normal GPIO or as an analog pin.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>