<?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>nrf52840 spi miso and transfer not working</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71401/nrf52840-spi-miso-and-transfer-not-working</link><description>hello Nordic 
 
 i am working with nrf52840 dev board, sdk 16.0, based on the peripheral app_ble_blinky example. 
 i have 2 spi comms, one twi, and use rtc, app timer and hfclk timer. so far so good 
 
 i check the first spi which is SPI1 (TWI taks the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 10 Feb 2021 13:29:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71401/nrf52840-spi-miso-and-transfer-not-working" /><item><title>RE: nrf52840 spi miso and transfer not working</title><link>https://devzone.nordicsemi.com/thread/293775?ContentTypeID=1</link><pubDate>Wed, 10 Feb 2021 13:29:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb301557-f111-43ed-9818-d48bf88eeb82</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I did some tests on the DK and I was indeed able to use Pin 0.14 after cutting the Solder bridge 6 and removing the initializing of the BSP module. I tested it by setting up one board with the SPIS example, and another with the SPI master example with P0.14 as MISO. I was therefore not able to reproduce your issue.&amp;nbsp; Also, I tested the pulldown feature and it also worked, it pulled the signal low the whole time as expected. There might be some issues introduced by the slave that you&amp;#39;re using, could you try to replicate my setup and test by using an additional nRF52 DK as a slave?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="ziv123"]&lt;p&gt;4. if i reconfigure the VDD it will affect all other components in the system, like other SPI instances, TWI and more, am i correct ? or is there a way to configure just one VDD output ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;Yes, you&amp;#39;re correct. All the peripherals will then be affected, there is no way really to separate the voltage domain of the peripherals.&lt;/p&gt;
[quote user="ziv123"]&lt;p&gt;i get a clock for 6 bytes instead of 8 (2 bytes for read command, 6 bytes for what i whish to receive ), why is that ? what do i need to change in my configuration or call to get the 6 bytes i whish to receive ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;A SPI transaction is driven by the Master, and uses a shift register scheme. &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/spi.html?cp=4_2_0_47_0_2#concept_ov2_f54_sr"&gt;It will therefore end as soon as the Master is done sending data&lt;/a&gt;. You could&amp;nbsp;try&amp;nbsp;filling the tx buffer with &amp;quot;dummy data&amp;quot; so that it&amp;#39;s the same size as the receive buffer.&lt;/p&gt;
&lt;p&gt;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: nrf52840 spi miso and transfer not working</title><link>https://devzone.nordicsemi.com/thread/293494?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 09:24:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:472ce1ca-801d-44e0-8577-d72f7de8132a</guid><dc:creator>ziv123</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Jared&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp;&lt;/p&gt;
[quote userid="73165" url="~/f/nordic-q-a/71401/nrf52840-spi-miso-and-transfer-not-working/293489#293489"]What voltage do you measure on the pin? [/quote]
&lt;p&gt;as shown in the picture the v i am seeing is tristate which means a little above 1v at all time, except the time when MISO appears to go to zero when transmitting, so i guess&amp;nbsp;a general&amp;nbsp;question first would be&lt;/p&gt;
&lt;p&gt;- does the pulldown should pull the pin only when there is a clock and chip select is low or does it pulled down all the time ?&lt;/p&gt;
&lt;p&gt;relevant question is that i see the MISO pin remains in tristate even when there is a clock, so maybe my config of pulldown is not done correctly, i am using the sdk_congif.h to define it though id i try going to declaration i get to an old config (i never understand this)&amp;nbsp;?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp;&lt;/p&gt;
[quote userid="73165" url="~/f/nordic-q-a/71401/nrf52840-spi-miso-and-transfer-not-working/293489#293489"]I don&amp;#39;t think I understand you correctly here[/quote]
&lt;p&gt;i use this call :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;err_code = nrf_drv_spi_transfer(&amp;amp;accelo_spi, read_xyz_sample, sizeof(read_xyz_sample), 
                                    xyz_sample_buff, sizeof(xyz_sample_buff));
                                    
// size of &amp;quot;read_xyz_sample&amp;quot; is 2 bytes
// size of &amp;quot;xyz_sample_buff&amp;quot; is 6 bytes

// i get clock for total of 6 bytes instead of 8&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;i get a clock for 6 bytes instead of 8 (2 bytes for read command, 6 bytes for what i whish to receive ), why is that ? what do i need to change in my configuration or call to get the 6 bytes i whish to receive ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3.&amp;nbsp;&lt;/p&gt;
[quote userid="73165" url="~/f/nordic-q-a/71401/nrf52840-spi-miso-and-transfer-not-working/293489#293489"]Try cutting the board and avoid initializing the bsp module in your code.[/quote][quote userid="90084" url="~/f/nordic-q-a/71401/nrf52840-spi-miso-and-transfer-not-working"] i cat the SB6 connecting the led2 to the pin p0_14, it did not help, then i changed the pins MISO to p0_26, and CLK to p0_27 and it seems to help with the back signal. any idea why it does not work with the p0_14 [/quote]
&lt;p&gt;i also avoided initializing the leds and buttons, so the question remains, why does it work perfectly on another pin and p0_14 just wont work correctly, seems like the spi slave can&amp;#39;t raise from 0 to 1 like its overloaded for some reason&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;4. if i reconfigure the VDD it will affect all other components in the system, like other SPI instances, TWI and more, am i correct ? or is there a way to configure just one VDD output ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;hope to read from you soon&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Ziv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 spi miso and transfer not working</title><link>https://devzone.nordicsemi.com/thread/293489?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 09:03:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2b2b848-e4fa-423c-9846-135e1449f936</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;&amp;nbsp;Hi there!&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;What voltage do you measure on the pin? I tried measuring with and without a pulldown on MISO and saw a clear difference. The former was about 0V, the latter was floating around some hundred mV.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;I don&amp;#39;t think I understand you correctly here.&amp;nbsp;Are you reading more or less data than what you pass as the size parameter?&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Pin 0.14 is used as LED1 on the Devkit. Try cutting the board and avoid initializing the bsp module in your code.&lt;/li&gt;
&lt;li&gt;The SPI voltage that is used is VDD. So you need to configure VDD within the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/recommended_op_conditions.html?cp=4_0_0_7"&gt;operating conditions&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>