<?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>SPI MOSI only</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2161/spi-mosi-only</link><description>Hi All, 
 I am trying to make a nrf51822 talk to a SPI display by using the SPI Master.
My problem is that the display does not give any output, only takes input. 
 The nrf51822 SPI Master seems to expect that whenever it sends a byte on TX, it should</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Jul 2015 08:34:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2161/spi-mosi-only" /><item><title>RE: SPI MOSI only</title><link>https://devzone.nordicsemi.com/thread/9158?ContentTypeID=1</link><pubDate>Tue, 07 Jul 2015 08:34:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb2935ac-e2de-47bd-9dbd-d3cb0431e8be</guid><dc:creator>Ric</dc:creator><description>&lt;p&gt;Let me  replace my slave device and check again. I will be back soon with my update.. Thanks Alex&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI MOSI only</title><link>https://devzone.nordicsemi.com/thread/9157?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2015 15:24:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbcd666c-0ed3-4d2f-bed7-12163c4d973f</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;I&amp;#39;d remove first line of&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SPI-&amp;gt;TXD = (uint32_t)*tx_data++;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and leave only one in WHILE loop&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI MOSI only</title><link>https://devzone.nordicsemi.com/thread/9154?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2015 15:10:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1f8eae6-6152-4142-8885-a0528b729e36</guid><dc:creator>Ric</dc:creator><description>&lt;p&gt;When I check my SPI1 Registers, I find that the configuration to be set in the right manner. But, I just observed that I am able to write to SPI-&amp;gt;TXD Register only during the first assignment  of my code. Within the while Loop, not matter I am moving the data to the SPI-&amp;gt;TXD from my tx_buffer, the SPI-&amp;gt;TXD is always set to 0x00.&lt;/p&gt;
&lt;p&gt;To mention, when I check the SCLK on the scope, I find the clock pulses being generated but MOSI has  incorrect data. I suspect the if there is any issue with my slave as it seems to be healthy.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI MOSI only</title><link>https://devzone.nordicsemi.com/thread/9153?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2015 14:45:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a30f1cd-3314-490d-9180-c5c826a498b2</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;May be something wrong with your SPI hardware configuration? By the way, if you connect physically MISO pin to MOSI then it will simulate full SPI system and RXD register should have data sent over from TXD register.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI MOSI only</title><link>https://devzone.nordicsemi.com/thread/9152?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2015 14:42:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3135ae82-dd8f-4d06-9ea7-7d2c3c5ba305</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;RXD register will be changed during TXD regardless of what is on MISO pin. As Asbjørn said earlier, RXD register will just have random data, in your case either 0x00 or oxFF depending on the constant level of dummy pin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI MOSI only</title><link>https://devzone.nordicsemi.com/thread/9156?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2015 14:30:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d173c7f3-ce0a-41fc-aa6b-af02d4bd87b1</guid><dc:creator>Ric</dc:creator><description>&lt;p&gt;Hi Alex,&lt;/p&gt;
&lt;p&gt;Both the while Loops I my exiting through my timeout. The EVENT_READY is never generated.&lt;br /&gt;
And yes, you are correct, the second is not requied.&lt;/p&gt;
&lt;p&gt;Is the EVENT_READY Event generated even there is no Change in the RXD Register as the MISO pin is just connected to a dummy pin.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI MOSI only</title><link>https://devzone.nordicsemi.com/thread/9155?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2015 14:11:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b029fc64-ef04-44ac-85cf-99bd0105f40e</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Which WHILE loop do you exit by delay timeout? First or second? I suspect second WHILE loop not needed at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI MOSI only</title><link>https://devzone.nordicsemi.com/thread/9151?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2015 12:25:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:498a0ecf-82cc-4e3e-88ea-d0e2b7e65d14</guid><dc:creator>Ric</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am facing a similar Problem where my slave device only has a MOSI and it does not communicate back with the nrf518222.   Hence, I have connected the  MISO to a dummy pin which is left open.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    bool spi_master_tx(SPIModuleNumber spi_num, uint16_t transfer_size, const uint8_t *tx_data)
{
    volatile uint32_t dummyread;
		uint16_t delay;	
	
    if(tx_data == 0)
    {
        return false;
    }
    
		delay = 0x3E80;										// 1ms delay for 16MHz clock
    SPI = spi_base[spi_num];
    
    /* enable slave (slave select active low) */
    nrf_gpio_pin_clear(spi_config_table[spi_num].Pin_CSN);
    
    SPI-&amp;gt;EVENTS_READY = 0; 
    
    SPI-&amp;gt;TXD = (uint32_t)*tx_data++;	
		
    
    while(--transfer_size)
    {
        SPI-&amp;gt;TXD =  (uint32_t)*tx_data++;		

				
        /* Wait for the transaction complete or timeout (about 10ms - 20 ms) */
        while (SPI-&amp;gt;EVENTS_READY == 0 &amp;amp;&amp;amp; --delay);
        
        /* clear the event to be ready to receive next messages */
        SPI-&amp;gt;EVENTS_READY = 0;
        
        dummyread = SPI-&amp;gt;RXD;
    }   
		
		delay = 0x3E80;										// 1ms delay for 16MHz clock
    /* Wait for the transaction complete or timeout (about 10ms - 20 ms) */
		while (SPI-&amp;gt;EVENTS_READY == 0 &amp;amp;&amp;amp; --delay);

    dummyread = SPI-&amp;gt;RXD;

    /* disable slave (slave select active low) */
    nrf_gpio_pin_set(spi_config_table[spi_num].Pin_CSN);
    
    return true;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is the code snippet which I am using to Transfer data to my slave.  But the Problem is that the EVENT_READY is never set and I Exit the Loop only after my defined delay (no matter how Long the delay).&lt;/p&gt;
&lt;p&gt;As mentioned in the user Manual, since the EVENT_READY is set only when data is written to the RXD Register. Now since my MISO is left open I will never receive data into the RXD Register.  Is there a Workaround for this. How did you solve your Problem?&lt;/p&gt;
&lt;p&gt;Thanks,
Richard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI MOSI only</title><link>https://devzone.nordicsemi.com/thread/9150?ContentTypeID=1</link><pubDate>Fri, 23 May 2014 13:09:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec93db16-498c-4d35-9a41-8472d2011dc6</guid><dc:creator>Asbj&amp;#248;rn</dc:creator><description>&lt;p&gt;Have you tried connection the display and the nRF51? As long as you read out the SPI buffer on the nRF51 it shouldn&amp;#39;t matter whether or not the data on the MISO line is actually worth using. If the pin is left open the buffer will still be filled with random data while you write to the display one the MOSI line. Just clear and throw away the content of the MISO and you should be fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>