<?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>USB Detection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41879/usb-detection</link><description>Hi, 
 I am working on the NRF51822 module with BLE-400 Board to develop the application. 
 And I need to detect the USB-Connection when it will be in the sleep mode, After detecting the USB it come back from the sleep mode to normal application working</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Dec 2018 10:05:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41879/usb-detection" /><item><title>RE: USB Detection</title><link>https://devzone.nordicsemi.com/thread/163047?ContentTypeID=1</link><pubDate>Thu, 27 Dec 2018 10:05:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7306edf2-587f-4f20-85b0-dbed25b39602</guid><dc:creator>sachin.singh</dc:creator><description>&lt;p&gt;Yes, My Board is connected with external battery.&lt;/p&gt;
&lt;p&gt;Yes, I have connected the &amp;quot;usb_sense&amp;quot; pin to detect the usb when connected and it is connected to the pin 3 of NRF51822.&lt;/p&gt;
&lt;p&gt;Here I need to use this pin to sense the usb detection when it was in the sleep mode. After sensing(when USB get connected) I need to WAKE IT UP from sleep and start to work as per connection.&lt;/p&gt;
&lt;p&gt;I am gone through so many functions to develop this, I have searched and tried through various function in &amp;quot;bsp.c&amp;quot; and &amp;quot;bsp_btn_ble.c&amp;quot; to get the function for the wake up from sleep mode just same as buttons provided in the development kits and samples codes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am confused between function that how to and which function or structures to be used for the same &amp;quot;USB_SENSING&amp;quot;.&lt;/p&gt;
&lt;p&gt;So can you provide simple button event code and configuration for led without using bsp.c and .h file.&lt;/p&gt;
&lt;p&gt;And I also look into app_button and gpiote file for this but I couldn&amp;#39;t figure out how to use this file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB Detection</title><link>https://devzone.nordicsemi.com/thread/163030?ContentTypeID=1</link><pubDate>Thu, 27 Dec 2018 08:04:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e351424-1161-4108-8cb4-063bf681dabf</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Does your board has a battery ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You would need to enable a GPIO pin as wake up interrupt pin. Then in your USB cable, if you have a VDD track you can connect that to the pin to detect if the USB cable has been connected. If you don&amp;#39;t you can pull the pin up and then connect it to the GND track to detect if the cable is connected.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>