<?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>Programming an LCD with nRF51 using SPI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14800/programming-an-lcd-with-nrf51-using-spi</link><description>Hi, 
 Would anyone be able to upload a template code for programming an LCD using the nRF51822 or nRF51422 with SPI? 
 I am using Sharp’s LS013B4DN04 Memory LCD. Here&amp;#39;s the datasheet: www.sharpmemorylcd.com/.../ls013b4dn04_application_info.pdf 
 I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Jun 2016 12:27:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14800/programming-an-lcd-with-nrf51-using-spi" /><item><title>RE: Programming an LCD with nRF51 using SPI</title><link>https://devzone.nordicsemi.com/thread/56500?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2016 12:27:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d02faceb-6453-403a-82cf-712341a925f0</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@LK: Please don&amp;#39;t attach the long source code, it&amp;#39;s not possible to read anyway. Please remove them and add a file instead. I still don&amp;#39;t know what is the issue ? Have you tried to request the library or example code from the LCD manufacturer ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming an LCD with nRF51 using SPI</title><link>https://devzone.nordicsemi.com/thread/56499?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2016 12:09:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2fec411-ff51-4b7e-9b25-99b796c5f374</guid><dc:creator>LK13131</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;Yes, I have explored the spi_master example and I have tried to complete the following 5 steps for establishing an SPI connection to the LCD screen, which I found on another posted question on this forum:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/question/79591/use-spim-to-send-data-to-panel-but-uint8_t-only-send-255-byte-at-a-time/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Control the SS pin manually by configuring it as a GPIO output and and setting it high initially.&lt;/li&gt;
&lt;li&gt;Break your data into 255 byte chunks
Before sending data set SS low.&lt;/li&gt;
&lt;li&gt;Call nrf_drv_spi_transfer() for first chunk&lt;/li&gt;
&lt;li&gt;Wait for SPI event handler to know when transfer is complete&lt;/li&gt;
&lt;li&gt;Repeat 4-5 until all data is transferred, then set SS high.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To follow these steps, I added the following code to main(): (data is random data for an &amp;#39;image&amp;#39;)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//Control the SS pin manually by configuring it as a GPIO output and and setting it high initially.
nrf_gpio_cfg_output(SPI_SS);
nrf_drv_gpiote_out_set(SPI_SS);

//Break your data into 255 byte chunks
data = {{0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5}};

//Before sending data set SS low
nrf_drv_gpiote_out_clear(SPI_SS);	

//Call nrf_drv_spi_transfer() for first chunk
nrf_drv_spi_transfer(p_instance, p_tx_buffer, TX_RX_MSG_LENGTH, p_rx_buffer, TX_RX_MSG_LENGTH);

//Wait for SPI event handler to know when transfer is complete

//Repeat 4-5 until all data is transferred, then set SS high.
nrf_drv_gpiote_out_set(SPI_SS);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming an LCD with nRF51 using SPI</title><link>https://devzone.nordicsemi.com/thread/56498?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2016 11:54:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:215ca676-d3f8-43d2-b2ca-c6a9816a3193</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@LK13131: Have you tried to play with our SPI example and the spi driver in our SDK ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>