<?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 SPI for nRF52840 DK and nRF Connect SDK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87801/how-to-use-spi-for-nrf52840-dk-and-nrf-connect-sdk</link><description>Hi, I&amp;#39;m Leo. 
 These days I&amp;#39;m learning BLE. 
 
 First, I&amp;#39;m using nRF Connect SDK(NCS) v1.9.1, S140, nRF52840 DK board. 
 
 I need to use SPI to control UWB transceiver(DWM3000) . As far as I searched, there&amp;#39;s no example of what I need. 
 I want to use</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 13 May 2022 02:56:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87801/how-to-use-spi-for-nrf52840-dk-and-nrf-connect-sdk" /><item><title>RE: How to use SPI for nRF52840 DK and nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/367738?ContentTypeID=1</link><pubDate>Fri, 13 May 2022 02:56:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f2a5509-9ba4-4146-96e9-ad75022f5c35</guid><dc:creator>Youncheol Jung</dc:creator><description>&lt;p&gt;I&amp;#39;m really thankful for your answer.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please understand if I use awkward words. I&amp;#39;m new and bad at an embedded field. And also writing questions and comments on the public sites is also new. So I don&amp;#39;t know what is appropriate words or expressions and approaches.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes, you&amp;#39;re right. &lt;strong&gt;My UWB transceiver is SPI-slave,&lt;/strong&gt; so I need to use nRF52840 DK board as a SPI-master.&lt;/p&gt;
&lt;p&gt;I saw there are some settings like spi, spi-s, spi-m. And spi-m was more recent setting, right?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know how to write a driver and actually it is quite confusing what is the driver. So I&amp;#39;ll explain by myself, please check it is right.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Drivers are particular software codes for controlling the hardware(devices like a board, sensor, actuator...). Then how to make it? I also heard about kernel for communication between hardware and software. What&amp;#39;s the difference?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Porting is setting the port(pin on the board) as I want to use like GPIO, SPI, I2C, UART... right? So I have to tune or coordinate for the standard like a protocol.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know how much I need to modify to use SPI on Zephyr. I think that&amp;#39;s a point. I learned a little about CMake, Ninja, DeviceTree, and all that jazz for Zephyr RTOS. &lt;strong&gt;But I&amp;#39;m not aware of what has an important role to fit in my situation. &lt;/strong&gt;Too many things to learn... omg&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Oh, I also want to use BLE at the same time I&amp;#39;m using UWB (and UART, SPI, and so on...) Is it possible?? I don&amp;#39;t know it can work together in the same code, I mean in one (main) code.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;There are many libraries and APIs such as DK_buttons and LED, UART, Zephyr, Bluetooth, GAP... I think it could be possible to mix but I don&amp;#39;t know how to unify and what is the dependency on each other.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Again, thanks a lot for your kind answer. Tell me if I&amp;#39;m wrong and what is the missing point.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use SPI for nRF52840 DK and nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/367560?ContentTypeID=1</link><pubDate>Thu, 12 May 2022 09:24:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7382a18-7f25-42a0-9e7f-f346c6d1b66f</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you try being a little more clear about what it is you are trying to achieve?&lt;/p&gt;
[quote user=""]0. Can I use NCS for SPI? Or must I use nRF5 SDK?[/quote]
&lt;p&gt;Yes, NCS is a complete SDK, and supports pretty much every major feature that the nRF5 SDK supports.&lt;/p&gt;
[quote user=""]1. If it is okay to use NCS for SPI, then do I have to set Zephyr for NCS?[/quote]
&lt;p&gt;I am not entirely sure what you mean when you say &amp;quot;set Zephyr for NCS&amp;quot;. Zephyr is the core part of NCS, and you can not use NCS without Zephyr.&lt;/p&gt;
[quote user=""]2. Then, how to configure?[/quote]
&lt;p&gt;Using an overlay file is the recommended method. &lt;br /&gt;The numbers for the pins use this system: 0 means P0.00, 31 means P0.31, 32 means P1.00, and 47 means P1.15.&lt;/p&gt;
[quote user=""]How to use SPI in order to activate UWB transceiver?[/quote]
&lt;p&gt;I assume the transceiver is an SPI slave? And you want the nrf52840 to be the SPI master?&lt;/p&gt;
&lt;p&gt;The best approach would probably be to write a driver for the device, based on existing drivers for similar devices.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>