<?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: Missing byte in SPI RX using KEAZ128, MC33664TL and MC33771 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Missing-byte-in-SPI-RX-using-KEAZ128-MC33664TL-and-MC33771/m-p/506081#M31748</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I increased the core clock frequency and it worked! :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="WIN.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/35461i28DF2C9D1A99A58F/image-size/large?v=v2&amp;amp;px=999" role="button" title="WIN.png" alt="WIN.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Apr 2016 18:10:50 GMT</pubDate>
    <dc:creator>joaofracarolli</dc:creator>
    <dc:date>2016-04-26T18:10:50Z</dc:date>
    <item>
      <title>Missing byte in SPI RX using KEAZ128, MC33664TL and MC33771</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Missing-byte-in-SPI-RX-using-KEAZ128-MC33664TL-and-MC33771/m-p/506079#M31746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I’m using the Kinetis KEAZ128 with the MC33664TL transceiver to communicate with a MC33771 battery cell controller.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The transceiver uses 2 SPI: one as a Master device (microcontroller to transceiver) and the other as a Slave device (transceiver to microcontroller). It transforms the information received via SPI into a format using a differential transformer pulse format, as stated in the datasheet:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="img1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/32246i605DEEECC79E8600/image-size/large?v=v2&amp;amp;px=999" role="button" title="img1.png" alt="img1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The diagram below shows the communication between the devices:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="img2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/32251iEF7F09854FAAE969/image-size/large?v=v2&amp;amp;px=999" role="button" title="img2.png" alt="img2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If a bit “1” is sent through SPI, it is translated into a positive phase sine pulse. If the bit is “0”, the pulse has negative phase:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="img3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/32323iB6E8E8ED196B099F/image-size/large?v=v2&amp;amp;px=999" role="button" title="img3.png" alt="img3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;These pulses are sent to the MC33771 via a twisted line pair. The messages from the MC33771 uses the same TPL to get to the transceiver, where they are converted to the SPI format and sent to the microcontroller.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;The following picture was taken using an oscilloscope measuring the SPI0 (slave) pins. Here, we can see the the data being transmitted and received from the MC33771. Because the command and the response share the same line, the command from SPI1 (master) is echoed to SPI0 (slave). The command and response frames have 40 bits each.&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="img4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/32395i81EC20C1028FA303/image-size/large?v=v2&amp;amp;px=999" role="button" title="img4.png" alt="img4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;I’m sending the command READ to the MC33771, asking to read a register called SYS_CFG2. This command is composed by the frame &lt;EM&gt;00 01 04 11 E8&lt;/EM&gt;, in hexadecimal.&lt;/P&gt;&lt;P style="text-align: justify;"&gt;According to the MC33771 datasheet, when sending this frame, it is expected to receive a response composed by the frame &lt;EM&gt;24 30 04 11 8F&lt;/EM&gt;. Looking closely, that is exactly what the device is sending to the microcontroller:&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="scope_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/32279iD27FDE2B8F03799A/image-size/large?v=v2&amp;amp;px=999" role="button" title="scope_5.png" alt="scope_5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;In my code, I’m using the processor expert generated functions to send and receive for both SPIs. The received frame is stored in a global variable called “response”, which is an array of 5 bytes (40 bits). I am using the onBlockReceived() interrupt to set a flag when 5 bytes are received by the microcontroller. I also defined a (primitive) timeout checking to avoid blocking my program when 5 bytes are not received. The chip_select() function is used to drive the CS pin to low state. I'll need more than one CS pin, so I use the "bank" parameter to choose which CS I will use.&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #7f0055;"&gt;int&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; &lt;STRONG&gt;mc33771_command&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #005032;"&gt;uint8&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; *cmd, &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #7f0055;"&gt;int&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; bank){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #005032;"&gt;LDD_TError&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; &lt;SPAN style="background: silver;"&gt;spierr&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clear_buffer();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; block_sent_flag = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; block_rcvd_flag = 0;&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; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chip_select(bank);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// Sending the command&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: yellow;"&gt;spierr&lt;/SPAN&gt; = SPIMaster_SendBlock(spi_tx, cmd, FRAMESIZE);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #7f0055;"&gt;while&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;(!SPIMaster_GetBlockSentStatus(spi_tx)){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPIMaster_Main(spi_tx);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// Monitoring the RX line ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: yellow;"&gt;spierr&lt;/SPAN&gt; = SPISlave_ReceiveBlock(spi_rx, response, RESPSIZE); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; chip_select(CLEAR);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;&lt;STRONG&gt;return&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;get_spi_response(5000);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #7f0055;"&gt;int&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; &lt;STRONG&gt;get_spi_response&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #005032;"&gt;uint16&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; timeout){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #005032;"&gt;uint16&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; timer = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// Waiting for reception to complete or the timeout&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #7f0055;"&gt;while&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;((!block_rcvd_flag) &amp;amp;&amp;amp; (timer &amp;lt; timeout) ){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delay_Waitus(10);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer += 10;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// Checking if a timeout occurred&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #7f0055;"&gt;if&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;(timer &amp;gt;= timeout){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPISlave_CancelBlockReception(spi_rx);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPIMaster_CancelBlockTransmission(spi_tx);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #7f0055;"&gt;return&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; SPI_TIMEOUT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;&lt;STRONG&gt;return&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; SPI_OK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, when I debug my program using Code Warrior, I see that the response variable is always missing the last byte, and the 4&lt;SUP&gt;th&lt;/SUP&gt; byte has a strange behaviour. Sometimes it has the expected value, and sometimes it assumes the value expected for the 5&lt;SUP&gt;th&lt;/SUP&gt; byte. The change in the value of the 4&lt;SUP&gt;th&lt;/SUP&gt; bytes seems to occur randomly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="img6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/32478i97A09973E460B6FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="img6.png" alt="img6.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;This behavior is not exclusive to the KEAZ128 controller. I used the KL25Z and had the same issue.&lt;/P&gt;&lt;P style="text-align: justify;"&gt;Does anyone have any idea what’s happening?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;Thanks! (Sorry for this very long text :smileyhappy:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2016 13:46:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Missing-byte-in-SPI-RX-using-KEAZ128-MC33664TL-and-MC33771/m-p/506079#M31746</guid>
      <dc:creator>joaofracarolli</dc:creator>
      <dc:date>2016-04-14T13:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Missing byte in SPI RX using KEAZ128, MC33664TL and MC33771</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Missing-byte-in-SPI-RX-using-KEAZ128-MC33664TL-and-MC33771/m-p/506080#M31747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Joao:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This behavior sounds like an overrun condition. See the next paragraph from the manual:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/34496i26CDD4E1F0A0E5F8/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is what is happening some things you can try to fix it are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Increase the KEA core clock frequency.&lt;/P&gt;&lt;P&gt;- Use a lower SPI baudrate.&lt;/P&gt;&lt;P&gt;- Use a higher optimization level from the compiler. In particular optimizing for speed would help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your scope shows that all bytes of the response are transferred, but maybe the MCU eventually loses 1 byte. Try adding a global variable in the interrupt routine to count how many times it is triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Jorge Gonzalez&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, 21 Apr 2016 23:06:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Missing-byte-in-SPI-RX-using-KEAZ128-MC33664TL-and-MC33771/m-p/506080#M31747</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2016-04-21T23:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Missing byte in SPI RX using KEAZ128, MC33664TL and MC33771</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Missing-byte-in-SPI-RX-using-KEAZ128-MC33664TL-and-MC33771/m-p/506081#M31748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I increased the core clock frequency and it worked! :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="WIN.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/35461i28DF2C9D1A99A58F/image-size/large?v=v2&amp;amp;px=999" role="button" title="WIN.png" alt="WIN.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 18:10:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Missing-byte-in-SPI-RX-using-KEAZ128-MC33664TL-and-MC33771/m-p/506081#M31748</guid>
      <dc:creator>joaofracarolli</dc:creator>
      <dc:date>2016-04-26T18:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Missing byte in SPI RX using KEAZ128, MC33664TL and MC33771</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Missing-byte-in-SPI-RX-using-KEAZ128-MC33664TL-and-MC33771/m-p/506082#M31749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #2e3033; background-color: #eef0f2; font-size: 12px;"&gt;Can you share some information or routines about MC33771 ? Thank you!!!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2017 10:04:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Missing-byte-in-SPI-RX-using-KEAZ128-MC33664TL-and-MC33771/m-p/506082#M31749</guid>
      <dc:creator>崔亚飞</dc:creator>
      <dc:date>2017-11-15T10:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Missing byte in SPI RX using KEAZ128, MC33664TL and MC33771</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Missing-byte-in-SPI-RX-using-KEAZ128-MC33664TL-and-MC33771/m-p/506083#M31750</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 am using MPC5748G and have exactly the same problem as the one describe in this question.&lt;/P&gt;&lt;P&gt;All the codes are generated using Processor Experts so I did not do any clock configuration. When I checked the clock interface, core clock is configured @ 160Mhz and SPI is using F40 which is fixed @ 40Mhz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- increasing core clock is no longer an option&lt;/P&gt;&lt;P&gt;- decreasing baud rate is also not an option since I need to complete the SPI communication at certain time and based on the test I have done so far, I can achieved it @ 20Mhz.&lt;/P&gt;&lt;P&gt;- I will try to see this if this can help me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other potential solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Nov 2017 18:23:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Missing-byte-in-SPI-RX-using-KEAZ128-MC33664TL-and-MC33771/m-p/506083#M31750</guid>
      <dc:creator>gracebaldonasa</dc:creator>
      <dc:date>2017-11-19T18:23:53Z</dc:date>
    </item>
  </channel>
</rss>

