<?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 Re: Checking SPI Transmit and receive in KEA-128 using TRK-KEA128 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Checking-SPI-Transmit-and-receive-in-KEA-128-using-TRK-KEA128/m-p/637925#M38513</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I understood the connections, what I wanted to know here is Whether the code that I have attached for SPI_Transmit and SPI_receive are they right????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you cross check them and say me ????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Dec 2016 08:13:48 GMT</pubDate>
    <dc:creator>vigneshbalaji</dc:creator>
    <dc:date>2016-12-27T08:13:48Z</dc:date>
    <item>
      <title>Checking SPI Transmit and receive in KEA-128 using TRK-KEA128</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Checking-SPI-Transmit-and-receive-in-KEA-128-using-TRK-KEA128/m-p/637923#M38511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Hi,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp; &amp;nbsp; I am checking SPI Transmit and receive using 2 KEA-128 Development Board.I am using one TRK-KEA128 board for transmit and another TRK-KEA-128 Board for receive. I am not able to get it right. I have attached the code for both SPI Transmit and receive Below.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I am using Port E for both connections are&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Master &amp;nbsp; Slave&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;PTE0 -&amp;gt; PTE0 (SPI_SCK -&amp;gt; SPI_SCK)&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;PTE1 -&amp;gt; PTE2 (MOSI -&amp;gt; MISO)&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;PTE3 -&amp;gt; PTE3 (SS -&amp;gt; SS)&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I have made only these connections, is it enough or do i need to do more connections?&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I am not able to receive any data.I am seeing it on debug mode in spi_d global variable for the receive code to validate this.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Can you tell me what things I have to change to make SPI Transmit and receive work???&amp;nbsp;&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-337685"&gt;SPI_Master_Transmit.zip&lt;/A&gt;&lt;/STRONG&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-337685"&gt;SPI_slave_KEA_128.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2016 12:54:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Checking-SPI-Transmit-and-receive-in-KEA-128-using-TRK-KEA128/m-p/637923#M38511</guid>
      <dc:creator>vigneshbalaji</dc:creator>
      <dc:date>2016-12-23T12:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Checking SPI Transmit and receive in KEA-128 using TRK-KEA128</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Checking-SPI-Transmit-and-receive-in-KEA-128-using-TRK-KEA128/m-p/637924#M38512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi VIGNESH BALAJI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. About the sample code&lt;/P&gt;&lt;P&gt;&amp;nbsp;Please refer to your another post, I already give you the SPI sample code:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/441456"&gt;SPI slave KEA-128&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please refer to the official code, and check your own code.&lt;/P&gt;&lt;P&gt;2. SPI connection&lt;/P&gt;&lt;P&gt;&amp;nbsp; Your connection is wrong.&lt;/P&gt;&lt;P&gt;Master&amp;nbsp;&amp;nbsp; slave&lt;/P&gt;&lt;P&gt;MISO&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MISO&lt;/P&gt;&lt;P&gt;MOSI&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MOSI&lt;/P&gt;&lt;P&gt;SS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SS&lt;/P&gt;&lt;P&gt;CLK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLK&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2588i2DDA7F5B048AC382/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can't connect the MOSI in master to slave MISO,&amp;nbsp; you should connect MOSI in master to the MOSI in slave.&lt;/P&gt;&lt;P&gt;This is very important.&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Dec 2016 05:32:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Checking-SPI-Transmit-and-receive-in-KEA-128-using-TRK-KEA128/m-p/637924#M38512</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-12-26T05:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Checking SPI Transmit and receive in KEA-128 using TRK-KEA128</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Checking-SPI-Transmit-and-receive-in-KEA-128-using-TRK-KEA128/m-p/637925#M38513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I understood the connections, what I wanted to know here is Whether the code that I have attached for SPI_Transmit and SPI_receive are they right????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you cross check them and say me ????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2016 08:13:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Checking-SPI-Transmit-and-receive-in-KEA-128-using-TRK-KEA128/m-p/637925#M38513</guid>
      <dc:creator>vigneshbalaji</dc:creator>
      <dc:date>2016-12-27T08:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Checking SPI Transmit and receive in KEA-128 using TRK-KEA128</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Checking-SPI-Transmit-and-receive-in-KEA-128-using-TRK-KEA128/m-p/637926#M38514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi VIGNESH BALAJI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Your code have some errors.&lt;/P&gt;&lt;P&gt;Master:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; select the SSEL as the SPI select pin instead of just GPIO.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SPI0_C1 |= SPI_C1_SSOE_MASK;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; SPI0_C2 |= SPI_C2_MODFEN_MASK;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. enable the PTE0, PTE1,PTE2,PTE3 pull up for working stable.&lt;/P&gt;&lt;P&gt;PORT_PUE1 |= PORT_PUE1_PTEPE0_MASK | PORT_PUE1_PTEPE1_MASK|PORT_PUE1_PTEPE2_MASK|PORT_PUE1_PTEPE3_MASK;&lt;/P&gt;&lt;P&gt;3. After enter main file, add a small delay for the power on stable.&lt;/P&gt;&lt;P&gt;int main(void){&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;unsigned int i,j;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Clk_Init();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SPI_init();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i=0;i&amp;lt;100;i++) for(j=0;j&amp;lt;65535;j++); // delay, wait for the system stable&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(;;) {&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI_write(0x21);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t spi_d = SPI_read();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Slave:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; select the SSEL as the SPI select pin instead of just GPIO.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SPI0_C1 &amp;amp;= ~SPI_C1_SSOE_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; SPI0_C2 |= SPI_C2_MODFEN_MASK;&lt;/P&gt;&lt;P&gt;2. enable the PTE0, PTE1,PTE2,PTE3 pull up for working stable.&lt;/P&gt;&lt;P&gt;PORT_PUE1 |= PORT_PUE1_PTEPE0_MASK | PORT_PUE1_PTEPE1_MASK|PORT_PUE1_PTEPE2_MASK|PORT_PUE1_PTEPE3_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then after connect two KEA128 together, it will work fine.&lt;/P&gt;&lt;P&gt;I have test your code on my TRK KEA128 board, it works ok.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/3690i7490DEC64078AB8C/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_6.png" alt="pastedImage_6.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Slave debug result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_7.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/3721iB034901993788BD0/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_7.png" alt="pastedImage_7.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Slave can receive the correct data 0x21 from master.&lt;/P&gt;&lt;P&gt;Logic analyzer wave:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_8.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/3759iCA68ECE4C3CF04A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_8.png" alt="pastedImage_8.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also attached my modified project for your reference.&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2016 06:49:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Checking-SPI-Transmit-and-receive-in-KEA-128-using-TRK-KEA128/m-p/637926#M38514</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-12-29T06:49:27Z</dc:date>
    </item>
  </channel>
</rss>

