<?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>Pixel display on Sharp Memory LCD with nRF51</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14834/pixel-display-on-sharp-memory-lcd-with-nrf51</link><description>Hi, 
 I am coding a Sharp memory LCD display using SPI and the nRF51422 development board. 
 I have tested the SPI connection using a logic analyzer and signals are being sent to clk, chip select and MOSI pins. 
 However, I cannot get meaningful images</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Jun 2016 21:57:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14834/pixel-display-on-sharp-memory-lcd-with-nrf51" /><item><title>RE: Pixel display on Sharp Memory LCD with nRF51</title><link>https://devzone.nordicsemi.com/thread/56627?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2016 21:57:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83f20cbc-417a-4b18-b7d8-0c7262075e01</guid><dc:creator>bvuong87</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve used a similar display in the past, but unfortunately can&amp;#39;t provide the full source code.&lt;/p&gt;
&lt;p&gt;From your init_buf() routine, it looks like you&amp;#39;re trying to write alternating 1&amp;#39;s and 0&amp;#39;s to line 1 correct? From page 4 of the &amp;quot;programming memory lcd app note&amp;quot; pdf, it states that the write line &amp;quot;payload&amp;quot; consists of 4 distinct parts - The command, the line number, the data and the trailer.&lt;/p&gt;
&lt;p&gt;So the write line command starts with 0x80 or&amp;#39;d with the current status of the vcom bit. So in your init_buf() routine, I think you need&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p_tx_buf[0] = 0x80 | (v_bit &amp;lt;&amp;lt; 6)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;instead of what you have&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p_tx_buf[0] = 0xa0 | (v_bit &amp;lt;&amp;lt; 6)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Also, the 2nd byte you&amp;#39;re sending (the line address byte) needs to be swapped (so MSB goes to LSB, et cetera). This is seen in page 7 of the app note and n your case I think you&amp;#39;d want...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p_tx_buf[1] = (0x80);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then you should be able to transfer the rest of your data buffer and trailer bytes.&lt;/p&gt;
&lt;p&gt;If all of that fails, see if you can get the clear screen command to work then build up from there. Your spi tx buffer should only consist of the clear command and one trailer byte&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p_tx_buf[0] = (v_bit &amp;lt;&amp;lt; 6) | 0x20;  // 0x20 is clear memory command
p_tx_buf[1] = 0x00;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and change the appropriate &amp;#39;len&amp;#39; variables&lt;/p&gt;
&lt;p&gt;**Edit: ** Changed from (1&amp;lt;&amp;lt;7) to (1&amp;lt;&amp;lt;6) for the vcom bit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pixel display on Sharp Memory LCD with nRF51</title><link>https://devzone.nordicsemi.com/thread/56626?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2016 15:01:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc85d996-0028-4f24-98fd-9241b69aae6b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@LK: You may want to capture a logic analyzer trace on the SPI line to see what is actually sent over the interface.
In your code I saw that you are sending the command to write a line with  0xa0|(v_bit &amp;lt;&amp;lt;6);, is it correct ? I thought the command to write one line should be 0x80|(v_bit &amp;lt;&amp;lt;6); ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>