<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Interfacing Sharp LCD with K60 in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Interfacing-Sharp-LCD-with-K60/m-p/684436#M17414</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to interface LS013B7DH06 Sharp-memory LCD with K60 via SPI interface. I have written my spi_write function as follows,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px;"&gt;{SPI2_PUSHR = ((SPI_PUSHR_CTAS(0x00)) | (SPI_PUSHR_PCS(63)) | (SPI_PUSHR_CONT_MASK) | SPI_PUSHR_TXDATA(0x20)); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; while(((SPI2_SR &amp;amp; SPI_SR_TCF_MASK) == 0));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; SPI2_SR |= SPI_SR_TCF_MASK;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; SPI2_SR |= SPI_SR_TFFF_MASK;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt;// end of queue&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; SPI2_PUSHR = ((SPI_PUSHR_CTAS(0x00)) | (SPI_PUSHR_PCS(63))| (SPI_PUSHR_EOQ_MASK) | (SPI_PUSHR_CONT_MASK &amp;amp; 0x00) | SPI_PUSHR_TXDATA(0x00)); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; while(((SPI2_SR &amp;amp; SPI_SR_TCF_MASK) == 0));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; SPI2_SR |= SPI_SR_TCF_MASK;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; SPI2_SR |= SPI_SR_TFFF_MASK;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lcd write is happening fine and i am able to write all my graphics api. Now when i try to write the SPI_Write Function using the following code,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px;"&gt;void bspSpiWrite ( uint8_t addr)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; uint8_t buffer[1];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; uint32_t data;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; _mqx_int result;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; buffer[0]= addr; &amp;nbsp;// (0x20) 0r (0x80)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt;result = fwrite( buffer, 1, sizeof(buffer), spifd);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt;if (result != 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; printf("ERROR");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; printf("OK");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; fflush(spifd);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;Now since its a complete MQX api (fwrite) and this is what i need to implement, my code is not working if i use the above function. May i request anyone to please explain me why it is working with 1st case and why not with 2nd? What is wrong with the 2nd function??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;It would be a great if someone helps me out on this.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 May 2017 13:45:50 GMT</pubDate>
    <dc:creator>nithinnagaraj</dc:creator>
    <dc:date>2017-05-18T13:45:50Z</dc:date>
    <item>
      <title>Interfacing Sharp LCD with K60</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Interfacing-Sharp-LCD-with-K60/m-p/684436#M17414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to interface LS013B7DH06 Sharp-memory LCD with K60 via SPI interface. I have written my spi_write function as follows,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px;"&gt;{SPI2_PUSHR = ((SPI_PUSHR_CTAS(0x00)) | (SPI_PUSHR_PCS(63)) | (SPI_PUSHR_CONT_MASK) | SPI_PUSHR_TXDATA(0x20)); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; while(((SPI2_SR &amp;amp; SPI_SR_TCF_MASK) == 0));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; SPI2_SR |= SPI_SR_TCF_MASK;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; SPI2_SR |= SPI_SR_TFFF_MASK;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt;// end of queue&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; SPI2_PUSHR = ((SPI_PUSHR_CTAS(0x00)) | (SPI_PUSHR_PCS(63))| (SPI_PUSHR_EOQ_MASK) | (SPI_PUSHR_CONT_MASK &amp;amp; 0x00) | SPI_PUSHR_TXDATA(0x00)); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; while(((SPI2_SR &amp;amp; SPI_SR_TCF_MASK) == 0));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; SPI2_SR |= SPI_SR_TCF_MASK;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; SPI2_SR |= SPI_SR_TFFF_MASK;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lcd write is happening fine and i am able to write all my graphics api. Now when i try to write the SPI_Write Function using the following code,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px;"&gt;void bspSpiWrite ( uint8_t addr)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; uint8_t buffer[1];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; uint32_t data;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; _mqx_int result;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; buffer[0]= addr; &amp;nbsp;// (0x20) 0r (0x80)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt;result = fwrite( buffer, 1, sizeof(buffer), spifd);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt;if (result != 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; printf("ERROR");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; printf("OK");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt; fflush(spifd);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11px;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;Now since its a complete MQX api (fwrite) and this is what i need to implement, my code is not working if i use the above function. May i request anyone to please explain me why it is working with 1st case and why not with 2nd? What is wrong with the 2nd function??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;It would be a great if someone helps me out on this.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2017 13:45:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Interfacing-Sharp-LCD-with-K60/m-p/684436#M17414</guid>
      <dc:creator>nithinnagaraj</dc:creator>
      <dc:date>2017-05-18T13:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Interfacing Sharp LCD with K60</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Interfacing-Sharp-LCD-with-K60/m-p/684437#M17415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nithin:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I don't see your whole source, especially where you open this spi device , It is hard to locate the root cause. I would suggest you check the the chip select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more details, please see chapter 9.6,&amp;nbsp; Using the SPI driver&lt;/P&gt;&lt;P&gt;Freescale_MQX_4_2\doc\mqx\MQX_IO_User_Guide.pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For details how to implement SPI, please look at SPI example codel&lt;/P&gt;&lt;P&gt;Freescale_MQX_4_2\mqx\examples\spi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 08:39:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Interfacing-Sharp-LCD-with-K60/m-p/684437#M17415</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2017-06-20T08:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Interfacing Sharp LCD with K60</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Interfacing-Sharp-LCD-with-K60/m-p/684438#M17416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the reply Daniel.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 08:55:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Interfacing-Sharp-LCD-with-K60/m-p/684438#M17416</guid>
      <dc:creator>nithinnagaraj</dc:creator>
      <dc:date>2017-07-11T08:55:02Z</dc:date>
    </item>
  </channel>
</rss>

