<?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 IQuestion about SPIMaster_LDD in KDS in Processor Expert Software</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/IQuestion-about-SPIMaster-LDD-in-KDS/m-p/474588#M3755</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm writing an SPI driver to a device which requires me to either send small commands (1 byte), or to send and receive one byte.&amp;nbsp; However, the send and receive must be done under a single chip select.&amp;nbsp; If I use the built in chip select, then switching from SendBlock to ReceiveBlock lowers it, and it fails.&amp;nbsp; If I remove the chip select and handle it as an IO, I have timing problems, as the event for send comes after the last byte (in my case also the first) has entered the buffer - but before the character has actually been transmitted - so I have to do a forced wait estimating when it will be ready.&amp;nbsp; Is there a way to send and receive under a single chip select with the component?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 May 2016 15:43:58 GMT</pubDate>
    <dc:creator>sburck</dc:creator>
    <dc:date>2016-05-17T15:43:58Z</dc:date>
    <item>
      <title>IQuestion about SPIMaster_LDD in KDS</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/IQuestion-about-SPIMaster-LDD-in-KDS/m-p/474588#M3755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm writing an SPI driver to a device which requires me to either send small commands (1 byte), or to send and receive one byte.&amp;nbsp; However, the send and receive must be done under a single chip select.&amp;nbsp; If I use the built in chip select, then switching from SendBlock to ReceiveBlock lowers it, and it fails.&amp;nbsp; If I remove the chip select and handle it as an IO, I have timing problems, as the event for send comes after the last byte (in my case also the first) has entered the buffer - but before the character has actually been transmitted - so I have to do a forced wait estimating when it will be ready.&amp;nbsp; Is there a way to send and receive under a single chip select with the component?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 15:43:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/IQuestion-about-SPIMaster-LDD-in-KDS/m-p/474588#M3755</guid>
      <dc:creator>sburck</dc:creator>
      <dc:date>2016-05-17T15:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: IQuestion about SPIMaster_LDD in KDS</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/IQuestion-about-SPIMaster-LDD-in-KDS/m-p/474589#M3756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;The SPI device receive and send bytes concurrently. When a byte of data is send a byte of data is received concurrently. There shouldn't by any problem to send and receive one byte of data on a single chip select. To perform this action by using SPIMaster, you must call the receive function firstly (it just assign a buffer for received data) and then send the data by the send function.&lt;/P&gt;&lt;P&gt;See for example the following code (it is available in the Typical usage chapter in the SPIMaster_LDD help):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define BLOCK_SIZE 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint8_t OutData[BLOCK_SIZE] = "0123";&lt;/P&gt;&lt;P&gt;uint8_t InpData[BLOCK_SIZE];&lt;/P&gt;&lt;P&gt;volatile bool DataReceivedFlag = FALSE;&lt;/P&gt;&lt;P&gt;volatile LDD_SPIMASTER_TError ComError = 0U;&lt;/P&gt;&lt;P&gt;LDD_TError Error;&lt;/P&gt;&lt;P&gt;LDD_TDeviceData *MySPIPtr;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void main(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; MySPIPtr = SM1_Init(NULL);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Initialization of SM1 component */&lt;/P&gt;&lt;P&gt;&amp;nbsp; Error = SM1_ReceiveBlock(MySPIPtr, InpData, BLOCK_SIZE); /* Request data block reception */&lt;/P&gt;&lt;P&gt;&amp;nbsp; Error = SM1_SendBlock(MySPIPtr, OutData, BLOCK_SIZE);&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Start transmission/reception */&lt;/P&gt;&lt;P&gt;&amp;nbsp; while (!DataReceivedFlag) {};&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Wait until data block is transmitted/received */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Marek Neuzil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 10:40:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/IQuestion-about-SPIMaster-LDD-in-KDS/m-p/474589#M3756</guid>
      <dc:creator>marek_neuzil</dc:creator>
      <dc:date>2016-06-24T10:40:55Z</dc:date>
    </item>
  </channel>
</rss>

