<?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>How to use I2C on nRF52840 Dongle ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80474/how-to-use-i2c-on-nrf52840-dongle</link><description>Hi, I am not sure whether there is I2C pins on nRF52840 Dongle board as based on the Adafruit Feather nRF52840 Express the pin is P0.11 and P0.12 as shown below: SCL 0.11 and SCK 0.14 are at the back of the nRF52840 Dongle but SDA 0.12 is missing from</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Dec 2021 13:00:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80474/how-to-use-i2c-on-nrf52840-dongle" /><item><title>RE: How to use I2C on nRF52840 Dongle ?</title><link>https://devzone.nordicsemi.com/thread/341513?ContentTypeID=1</link><pubDate>Wed, 01 Dec 2021 13:00:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8228f977-9fac-4d55-b530-4bd2d175899c</guid><dc:creator>rickygai</dc:creator><description>&lt;p&gt;Hi Kazi,&lt;br /&gt;&lt;br /&gt;After some findings here and there, eventually I found the solution using Nordic nRF52840 Dongle under Arduino framework with PlatformIO or Arduino IDE &lt;a href="https://community.platformio.org/t/using-nordic-nrf52840-dongle-under-arduino-framework-with-platformio-vscode/24776"&gt;HERE&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I use to be a software guy for decades, recent years only back to do some hardware related stuffs.&lt;br /&gt;&lt;br /&gt;After reading the twi_sensor source code, honestly I am not so comfort and cannot venture into that kind of programming, it is too time consuming.&lt;br /&gt;&lt;br /&gt;With Arduino framework, I can easily programmed the Nordic nRF52840 Dongle without worrying about the I2C pins anymore, just like the simple MLX90614 I2C connection setup below:&lt;br /&gt;&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_20211201_5F00_205343.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Is very similar question, you want to write in Assembly or C/C++ programming language ? for sure, I am going to use C/C++ to accomplish my work because I am not building a rocket science project.&lt;br /&gt;&lt;br /&gt;Hopes this help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use I2C on nRF52840 Dongle ?</title><link>https://devzone.nordicsemi.com/thread/337867?ContentTypeID=1</link><pubDate>Mon, 08 Nov 2021 10:05:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bede4a6-d68e-4224-b2c8-bd22b9f0adfe</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Ricky,&lt;/p&gt;
&lt;p&gt;Good Luck with the further process. Feel free to ask us if you have more queries.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Kazi Afroza Sultana&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use I2C on nRF52840 Dongle ?</title><link>https://devzone.nordicsemi.com/thread/337398?ContentTypeID=1</link><pubDate>Thu, 04 Nov 2021 07:58:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:936a7903-9298-48aa-995f-5c6ec03018a8</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Nikolai,&lt;/p&gt;
&lt;p&gt;Yes, TWI example is a good source to know about pin selection. I mentioned this in my comment as well. You might have forgotten to send the YouTube link here what you recommended in your reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;
&lt;p&gt;Kazi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use I2C on nRF52840 Dongle ?</title><link>https://devzone.nordicsemi.com/thread/337373?ContentTypeID=1</link><pubDate>Thu, 04 Nov 2021 02:19:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:942d7a35-f35d-4013-b05c-24421c2192dc</guid><dc:creator>rickygai</dc:creator><description>&lt;p&gt;hi Kazi,&lt;br /&gt;&lt;br /&gt;Thank you for the valuable feedback, I definitely will look into it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Best Regards,&lt;br /&gt;Ricky Gai.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use I2C on nRF52840 Dongle ?</title><link>https://devzone.nordicsemi.com/thread/337237?ContentTypeID=1</link><pubDate>Wed, 03 Nov 2021 10:44:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfb6f837-7ac0-46bd-ad72-1ec1c538ab9e</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Ricky,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We do not have any examples with Arduino code.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I would like to refer you to use Nordic nRF5 SDK ( for downloading the nRF5 SDK follow this link:&amp;nbsp;&lt;a title="http://developer.nordicsemi.com/nrf5_sdk/nrf5_sdk_v17.x.x/" href="http://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v17.x.x/" rel="noopener noreferrer" target="_blank"&gt;http://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v17.x.x/&lt;/a&gt;)&amp;nbsp; and can look at the TWI example (&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Ftwi_sensor_example.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Ftwi_sensor_example.html&lt;/a&gt;) .&amp;nbsp;There are two twi examples which you should be able to use as reference, e.g. \twi_scanner and \twi_sensor, the pins used by twi is controlled by defines and can be changed where you see best fit:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;void twi_init (void)&lt;br /&gt;{&lt;br /&gt;ret_code_t err_code;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;const nrf_drv_twi_config_t twi_lm75b_config = {&lt;br /&gt;&lt;strong&gt;.scl = ARDUINO_SCL_PIN,&lt;br /&gt;.sda = ARDUINO_SDA_PIN,&lt;/strong&gt;&lt;br /&gt;.frequency = NRF_DRV_TWI_FREQ_100K,&lt;br /&gt;.interrupt_priority = APP_IRQ_PRIORITY_HIGH,&lt;br /&gt;.clear_bus_init = false&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;err_code = nrf_drv_twi_init(&amp;amp;m_twi, &amp;amp;twi_lm75b_config, twi_handler, NULL);&lt;/p&gt;
&lt;p&gt;APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;nrf_drv_twi_enable(&amp;amp;m_twi);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;Regarding pin selection:&lt;/strong&gt; One thing I would like to add (what I did not mention in my previous reply) regarding using of GPIO pin (any) as 12C. It is recommended not to select the pin close to the radio ( these are marked as low frequency I/O, you can see in the pinout documentation). &amp;nbsp;But if there is no plan to communicate simultaneously then it should not be a problem. you can find pin assignment here in this link&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fpin.html&amp;amp;cp=4_0_0_6_0"&gt;Nordic Semiconductor Infocenter&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pin-for-dongle52840.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You also look at this tutorial to start with nRF52840 dongle&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial"&gt;https://devzone.nordicsemi.com/guides/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial&lt;/a&gt;&amp;nbsp;.&amp;nbsp;It was written on 2018 and still relevant.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hope it helps.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best Regrads,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kazi Afroza Sultana&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use I2C on nRF52840 Dongle ?</title><link>https://devzone.nordicsemi.com/thread/337124?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2021 14:29:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21a603e8-1364-4bdb-849b-7073faa10c0c</guid><dc:creator>rickygai</dc:creator><description>&lt;p&gt;hi Kazi, &lt;br /&gt;&lt;br /&gt;I am new to Nordic product, merely testing at high level using Arduino framework programming.&lt;br /&gt;&lt;br /&gt;&amp;quot;&lt;span&gt;You just need to configure the peripheral to use the correct pins, typically via the driver configuration. &lt;/span&gt;&amp;quot;&lt;br /&gt;- Can you show me the tutorial videos how to do this in details and can it apply to Arduino IDE or PlatformIO IDE ?&lt;/p&gt;
&lt;p&gt;I came from a software developer background, and not intending to write bare metal code but merely using Arduino framework will do. &lt;br /&gt;&lt;br /&gt;Please advise.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use I2C on nRF52840 Dongle ?</title><link>https://devzone.nordicsemi.com/thread/337112?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2021 13:54:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5da0999-fc09-41d5-9b3d-22ba242ab90a</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Ricky,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The nRF52840 Dongle has 15 GPIOs in addition to the ground, power, and SWD connections along the castellated edges as we can see from the device picture (&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf52840_dongle%2FUG%2Fnrf52840_Dongle%2Fintro.html&amp;amp;cp=4_0_5"&gt;Nordic Semiconductor Infocenter&lt;/a&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1635857002930v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;There are&amp;nbsp;&lt;strong&gt;SWD interfaces&lt;/strong&gt; on the back side of the dongle, these are the connection points (P1 and J2 connector) for the SWD interface.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;There are no dedicated TWI pins in the nRF52840 devices. Any GPIO pin can be used for any function with any digital peripheral. You just need to configure the peripheral to use the correct pins, typically via the driver configuration. So, theoretically it is possible to use any pin as 12C. you can look at this link .&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Ftwi.html&amp;amp;cp=4_0_0_5_28"&gt;Nordic Semiconductor Infocenter&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have added schematic diagram of nRF52840 dongle, so you can compare it with the schematic diagram of Adafruit nRF52840 by yourself.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/PCA10059_5F00_Schematic_5F00_And_5F00_PCB.pdf"&gt;devzone.nordicsemi.com/.../PCA10059_5F00_Schematic_5F00_And_5F00_PCB.pdf&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Please let us know if you have more queries to ask.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Kazi Afroza Sultana&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use I2C on nRF52840 Dongle ?</title><link>https://devzone.nordicsemi.com/thread/333320?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 19:35:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5130201-3ed8-486e-a878-8d21b3faec1b</guid><dc:creator>NikTheNordicUser</dc:creator><description>&lt;p&gt;Are you using the twi library or peripheral&amp;hellip; if so the pins can be easily programmed to use almost any pins you wish. I recommend either showing us a code snippet as it will be easier to interpret or you can also look at this YouTube channel I found it very helpful during my implementations sumair&amp;rsquo;s embedded electronics&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use I2C on nRF52840 Dongle ?</title><link>https://devzone.nordicsemi.com/thread/333317?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 19:21:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d447d976-45c1-4c84-be0c-3aa90b283256</guid><dc:creator>SmallerPond</dc:creator><description>&lt;p&gt;I haven&amp;#39;t used Arduino (well, except some time ago on an Arduino board) so I can&amp;#39;t really help you there, but the nRF52840 lets you use just about any pins for just about any peripherals.&amp;nbsp; You just set them during the peripheral configuration and off you go.&amp;nbsp; Maybe whatever Arduino does to interface with the board allows you to put in a custom configuration?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>