<?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>Processor Expert SoftwareのトピックRe: SPI Master Slave Query</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290284#M2080</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you are using SPI_Slave_LDD and you should use it's methods like SendBlock and ReceiveBlock instead writing to SPI registers. You can find example in the help of the SPISlave_LDD component using pop-up menu command "Help on component" and the go to page "Typical usage".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you'd like to write&amp;nbsp; transfer code completely by yourself, use the Init_SPI component which provides initialization only instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Petr Hradsky&lt;/P&gt;&lt;P&gt;Processor Expert Support Team&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Mar 2013 10:50:09 GMT</pubDate>
    <dc:creator>Petr_H</dc:creator>
    <dc:date>2013-03-12T10:50:09Z</dc:date>
    <item>
      <title>SPI Master Slave Query</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290283#M2079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using K60 Kinetis MCU in SPI Slave mode, i will be interfacing this with Microprocessor unit which acts as SPI master.&lt;/P&gt;&lt;P&gt;I have initialized SS1:SPI Slave_LDD using Processor Expert CPHA=1, CPHA=0 CS = ACTIVE LOW.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Attached Processor Expert file for SPI configuration reference&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;Slave Side&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;After calling the SS1_Init(NULL);&lt;/P&gt;&lt;P&gt;Data which i will be sending to SPI Master is sent to TXFIFO using following instruction followed by GPIO interrupt to Master&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;SPI2_PUSHR_SLAVE = 0x0A;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;From the debugg mode i was able to see SPI2_TXFR0 buffer filled with value 0x0A&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Interrupt Generation to Master CPU */&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;GPIO2_SetFieldValue(Led1Data, INTR, 0X1);&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;GPIO2_SetFieldValue(Led1Data, INTR, 0X0);&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;STRONG&gt;Master Side&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;SPI Master on receiving INTR initiates SPI read by sending dummy clock &amp;amp; de-asserting CS line depending on number of bytes i have to read. But i do not see any activity on MISO line and remains LOW. SPI master is configured to same CPHA &amp;amp; CPOL as that of slave&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;STRONG&gt;How do i read the data using my SPI Master from SLAVE's TX buffer? Does SPI master has to make any write before slave sends any data? &lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Sudhir&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338880"&gt;ProcessorExpert.pe.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 07:33:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290283#M2079</guid>
      <dc:creator>sudhirprabhu</dc:creator>
      <dc:date>2013-03-11T07:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Master Slave Query</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290284#M2080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you are using SPI_Slave_LDD and you should use it's methods like SendBlock and ReceiveBlock instead writing to SPI registers. You can find example in the help of the SPISlave_LDD component using pop-up menu command "Help on component" and the go to page "Typical usage".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you'd like to write&amp;nbsp; transfer code completely by yourself, use the Init_SPI component which provides initialization only instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Petr Hradsky&lt;/P&gt;&lt;P&gt;Processor Expert Support Team&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Mar 2013 10:50:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290284#M2080</guid>
      <dc:creator>Petr_H</dc:creator>
      <dc:date>2013-03-12T10:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Master Slave Query</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290285#M2081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Petr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using the SendBlock API generated by Processor Expert code to transfer the data from Kinetis Slave, followed by GPIO interrupt to Master to read data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SS1_SendBlock(slaveDevData, (LDD_TData*)data, 4);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*Interrupt Generation to Master CPU */&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;GPIO2_SetFieldValue(Led1Data, INTR, 0X1);&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; GPIO2_SetFieldValue(Led1Data, INTR, 0X0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both the above calls execute fine at Slave End&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem is I am not able to read the data using my SPI master which is a different MPU not Kinetis.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently i initiated transfer from SPI Master by sending 4 bytes clock with CS active low, SPI mode 0 (Configured same in master &amp;amp; Slave) &amp;amp;&amp;nbsp; 8MHz SPI Master Clock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know how will the master notify the slave if the data has to be read or written from slave?&lt;/P&gt;&lt;P&gt;Is there any requirement that master has to write a byte to slave ( Like the Register address &amp;amp; Set read/write bit) before SLAVE sends data on MISO lines. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In other words &lt;STRONG&gt;how can i initiate SPI transfer from Master to read data from Kinetis SPI Slave?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sudhir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Mar 2013 05:29:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290285#M2081</guid>
      <dc:creator>sudhirprabhu</dc:creator>
      <dc:date>2013-03-13T05:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Master Slave Query</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290286#M2082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On SPI the reading and writing is controlled by the same clock so basically, the master has to write any data to read the same amount of data. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;During writing, the data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; are shifted out from the register, while the incoming data&amp;nbsp; are shifted in so you receive the value after the write is complete.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The slave device cannot do any sending on it's own, it's completely controlled by master's clock.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is example of the master code (from SPIMaster_LDD help, Typical Usage page):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp; MySPIPtr = SM1_Init(NULL); /* Initialization of SM1 component */&lt;/P&gt;&lt;P&gt;...&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); /* Start transmission/reception */&lt;/P&gt;&lt;P&gt;&amp;nbsp; while (!DataReceivedFlag) {}; // wait until the data are received&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Petr Hradsky&lt;/P&gt;&lt;P&gt;Processor Expert Support Team&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 14:58:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290286#M2082</guid>
      <dc:creator>Petr_H</dc:creator>
      <dc:date>2013-03-15T14:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Master Slave Query</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290287#M2083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Petr&lt;/P&gt;&lt;P&gt;I am having problem in communicating between two FRDM-K20D50M boards. I tried the code present in the help of the SPISLAVE_LDD and SPIMASTER_LDD but it didnt seem to work. then instead of 4digits I send 1 char again id didn't work. I have posted the query but still I didn't receive any helpful response Kindly look into the matter. The query is posted on the following link &lt;A _jive_internal="true" href="https://community.nxp.com/message/354381#354381"&gt;https://community.freescale.com/message/354381#354381&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Amit Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Oct 2013 03:03:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290287#M2083</guid>
      <dc:creator>Amit_Kumar1</dc:creator>
      <dc:date>2013-10-12T03:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Master Slave Query</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290288#M2084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I saw in the other thread that the problem has been in jumper on accelerometer pin. &lt;/P&gt;&lt;P&gt;So is the communication issue resolved now?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Petr Hradsky&lt;/P&gt;&lt;P&gt;Processor Expert Support Team&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 09:07:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290288#M2084</guid>
      <dc:creator>Petr_H</dc:creator>
      <dc:date>2013-10-25T09:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Master Slave Query</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290289#M2085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Petr&lt;/P&gt;&lt;P&gt;Yes the problem is resolved as you said, the problem was on the jumper J17 present on the FRDM board. after disconnecting the track there, the SPI Communication was fine. But sometimes the sequence of the character received is changed. i.e from one side I am sending "1234" and on receiving side I am getting "1324". I guess the problem may be in transfer rate i.e on clock adjustment of SPI. How fast the data can be transmitted when connected through 10cm long wires? without any disturbance ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit Kumar&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Oct 2013 02:36:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290289#M2085</guid>
      <dc:creator>Amit_Kumar1</dc:creator>
      <dc:date>2013-10-26T02:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Master Slave Query</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290290#M2086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not a SPI hardware expert and this is influenced by many things. But, I would say that realistic could be around 100kHz. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;You can improve this&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; by shielding (grouded at one end) and also by increasing the drive strength of the pins by decreasing pull-up values (if possible).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Petr Hradsky&lt;/P&gt;&lt;P&gt;Processor Expert Support Team&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 10:12:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/SPI-Master-Slave-Query/m-p/290290#M2086</guid>
      <dc:creator>Petr_H</dc:creator>
      <dc:date>2013-11-05T10:12:43Z</dc:date>
    </item>
  </channel>
</rss>

