<?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>nRF52832 SPI tx rx</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83147/nrf52832-spi-tx-rx</link><description>Hi 
 I&amp;#39;m developing nRF52832. 
 I have a question about SPI communication.(\nRF5_SDK_17.0.0\examples\peripheral\spi I don&amp;#39;t understand, so I ask questions.) 
 I want to read sensor data through SPI communication, but I don&amp;#39;t know how to separate Tx and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Dec 2021 08:20:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83147/nrf52832-spi-tx-rx" /><item><title>RE: nRF52832 SPI tx rx</title><link>https://devzone.nordicsemi.com/thread/345322?ContentTypeID=1</link><pubDate>Wed, 29 Dec 2021 08:20:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef988158-5fc2-4f39-8265-87c5be654097</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The example is made to showcase the use of SPI.&lt;/p&gt;
&lt;p&gt;The example is configured to use the our DKs. This is mainly from the pin configurations.&lt;/p&gt;
&lt;p&gt;Our DKs have normal nRF microcontrollers on them.&lt;/p&gt;
&lt;p&gt;Therefore, if you change the pin configurations in the example, it should work with any nRF chip.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To know if the SPI code is working for your custom board, use an oscilloscope or logic analyzer to measure the MOSI line to see if the nRF52832 is sending on SPI.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI tx rx</title><link>https://devzone.nordicsemi.com/thread/345320?ContentTypeID=1</link><pubDate>Wed, 29 Dec 2021 08:07:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c54e44c-0109-4947-bd16-47a732e83811</guid><dc:creator>Minseo</dc:creator><description>&lt;p&gt;Hi. Thank you for replying.&lt;/p&gt;
&lt;p&gt;I meant to ask if it is possible to receive Rx only by using nRFDK to use the&lt;/p&gt;
&lt;p&gt;&amp;lt;InstallFolder&amp;gt;\examples\peripheral\spi example.&lt;/p&gt;
&lt;p&gt;Anyway I connected nRF52832 and STK8321 using a 4-wire SPI.&lt;/p&gt;
&lt;p&gt;Like the picture below.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640765268167v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640764741787v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640764775947v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI tx rx</title><link>https://devzone.nordicsemi.com/thread/345318?ContentTypeID=1</link><pubDate>Wed, 29 Dec 2021 07:51:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2d32715-3ed8-476a-abd6-032d8a84150b</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I do not think I understand what you mean.&lt;/p&gt;
&lt;p&gt;You should be able to use the spi driver with any of our nRF52 microcontrollers.&lt;br /&gt;If you want the nRF to read data from your sensor, you need to connect it to the sensor.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI tx rx</title><link>https://devzone.nordicsemi.com/thread/345316?ContentTypeID=1</link><pubDate>Wed, 29 Dec 2021 07:33:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af63b9e3-4ad1-4e5d-bdc6-75156c6edb6f</guid><dc:creator>Minseo</dc:creator><description>&lt;p&gt;Do I need to use nRF DK to use &amp;lt;InstallFolder&amp;gt;\examples\peripheral\spi example?&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t use nRF52832 DK, so I don&amp;#39;t think the MISO line has data. Is that right?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI tx rx</title><link>https://devzone.nordicsemi.com/thread/345315?ContentTypeID=1</link><pubDate>Wed, 29 Dec 2021 07:25:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52925f45-79a3-4d5d-a292-d27a387d6360</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;If this is the case, I am guessing that there is no data on the MISO line?&lt;br /&gt;Could you verify this by using a oscilloscope or logic analyzer?&lt;/p&gt;
&lt;p&gt;How have you connected the pins of the sensor?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI tx rx</title><link>https://devzone.nordicsemi.com/thread/345273?ContentTypeID=1</link><pubDate>Tue, 28 Dec 2021 15:08:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b1ee211-3b2e-4a01-b980-75c4b7ceb1f0</guid><dc:creator>Minseo</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I tested &amp;lt;InstallFolder&amp;gt;\examples\peripheral\spi&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The module I&amp;#39;m using now is a module that I made separately by purchasing an nRF52832 MCU.&lt;/p&gt;
&lt;p&gt;So I don&amp;#39;t know if I can get Rx properly through the example above.&lt;/p&gt;
&lt;p&gt;I couldn&amp;#39;t check the Rx_buffer, but I could check that the event_handler was working properly.&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640704091887v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI tx rx</title><link>https://devzone.nordicsemi.com/thread/345266?ContentTypeID=1</link><pubDate>Tue, 28 Dec 2021 14:46:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95687e83-de52-4330-83f8-780e4de685dc</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also for &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__drv__spi.html#ga8502179e5c7d7a7da5104a4c1febe1e0"&gt;nrf_drv_spi_transfer&lt;/a&gt;: &lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640702115564v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The first buffer and length is the data you send, then the second buffer and length is the one you receive.&lt;/p&gt;
&lt;p&gt;In other words, the transfer function will be called once for both TX &lt;strong&gt;and&lt;/strong&gt; RX.&lt;strong&gt; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Then when the spi_event_handler is called , you can read data from your RX register,&lt;/p&gt;
&lt;p&gt;So to read the WHOAMI register from your sensor, my guess is that you can use our SPI example and change the following two things:&lt;/p&gt;
&lt;p&gt;Change initialization to match your sensor.&lt;/p&gt;
&lt;p&gt;Change the TEST_STRING &amp;quot;nordic&amp;quot; to TEST_STRING [1,0,0,0,0,0,0,0]&amp;nbsp; (1 for read and register address is 0)&lt;/p&gt;
&lt;p&gt;For more info on our SPI master driver, see our &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/hardware_driver_spi_master.html?resultof=%22%6e%72%66%5f%64%72%76%5f%73%70%69%5f%74%72%61%6e%73%66%65%72%22%20"&gt;SPI master documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Does this work for you?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI tx rx</title><link>https://devzone.nordicsemi.com/thread/345251?ContentTypeID=1</link><pubDate>Tue, 28 Dec 2021 13:11:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60acc42e-bc97-43ab-82a9-cf2900027839</guid><dc:creator>Minseo</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I am trying to communicate with STK8321 using 4-wire SPI. What I&amp;#39;m going to do now is simply read the same sensor WHO AM I read, but it stops here.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640696896414v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640696927674v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640696997136v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640697032330v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1640697065611v5.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI tx rx</title><link>https://devzone.nordicsemi.com/thread/345248?ContentTypeID=1</link><pubDate>Tue, 28 Dec 2021 13:03:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3fd13c9-1f7a-4e06-81e5-b49e9732cc18</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The important thing for the code is that it matches for your sensor device. &lt;br /&gt;I can therefore not say from the code alone if it will work or not.&lt;/p&gt;
&lt;p&gt;If you want me to say more about if it will work or not, please include brief description of sensor communication format and the name of the sensor.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI tx rx</title><link>https://devzone.nordicsemi.com/thread/345236?ContentTypeID=1</link><pubDate>Tue, 28 Dec 2021 12:30:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afe9d9a4-588b-4d52-a1c9-f45c7e004a29</guid><dc:creator>Minseo</dc:creator><description>&lt;p&gt;Thank you so much for answering.&lt;/p&gt;
&lt;p&gt;Is there no problem with the code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI tx rx</title><link>https://devzone.nordicsemi.com/thread/345229?ContentTypeID=1</link><pubDate>Tue, 28 Dec 2021 11:51:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7d98d51-5ef5-4cc3-ac6a-97be9a49559b</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi Minseo&lt;/p&gt;
[quote user=""]1-1. If I want to read the 0x00 register address, is it right to set it up like below?[/quote]
&lt;p&gt;Sensors use different ways to read registers. The datasheet of your sensor should explain how to do this.&lt;/p&gt;
&lt;p&gt;In the SPI Peripheral sample you are using, the spi_event_handler is called after messages are received. You must wait until this is called before reading the m_rx_buf to read your data.&lt;/p&gt;
&lt;p&gt;To ensure that SPI is sending data on the lines, I recommend to use an oscilloscope or logic analyzer to probe the SPI lines. This is also useful to get insight into the workings of SPI.&lt;br /&gt;And it can be used to verify that the data sent on SPI is correctly formatted.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>