<?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>Set Pin to high</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69230/set-pin-to-high</link><description>Hello, 
 I want to set a GPIO Pin to high. Therefore I wrote the code below. 
 But when the software is written onto the nrf52811, I can not messure any voltage. 
 I do not want to use any library or external file for this. 
 //start of code 
 int main</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Dec 2020 14:13:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69230/set-pin-to-high" /><item><title>RE: Set Pin to high</title><link>https://devzone.nordicsemi.com/thread/285661?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2020 14:13:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44baaddf-9046-46d2-8946-8bc830a84e05</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Tobias&lt;/p&gt;
&lt;p&gt;That is great news &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;
&lt;p&gt;For licensing reasons we are not allowed to distribute the micro_ecc library, so if you want to build an example that requires it you have to install this library separately, as described &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_crypto_backend_micro_ecc.html?cp=7_1_3_11_16_2"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set Pin to high</title><link>https://devzone.nordicsemi.com/thread/285469?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 22:56:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:007c6c16-f219-473d-af08-b67c09991a2c</guid><dc:creator>Tobias_123</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I could successfully set Pin 3 to HIGH. Thank you very much.&lt;br /&gt;&lt;br /&gt;I used a pca100&lt;span&gt;56&lt;/span&gt;e project, not ble_app_eddystone due to this error: &amp;quot;cannot find ../../../../../../external/micro-ecc/nrf52nf_armgcc/armgcc/micro_ecc_lib_nrf52.a: No such file or directory&amp;quot;. But another&amp;nbsp;&lt;span&gt;100&lt;/span&gt;&lt;span&gt;56&lt;/span&gt;&lt;span&gt;e project&lt;/span&gt; file, without errors, worked fine.&lt;br /&gt;&lt;br /&gt;Best regards&lt;br /&gt;Tobias&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set Pin to high</title><link>https://devzone.nordicsemi.com/thread/284994?ContentTypeID=1</link><pubDate>Tue, 15 Dec 2020 10:10:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1175fac-9112-4132-97ae-9b1ab3776da7</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Tobias&lt;/p&gt;
&lt;p&gt;To target the nRF52811 you should use the pca10056e project, not the pca10040e.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Most likely the reason the hex file is different is that the hex file stored in the project contains both the SoftDevice and the application, while the hex file you build only contains the application. If you program the project directly in Segger Embedded Studio this doesn&amp;#39;t matter, since the SoftDevice will be flashed automatically in addition to the application hex.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, the ble_app_uart example uses the UART, which might be a problem on your board since it doesn&amp;#39;t have anything connected to those pins.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try the ble_app_eddystone example instead,&amp;nbsp;and use the nRF Connect app for Android/iOS to see if you can see the advertising packets?&lt;/p&gt;
&lt;p&gt;Remember to use the pca10056e project, and try to program through the Segger interface.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set Pin to high</title><link>https://devzone.nordicsemi.com/thread/284762?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2020 12:09:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4011263e-86dc-48a6-9a3b-7b1a90b60869</guid><dc:creator>Tobias_123</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I may found the problem:&lt;br /&gt;The &amp;quot;ble_app_uart_pca10040e_s112.hex&amp;quot; file, that comes with the SDK and works fine, is unequal to the file, which I get when I click on build in Segger Embedded Studio (wihtout changing code).&lt;/p&gt;
&lt;p&gt;Debugging from Segger Embedded Studio did also not work.&lt;br /&gt;&lt;br /&gt;Best regards&lt;br /&gt;Tobias&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set Pin to high</title><link>https://devzone.nordicsemi.com/thread/284707?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2020 09:02:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63cef74f-cb02-443a-89e4-9f2de550b195</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Tobias&lt;/p&gt;
&lt;p&gt;Thanks for sharing the details on your board.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your earlier code is trying to manipulate P0.00, but according to the&amp;nbsp;&lt;span&gt;ISP1907-LL documentation P0.00 is connected to the LF crystal, and can not be used as GPIO.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Only a subset of the available GPIO&amp;#39;s on the part are brought out on the module, including P0.03, P0.04 and P0.05.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Are you able to try one of these pins instead and see if it works?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;A quick trick to manipulate&amp;nbsp;P0.03 for instance is to write to the registers as such:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;// Setting&amp;nbsp;P0.03 to output&lt;br /&gt;*((volatile int *)0x50000514) = (1 &amp;lt;&amp;lt; 3);&lt;br /&gt;// Setting&amp;nbsp;P0.03 high&lt;br /&gt;*((volatile int *)0x50000504) = (1 &amp;lt;&amp;lt; 3);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;br /&gt;Torbjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set Pin to high</title><link>https://devzone.nordicsemi.com/thread/284602?ContentTypeID=1</link><pubDate>Fri, 11 Dec 2020 16:11:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5c42a1d-9e14-4497-9838-ebf91cb04494</guid><dc:creator>Tobias_123</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am programming the ISP1907-LL with the Evalutation Board.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I may found the problem:&lt;br /&gt;The &amp;quot;ble_app_uart_pca10040e_s112.hex&amp;quot; file, that comes with the SDK and works fine, is unequal to the file, which I get when I click on build in Segger Embedded Studio (wihtout changing code).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Debugging from Segger Embedded Studio did also not work.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Tobias&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set Pin to high</title><link>https://devzone.nordicsemi.com/thread/284300?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 11:21:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8c67a86-dcb2-4d91-8caf-9078b2eb1397</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Tobias&lt;/p&gt;
&lt;p&gt;What kind of hardware are you trying to program?&lt;/p&gt;
&lt;p&gt;Is it a standard development kit, or a custom board?&lt;/p&gt;
&lt;p&gt;Also, have you tried to flash the example directly from the SES interface, instead of using nRF Connect?&lt;/p&gt;
&lt;p&gt;The pca10040 project is designed for the nRF52832 device, not the nRF52811, so if you are targetting the nRF52811 this might be the problem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set Pin to high</title><link>https://devzone.nordicsemi.com/thread/284188?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2020 19:25:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af0bde8b-1301-4865-96e6-f9904215b07a</guid><dc:creator>Tobias_123</dc:creator><description>&lt;p&gt;Hi&lt;br /&gt;&lt;br /&gt;I tested this code:&lt;/p&gt;
&lt;p&gt;//start of code&lt;/p&gt;
&lt;p&gt;int main() //first line&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;// Setting the NRF_P0-&amp;gt;DIR register to 1&lt;br /&gt;*((volatile int *)0x50000514) = 1;&lt;br /&gt;// Setting the NRF_P0-&amp;gt;OUT register to 1&lt;br /&gt;*((volatile int *)0x50000504) = 1;&lt;/p&gt;
&lt;p&gt;while(1)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;} //last line&lt;/p&gt;
&lt;p&gt;//end of code&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But it does not work. So I wonder if I am doing something wrong at building.&lt;/p&gt;
&lt;p&gt;So I have copied the example receiver from the SDK:&amp;nbsp;examples\peripheral\radio\receiver&lt;/p&gt;
&lt;p&gt;The I opened the file&amp;nbsp;receiver_pca10040.emProject with Segger Embedded Studio&lt;/p&gt;
&lt;p&gt;In this file I changed the main.c file to the code above.&lt;/p&gt;
&lt;p&gt;Then I clicked on Build -&amp;gt; build _pca10040&lt;/p&gt;
&lt;p&gt;Afterwards I upload the&amp;nbsp;receiver_pca10040.hex file, I&amp;nbsp;got in&amp;nbsp;receiver\pca10040\blank\ses\Output\Release\Exe,&amp;nbsp;which has the current date.&lt;/p&gt;
&lt;p&gt;For uploading I use nRF Connect v3.6.1&lt;/p&gt;
&lt;p&gt;Is their something wrong in my Method?&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Tobias&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set Pin to high</title><link>https://devzone.nordicsemi.com/thread/284019?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2020 11:14:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:340ee6e7-06a8-40a1-8380-207abf026bbf</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As a colleague of mine pointed out, in order to write to memory mapped registers it is important to define the variables as volatile. Otherwise the compiler could end up optimizing out your writes (or writing them to registers only), since the values you write don&amp;#39;t get used anywhere else in the code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The quickest way to &amp;#39;manually&amp;#39; write directly to a memory mapped peripheral register is follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// Setting the NRF_P0-&amp;gt;DIR register to 1
*((volatile int *)0x50000514) = 1;
// Setting the NRF_P0-&amp;gt;OUT register to 1
*((volatile int *)0x50000504) = 1;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set Pin to high</title><link>https://devzone.nordicsemi.com/thread/283913?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2020 19:19:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2fdca4d-953b-4bc6-b28e-9241024ce9c4</guid><dc:creator>Tobias_123</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thank you for your reply. I basically want to understand how these registers work, how they are programmed. I want to do some general tests - get into this stuff.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you proposed, I have changed the code. But it still does not work.&lt;/p&gt;
&lt;p&gt;Also I wonder if I am even able to run the chip only with this main.c file. Do you know if there has to be some files, that must be written to chip to operate anything on it?&lt;/p&gt;
&lt;p&gt;The extended code:&lt;/p&gt;
&lt;p&gt;//start of code&lt;/p&gt;
&lt;p&gt;int main()&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt; unsigned int base = 0x50000000; //base adress of GPIO&lt;br /&gt; unsigned int outOffset = 0x504; //offset of out&lt;br /&gt; unsigned int dirOffset = 0x514; //offset of dir&lt;/p&gt;
&lt;p&gt;unsigned int dirAdress = base + dirOffset;// adress of DIR Register&lt;br /&gt; unsigned int outAdress = base + outOffset;// adress of OUT Register&lt;br /&gt; &lt;br /&gt; unsigned int write = 1;&lt;/p&gt;
&lt;p&gt;unsigned int *dir = dirAdress; //Pointer on dirAdress&lt;br /&gt; unsigned int *out = outAdress; //Pointer on outAdress&lt;/p&gt;
&lt;p&gt;*dir = write; //set outAdress to 0000 0000 0000 0000 0000 0000 0000 0001&lt;br /&gt; *out = write; //set outAdress to 0000 0000 0000 0000 0000 0000 0000 0001&lt;br /&gt; &lt;br /&gt; while(1)&lt;br /&gt; {&lt;br /&gt; &lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;//end of code&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set Pin to high</title><link>https://devzone.nordicsemi.com/thread/283899?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2020 16:52:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:249cffaf-cd50-401c-9a95-bb5028289122</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]I do not want to use any library or external file for this.[/quote]
&lt;p&gt;May I ask what you are trying to do with the device?&lt;/p&gt;
&lt;p&gt;Unless all you need to do is toggle some pins then not using any external files&amp;nbsp;will&amp;nbsp;make things quite complicated ;)&lt;/p&gt;
&lt;p&gt;As for your code, by default all pins are set as inputs, and you need to write to the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52811/gpio.html?cp=4_4_0_5_7_1_4#register.DIR"&gt;DIR register&lt;/a&gt; to enable a pin as an output. Can you try this and see if it works better?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>