<?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>Can the nRF52840 MCU power LED direct?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44533/can-the-nrf52840-mcu-power-led-direct</link><description>I&amp;#39;m planning to connect The nRF52840 MCU GPIO in series to a 1.8V 20mA LED and a Resistor then to ground. 
 Would the current from the MCU be sufficient to power the LED ? 
 Thank you</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 25 Apr 2019 09:14:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44533/can-the-nrf52840-mcu-power-led-direct" /><item><title>RE: Can the nRF52840 MCU power LED direct?</title><link>https://devzone.nordicsemi.com/thread/183707?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2019 09:14:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52901d69-b40c-4cb3-862d-f9d2fd18f7e2</guid><dc:creator>awneil</dc:creator><description>[quote userid="76921" url="~/f/nordic-q-a/44533/can-the-nrf52840-mcu-power-led-direct/183619"]Both GPIO codes don&amp;#39;t work[/quote]
&lt;p&gt;As with debugging &lt;em&gt;&lt;strong&gt;any&lt;/strong&gt;&lt;/em&gt; problem, you need to take this one step at a time.&lt;/p&gt;
&lt;p&gt;For a start, have you tried using&amp;nbsp;an unmodified SDK example on a DevKit? That is always the best place to start - giving you a known-good basis to work from.&lt;/p&gt;
&lt;p&gt;In your circuit:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If you disconnect the LED cathode from the port pin, and ground it - does the LED light.&lt;/li&gt;
&lt;li&gt;With the LED disconnected, can you see the pin level changing; eg, on a scope or meter?&lt;/li&gt;
&lt;li&gt;Run you code in the debugger - is it actually reaching the point(s) that configure the pins, &amp;amp; change the output?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.avrfreaks.net/comment/2418156#comment-2418156" rel="noopener noreferrer" target="_blank"&gt;How To Debug&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can the nRF52840 MCU power LED direct?</title><link>https://devzone.nordicsemi.com/thread/183702?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2019 09:04:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:706febb5-2762-4791-8ba0-373d4e49e17d</guid><dc:creator>awneil</dc:creator><description>[quote userid="65515" url="~/f/nordic-q-a/44533/can-the-nrf52840-mcu-power-led-direct/183620"]P1.x pins do not have high drive capability (&lt;em&gt;NRF_GPIO_PIN_H0D1&lt;/em&gt;), nor do some P0.x pins[/quote]
&lt;p&gt;It was just a quick look, but I couldn&amp;#39;t see that mentioned in the Product Specification ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can the nRF52840 MCU power LED direct?</title><link>https://devzone.nordicsemi.com/thread/183676?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2019 08:09:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbcec951-15ea-4101-9077-13ca118dd4b7</guid><dc:creator>ctchong</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using P0.11 P0.12 P1.06 P1.07&amp;nbsp;&lt;/p&gt;
&lt;p&gt;All P1.x have no high drive capability?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can the nRF52840 MCU power LED direct?</title><link>https://devzone.nordicsemi.com/thread/183620?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2019 04:39:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a77b67aa-ed5e-4b62-8dfc-334c94d889fb</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Which pins are you using for &lt;em&gt;led_pin&lt;/em&gt; and &lt;em&gt;LED_1&lt;/em&gt;? P1.x pins do not have high drive capability (&lt;em&gt;NRF_GPIO_PIN_H0D1&lt;/em&gt;), nor do some P0.x pins; this is sometimes overlooked .. Also be aware that if 3.3V is very much higher than your nRF52840 i/o voltage there may be issues with back-drive (phantom power) into the port pin.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can the nRF52840 MCU power LED direct?</title><link>https://devzone.nordicsemi.com/thread/183619?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2019 03:39:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f0cd44b-c50d-43eb-8d05-5a75892b70cc</guid><dc:creator>ctchong</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;nrf_gpio_cfg_output(led_pin);
nrf_gpio_cfg(LED_1,NRF_GPIO_PIN_DIR_OUTPUT,
                NRF_GPIO_PIN_INPUT_DISCONNECT,
                NRF_GPIO_PIN_NOPULL,
                NRF_GPIO_PIN_H0D1,      
                NRF_GPIO_PIN_NOSENSE);
                
nrf_gpio_pin_write(led_pin, 0);
nrf_gpio_pin_write(LED_1,0);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/960x720/__key/communityserver-discussions-components-files/4/pastedimage1556163486556v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I am connecting the LED like Figure 1: +V is 3.3V and PORT Pin is configured as LED_1 and led_pin. I have 2 LEDs configured as the same connection.&lt;/p&gt;
&lt;p&gt;Both GPIO codes don&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;Thank you&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Chong&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can the nRF52840 MCU power LED direct?</title><link>https://devzone.nordicsemi.com/thread/183564?ContentTypeID=1</link><pubDate>Wed, 24 Apr 2019 15:05:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dc77683-1376-488f-bd24-edbd7538c7ed</guid><dc:creator>awneil</dc:creator><description>[quote userid="76921" url="~/f/nordic-q-a/44533/can-the-nrf52840-mcu-power-led-direct/183527"]How do you configure a GPIO to current sink?&amp;nbsp;[/quote]
&lt;p&gt;It&amp;#39;s not about the GPIO configuration - it&amp;#39;s how you connect the LED.&lt;/p&gt;
&lt;p&gt;How to properly post source code:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/4162._5F00_Insert-Code-_2D00_-Nordic.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can the nRF52840 MCU power LED direct?</title><link>https://devzone.nordicsemi.com/thread/183527?ContentTypeID=1</link><pubDate>Wed, 24 Apr 2019 14:02:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35371933-f556-493a-95a5-e9d8b48c5783</guid><dc:creator>ctchong</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How do you configure a GPIO to current sink?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tried the following but it doesn&amp;#39;t seem to work.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;nrf_gpio_cfg(LED_1,NRF_GPIO_PIN_DIR_OUTPUT,&lt;br /&gt; NRF_GPIO_PIN_INPUT_DISCONNECT,&lt;br /&gt; NRF_GPIO_PIN_NOPULL,&lt;br /&gt; NRF_GPIO_PIN_H0H1, &lt;br /&gt; NRF_GPIO_PIN_NOSENSE);&lt;/p&gt;
&lt;p&gt;nrf_gpio_pin_write(LED_1,0);&lt;/p&gt;
&lt;p&gt;Thank you&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Chong&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can the nRF52840 MCU power LED direct?</title><link>https://devzone.nordicsemi.com/thread/174984?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2019 10:23:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f090fb7b-1d7f-4d8c-96b6-b3b9a1979fe5</guid><dc:creator>ctchong</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/328D308E_2D00_7D63_2D00_4AD4_2D00_AB86_2D00_508F8A0E3172.jpeg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have changed it to current sink. The mcu_photo_pos1 is connected to a gpio (adc) to read the voltage of the photo sensor.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Chong&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can the nRF52840 MCU power LED direct?</title><link>https://devzone.nordicsemi.com/thread/174960?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2019 08:48:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c18a23d-83b0-4ee6-bb2e-52d6d9dd1d9e</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;That seems to have been copied from some other schematic?&lt;/p&gt;
&lt;p&gt;So start by understanding how that other circuit works.&lt;/p&gt;
&lt;p&gt;Electrically, the nRF GPIOs aren&amp;#39;t much different from GPIOs on other microcontrollers - compare the nRF specification against the other microcontroller&amp;#39;s &lt;strong&gt;documentation&lt;/strong&gt; ...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT&lt;/p&gt;
&lt;p&gt;Note that I only said sinking is &amp;quot;&lt;em&gt;generally better&lt;/em&gt;&amp;quot; - I didn&amp;#39;t say that sourcing is impossible!&lt;/p&gt;
&lt;p&gt;Your circuits don&amp;#39;t seem to make much sense - how do &lt;em&gt;&lt;strong&gt;you&lt;/strong&gt; think&lt;/em&gt; they are supposed to work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can the nRF52840 MCU power LED direct?</title><link>https://devzone.nordicsemi.com/thread/174921?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2019 03:28:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa740677-5fbd-48e9-8bfb-bfea2834475d</guid><dc:creator>ctchong</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/960x720/__key/communityserver-discussions-components-files/4/90F89009_2D00_1C95_2D00_4D1F_2D00_B65D_2D00_AD209A713A0D.jpeg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I have 2 photo sensors. How do I do a current sinking circuit for this ? Thank you&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can the nRF52840 MCU power LED direct?</title><link>https://devzone.nordicsemi.com/thread/174768?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 10:15:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac224937-0236-42c6-8d56-2d84d01a1f67</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;The Product Specification tells you the current capabilities of the GPIO pins.&lt;/p&gt;
&lt;p&gt;Take a look at the Dev Kit schematics for examples.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s generally better to have a microcontroller GPIO switching to ground (ie, &amp;quot;sinking&amp;quot; the LED current)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://startingelectronics.org/articles/current-sourcing-sinking/"&gt;https://startingelectronics.org/articles/current-sourcing-sinking/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1551953702628v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>