<?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 Master</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42282/nrf52832-spi-master</link><description>Hi, 
 I&amp;#39;m facing an issue when communicating to a sensor using Nordic SPI master. The sensor requires nRF52832 to have 2us delay after first byte (address) is transmitted before receive byte (data) from the sensor. Is there any way to insert the 2us delay</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Feb 2019 00:47:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42282/nrf52832-spi-master" /><item><title>RE: nRF52832 SPI Master</title><link>https://devzone.nordicsemi.com/thread/170474?ContentTypeID=1</link><pubDate>Tue, 12 Feb 2019 00:47:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02ff0ec2-6fe4-455f-85ed-0416228882d4</guid><dc:creator>Bernard Chan Lye Hock</dc:creator><description>&lt;p&gt;I find that using this method to read do a sensor read apart from the 20us delay in between transfer, the receive bytes is also 2 bytes instead of 1 bytes. Although it has been declared to receive 1 byte as following. Does anyone see this and how to fix it so that I could get only 1 bytes instead of 2 bytes? Is this a Nordic bug?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;nrf_drv_spi_transfer(&amp;amp;spi, NULL ,0, m_rx_buf, 1);	&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI Master</title><link>https://devzone.nordicsemi.com/thread/166409?ContentTypeID=1</link><pubDate>Fri, 18 Jan 2019 09:01:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83f8b391-6e4d-4b63-9508-e649f7d204b1</guid><dc:creator>GeneYap</dc:creator><description>&lt;p&gt;Thanks Jared!&lt;/p&gt;
&lt;p&gt;It helped, however I noticed there is around 20us delay in between step(1) and step(3), even I didn&amp;#39;t insert any delay in step(2). Is it&amp;nbsp;because of waiting the spi_xfer_done flag to be set in the spi_event_handler after transfer completed?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void sensor_read(uint8_t addr)
{
		spi_xfer_done = false;	
		nrf_gpio_pin_clear(SPI_SS_PIN);	
		nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;addr, 1, NULL, 0);		
		while (!spi_xfer_done){
            __WFE();}
						
		spi_xfer_done = false;		
		nrf_drv_spi_transfer(&amp;amp;spi, NULL ,0, m_rx_buf, 1);	
		while (!spi_xfer_done){
            __WFE();}
		nrf_gpio_pin_set(SPI_SS_PIN);
}
&lt;/pre&gt; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI Master</title><link>https://devzone.nordicsemi.com/thread/165030?ContentTypeID=1</link><pubDate>Thu, 10 Jan 2019 20:57:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2a9ab41-a42c-4943-818a-29a2878259d8</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Sounds like a similar issue I had with TI AFEs; here are my notes:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Sending Multi-Byte Commands
// The ADS1291, ADS1292, and ADS1292R serial interface decodes commands in bytes and requires 4 tCLK cycles
// to decode and execute. Therefore, when sending multi-byte commands, a 4 tCLK period must separate the end of
// one byte (or opcode) and the next.
// Assume CLK is 512 kHz, then tSDECODE (4 tCLK) is 7.8125 us. When SCLK is 16 MHz, one byte can be
// transferred in 500 ns. This byte-transfer time does not meet the tSDECODE specification; therefore, a delay must be
// inserted so the end of the second byte arrives 7.3125 us later. If SCLK is 1 MHz, one byte is transferred in 8 �s.
// Because this transfer time exceeds the tSDECODE specification, the processor can send subsequent bytes without
// delay. In this later scenario, the serial port can be programmed to move from single-byte transfer per cycle to
// multiple bytes.
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Assuming the issue is similar the byte transfer time is what matters, not the individual SCK cycles and so using (say) a clock of 500kHz is a quick workaround for such as an ADS1292. If the device in question really cannot tolerate any edge on SCK then this suggestion won&amp;#39;t be much help unless you tolerate a very slow clock period in which case DMA helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI Master</title><link>https://devzone.nordicsemi.com/thread/164962?ContentTypeID=1</link><pubDate>Thu, 10 Jan 2019 14:30:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d15a6a86-c236-44af-810f-bd327e38091d</guid><dc:creator>natersoz</dc:creator><description>&lt;p&gt;You will need to manipulate the SS (slave select - NCS in your diagram) externally and not give control to the SPIM driver.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI Master</title><link>https://devzone.nordicsemi.com/thread/164953?ContentTypeID=1</link><pubDate>Thu, 10 Jan 2019 14:14:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a05c6be-61b1-4f02-a3ea-5363b1a6df6b</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Sounds a bit odd - what sensor is it?&lt;/p&gt;
&lt;p&gt;How to properly post source code:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/3487._5F00_Insert-Code-_2D00_-Nordic.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI Master</title><link>https://devzone.nordicsemi.com/thread/164941?ContentTypeID=1</link><pubDate>Thu, 10 Jan 2019 13:56:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:449a2039-0992-4ea1-b33e-5384a897f42c</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can try this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Transmit the data with&amp;nbsp;&lt;span&gt;nrf_driver_spi_transfer()&amp;nbsp; and pass a NULL to the &lt;strong&gt;receive&amp;nbsp;buffer.&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Insert the delay&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Receive the data with nrf_driver_spi_transfer() and pass a NULL to the &lt;strong&gt;transmit buffer&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Chip select should be held low the entire time, the clock signal will only tick when data is exchanged.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SPI Master</title><link>https://devzone.nordicsemi.com/thread/164813?ContentTypeID=1</link><pubDate>Thu, 10 Jan 2019 07:22:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5976ff8e-389d-464e-808d-5c1673bb167b</guid><dc:creator>GeneYap</dc:creator><description>&lt;p&gt;The sensor need some time before it could response to an incoming address.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1547104883315v2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>