<?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>MPC5xxx中的主题 Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
    <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2049735#M27313</link>
    <description>&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz"&gt;&lt;SPAN class="ryNqvb"&gt;Hi,&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz"&gt;&lt;SPAN class="ryNqvb"&gt;Petr is currently on vacation.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;In my opinion, there is no need to clear the RXFIFO counter during operation and always having PUSH/POP pairs is the right approach.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;I would recommend checking the timing requirements of the SPI slave device in question to confirm that the settings match.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Feb 2025 08:44:50 GMT</pubDate>
    <dc:creator>davidtosenovjan</dc:creator>
    <dc:date>2025-02-24T08:44:50Z</dc:date>
    <item>
      <title>SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2032467#M27198</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hello,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have a few queries regarding the SPI read function implementation. I am attempting to communicate with a slave device (&lt;STRONG&gt;MCP2518FD CAN extender&lt;/STRONG&gt;) via SPI in &lt;STRONG&gt;polling mode&lt;/STRONG&gt; at &lt;STRONG&gt;16.5 MHz&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Issue:&lt;/STRONG&gt;&lt;BR /&gt;When reading the &lt;STRONG&gt;OSC register&lt;/STRONG&gt; from the slave, the expected data is &lt;STRONG&gt;0x60040000&lt;/STRONG&gt;. Upon probing with an oscilloscope, the data on the SPI bus is correct (&lt;STRONG&gt;0x60040000&lt;/STRONG&gt;). However, during the software read operation, the data observed in the debugger appears as &lt;STRONG&gt;0x00600400&lt;/STRONG&gt; instead of the expected &lt;STRONG&gt;0x60040000&lt;/STRONG&gt;. The first byte is always received as zero during the read operation.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Scope Data below is 0x60040000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CNarendra_0-1737560240815.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/320895iE0EFCB3278CD1163/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CNarendra_0-1737560240815.png" alt="CNarendra_0-1737560240815.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Debugger window of received data(0x00600400)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CNarendra_1-1737560325963.png" style="width: 491px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/320896i54432CD0C803124C/image-dimensions/491x162?v=v2" width="491" height="162" role="button" title="CNarendra_1-1737560325963.png" alt="CNarendra_1-1737560325963.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Modified Code:&lt;/STRONG&gt;&lt;BR /&gt;To address this, I modified the code to perform a &lt;STRONG&gt;dummy read&lt;/STRONG&gt; for flushing the RX FIFO immediately after writing the dummy data into the &lt;STRONG&gt;PUSH.R&lt;/STRONG&gt; register. This modification resolves the issue, and the read operation now works as intended. kindly check below one&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CNarendra_2-1737560370608.png" style="width: 443px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/320897i1884D055CBDE5F30/image-dimensions/443x201?v=v2" width="443" height="201" role="button" title="CNarendra_2-1737560370608.png" alt="CNarendra_2-1737560370608.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Additional Observations:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Interestingly, other slaves like &lt;STRONG&gt;FRAM&lt;/STRONG&gt; and &lt;STRONG&gt;FLASH&lt;/STRONG&gt; work fine without requiring the dummy read to flush the RX FIFO placement. After applying the dummy flush placement modification, these other slaves continue to work correctly without any issues, while the MCP2518FD slave now works as expected.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;BR /&gt;Is performing a dummy read to flush the RX FIFO immediately after writing dummy data into the &lt;STRONG&gt;PUSH.R&lt;/STRONG&gt; register the correct approach? Are there any alternative or recommended ways to handle this scenario?&lt;/P&gt;&lt;P&gt;Looking forward to your guidance.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Narendra C&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52961"&gt;@PetrS&lt;/a&gt; ,#MPC5674F ,#MPC5xxx&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 16:02:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2032467#M27198</guid>
      <dc:creator>CNarendra</dc:creator>
      <dc:date>2025-01-22T16:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2033189#M27204</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you can check SR register to know how many entries are in RX FIFO.&lt;BR /&gt;RXFIFO can flushed using MCR[CLR_RXF].&lt;BR /&gt;Also do not use&amp;nbsp;instantiation (.B) for flags clearing, to avoid other flags clearing too. Check chapter 3.2 of&amp;nbsp;&lt;A href="https://www.nxp.com/docs/en/engineering-bulletin/EB758.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/engineering-bulletin/EB758.pdf&lt;/A&gt;&amp;nbsp;for more info.&lt;/P&gt;
&lt;P&gt;BR, Petr&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 12:19:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2033189#M27204</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2025-01-23T12:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2049259#M27310</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52961"&gt;@PetrS&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I have observed that I am only able to see 1 RXFIFO in the &lt;STRONG&gt;SR.RXCTR flag&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I have attempted to flush the RXFIFO using the &lt;STRONG&gt;MCR[CLR_RXF]&lt;/STRONG&gt; bit and cleared the relevant flags as shown in the code below without instantiation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previously, I hadn’t checked below 16.5 MHz, but after doing so, I can confirm that the SPI read fails to work at frequencies below 16.5 MHz, even after performing the dummy read (for flushing) after the clock cycle and clearing the &lt;STRONG&gt;CLR_RXF&lt;/STRONG&gt; bit.&lt;/P&gt;&lt;P&gt;To provide more context, there is no issue when communicating with other slaves, such as FRAM or FLASH, across different frequencies. However, when communicating with the &lt;STRONG&gt;CAN Extender MCP2518FD&lt;/STRONG&gt;, the SPI read fails below &lt;STRONG&gt;16.5 MHz&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I would appreciate any insights or suggestions you might have on resolving this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/**
 *
 * &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/202329"&gt;@name&lt;/a&gt;        spi_read
 *
 * @brief       Reads a sequence of bytes from the SPI interface. The function
 *              supports both polling and interrupt modes. In polling mode, it
 *              waits for the read transfer to complete before returning
 *
 *
 * &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197964"&gt;@Param&lt;/a&gt;       p_spi_config - Pointer to the SPI configuration structure.
 * &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197964"&gt;@Param&lt;/a&gt;       p_rx_buffer - Buffer to store the received data.
 * &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197964"&gt;@Param&lt;/a&gt;       num_bytes - Number of bytes to read from the SPI interface.
 *
 * @return      spi_status_enum_t - Status of the SPI operation (eSPI_SUCCESS,
 *                                  eSPI_ERROR).
 *
 */

spi_status_enum_t spi_read(const spi_config_t *p_spi_config, uint8_t *p_rx_buffer,
                           uint16_t num_bytes)
{
    uint16_t pos = 0;
    uint8_t dummy;
    spi_status_enum_t status = eSPI_ERROR; // assign with error

    // Read if the SPI configuration, transmit buffer, and byte count are valid
    if ((NULL != p_spi_config) &amp;amp;&amp;amp; (NULL != p_rx_buffer) &amp;amp;&amp;amp; (num_bytes &amp;gt; 0))
    {
        // Clear any residual data in the rx fifo
       // dummy = SPI_READ_DATA(p_spi_config-&amp;gt;port);

        // Clear RFDF Receive FIFO Drain Flag
     //   SPI_CLEAR_RX_FIFO_DRAIN_FLAG(p_spi_config-&amp;gt;port);

        // polling mode
        if (p_spi_config-&amp;gt;mode == eSPI_POLLING_MODE)
        {
            status = eSPI_SUCCESS; // Assume success unless error occurs

            for (pos = 0; pos &amp;lt; num_bytes; pos++)
            {
               // write data for clock
               SPI_WRITE_DUMMY_DATA(p_spi_config-&amp;gt;port);

               // flush rx register ,CLR_RXF is 21st bit
               p_spi_config-&amp;gt;port-&amp;gt;MCR.R |= (1 &amp;lt;&amp;lt; (31 - 21));

              // wait for Receive FIFO Drain Flag.
              // The bit is set while the RX FIFO is not empty
              while(!(p_spi_config-&amp;gt;port-&amp;gt;SR.R &amp;amp; (1u &amp;lt;&amp;lt; (31 - 14))))
              {

              }
                // store into buffer
              p_rx_buffer[pos] = SPI_READ_DATA(p_spi_config-&amp;gt;port);

              // clear RFDF flag , RFDF is 14 th bit
             p_spi_config-&amp;gt;port-&amp;gt;SR.R |= (1u &amp;lt;&amp;lt; (31 - 14));

            }
        }
        else // interrupt mode
        {
            // Initialize the SPI reception
            spi_interrupt_buffer.p_rx_buffer = p_rx_buffer;
            spi_interrupt_buffer.rx_length = num_bytes;
            spi_interrupt_buffer.rx_pos = 0;
           // spi_interrupt_buffer.port = p_spi_config-&amp;gt;port;

            // send dummy message to invoke interrupt
            SPI_WRITE_DUMMY_DATA(p_spi_config-&amp;gt;port);
            dummy = SPI_READ_DATA(p_spi_config-&amp;gt;port);

            // Enable RX FIFO Drain Interrupt
            SPI_ENABLE_RX_FIFO_DRAIN_INT(p_spi_config-&amp;gt;port);
            status = eSPI_SUCCESS; // Interrupt mode assumed successful
        }
    }

    // returns spi communication status
    return status;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards&lt;BR /&gt;Narendra.C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 19:07:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2049259#M27310</guid>
      <dc:creator>CNarendra</dc:creator>
      <dc:date>2025-02-21T19:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2049735#M27313</link>
      <description>&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz"&gt;&lt;SPAN class="ryNqvb"&gt;Hi,&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz"&gt;&lt;SPAN class="ryNqvb"&gt;Petr is currently on vacation.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;In my opinion, there is no need to clear the RXFIFO counter during operation and always having PUSH/POP pairs is the right approach.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;I would recommend checking the timing requirements of the SPI slave device in question to confirm that the settings match.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 08:44:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2049735#M27313</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2025-02-24T08:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2049853#M27319</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52613"&gt;@davidtosenovjan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I check the Tcs2sck and Tsck2cs parameters, or are there other parameters I should consider in SPI timings? . Kindly look at attachment of&amp;nbsp; slave datasheet&amp;nbsp;&lt;A href="https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/External-CAN-FD-Controller-with-SPI-Interface-DS20006027B.pdf" target="_blank" rel="noopener"&gt;MCP2518FD DS.book&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SPI_Characterstics.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/325344i0EFD6E27130F753A/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI_Characterstics.png" alt="SPI_Characterstics.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SPI_Timing_Diagram.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/325343iB27E99728B50D322/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI_Timing_Diagram.png" alt="SPI_Timing_Diagram.png" /&gt;&lt;/span&gt;Thanks&lt;/P&gt;&lt;P&gt;Narendra C.&lt;BR /&gt;&lt;BR /&gt;&lt;LI-PRODUCT title="MPC5674F" id="MPC5674F"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;,#SPI&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 10:38:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2049853#M27319</guid>
      <dc:creator>CNarendra</dc:creator>
      <dc:date>2025-02-24T10:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2050747#M27324</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52613"&gt;@davidtosenovjan&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52961"&gt;@PetrS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We tried adding a delay between chip select and clock, but it didn't resolve the issue. Could you provide some inputs on this?&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Narendra.C&lt;/P&gt;&lt;P&gt;&lt;LI-PRODUCT title="MPC5674F" id="MPC5674F"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;,#SPI&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 10:34:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2050747#M27324</guid>
      <dc:creator>CNarendra</dc:creator>
      <dc:date>2025-02-25T10:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2051805#M27332</link>
      <description>&lt;P&gt;Have you measured all four lines of SPI communication i.e. MISO, MOSI, CLK and CS?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 13:40:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2051805#M27332</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2025-02-26T13:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2053163#M27341</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52613"&gt;@davidtosenovjan&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52961"&gt;@PetrS&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;We captured SPI signals at different frequencies and attempted to read various registers, including the &lt;STRONG&gt;32-bit OSC&lt;/STRONG&gt; and &lt;STRONG&gt;32-bit C1CON (0x000)&lt;/STRONG&gt; registers. We found the &lt;STRONG&gt;C1CON&lt;/STRONG&gt; register particularly useful for analysis, as all bytes have some values.&lt;/P&gt;&lt;P&gt;We have set a delay between frame-to-frame using the &lt;STRONG&gt;PDT&lt;/STRONG&gt; and &lt;STRONG&gt;DT&lt;/STRONG&gt; parameters. We observed a noticeable difference in the delay between frames at &lt;STRONG&gt;16.5 MHz&lt;/STRONG&gt;, &lt;STRONG&gt;8.5 MHz&lt;/STRONG&gt;, and &lt;STRONG&gt;11 MHz&lt;/STRONG&gt;. While the oscilloscope shows the data correctly, the software fails to capture the one byte.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Data Expected to Receive: -0x600798&lt;FONT color="#FF6600"&gt;&lt;U&gt;04&lt;/U&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data on SPI Bus&amp;nbsp; -0x600798&lt;FONT color="#FF6600"&gt;&lt;U&gt;04&lt;/U&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data received on Software below 16.5Mhz- 0x600798&lt;U&gt;&lt;FONT color="#FF6600"&gt;xy&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void spi_initialize(spi_config_t *spi_config)
{
    uint8_t i = 0;

    // todo: Need to Improve this function , this is very starting point

    // Configure GPIO pins
    // CLK set to Primary Function, Output and max slew rate
    SIU.PCR[spi_config-&amp;gt;bus_pins.sck].R = PCR_SCK;
    // MISO set to Primary Function, Input, and Weak Pullup
    SIU.PCR[spi_config-&amp;gt;bus_pins.miso].R = PCR_MISO;
    // MOSI set to Primary Function, Output, and Max Slew Rate
    SIU.PCR[spi_config-&amp;gt;bus_pins.mosi].R = PCR_MOSI;

    // set chip select enable
    for (i = 0; i &amp;lt; MAXIMUM_SLAVES; i++)
    {
        if (spi_config-&amp;gt;chip_select[i] != 0)
        {
            SIU.PCR[spi_config-&amp;gt;chip_select[i]].R = GPIO_PCR_WRITE;
            SIU.GPDO[spi_config-&amp;gt;chip_select[i]].B.PDO = eCS_HIGH;
        }
    }

    if (spi_config-&amp;gt;write_prot.has_wr_prot)
    {
        SIU.PCR[spi_config-&amp;gt;write_prot.wr_prot].R = GPIO_PCR_WRITE;
        SIU.GPDO[spi_config-&amp;gt;write_prot.wr_prot].B.PDO = eCS_LOW;
    }

    // Stop the DSPI interface
    spi_config-&amp;gt;port-&amp;gt;MCR.B.HALT = 1;

    // Configure DSPI interface
    spi_config-&amp;gt;port-&amp;gt;MCR.B.MSTR = 1;      // Master Mode
    spi_config-&amp;gt;port-&amp;gt;MCR.B.DIS_TXF = 1;   // No TX Queue
    spi_config-&amp;gt;port-&amp;gt;MCR.B.DIS_RXF = 1;   // No RX Queue
    spi_config-&amp;gt;port-&amp;gt;MCR.B.CONT_SCKE = 0; // No Continuous Clock
    spi_config-&amp;gt;port-&amp;gt;MCR.B.DCONF = 0;     // SPI
    spi_config-&amp;gt;port-&amp;gt;MCR.B.MTFE = 0;      // Modified Timing Disabled
    spi_config-&amp;gt;port-&amp;gt;MCR.B.PCSSE = 0;     // Unused
    spi_config-&amp;gt;port-&amp;gt;MCR.B.ROOE = 1;      // RX Overwrite
    spi_config-&amp;gt;port-&amp;gt;MCR.B.DOZE = 0;      // No Doze
    spi_config-&amp;gt;port-&amp;gt;MCR.B.SMPL_PT = 0;   // Sample Point

    // Configure CTAR0 (Clock and Transfer Attributes Register)
    spi_config-&amp;gt;port-&amp;gt;CTAR[0].B.DBR = 0;                          // No Baud Rate Doubling
    spi_config-&amp;gt;port-&amp;gt;CTAR[0].B.FMSZ = 7;                         // 8 Bit Frame
    spi_config-&amp;gt;port-&amp;gt;CTAR[0].B.CPHA = 0;                         // Capture on Rising Edge, SPI-0 Mode
    spi_config-&amp;gt;port-&amp;gt;CTAR[0].B.LSBFE = 0;                        // MSB First
    spi_config-&amp;gt;port-&amp;gt;CTAR[0].B.PCSSCK = 0;                       // PCS to SCK Delay Prescaler
    spi_config-&amp;gt;port-&amp;gt;CTAR[0].B.PASC = 0;                         // Last SCK to PCS delay Prescaler
    spi_config-&amp;gt;port-&amp;gt;CTAR[0].B.PDT = 1;                          // Frame to Frame Delay Prescaler
    spi_config-&amp;gt;port-&amp;gt;CTAR[0].B.PBR = 0;                          // Baud Rate Prescaler
    spi_config-&amp;gt;port-&amp;gt;CTAR[0].B.CSSCK = 0;                        // PCS to SCK Delay Scaler
    spi_config-&amp;gt;port-&amp;gt;CTAR[0].B.ASC = 0;                          // After SCK Delay Scaler
    spi_config-&amp;gt;port-&amp;gt;CTAR[0].B.DT = 1;                           // Frame to Frame Scaler
    spi_config-&amp;gt;port-&amp;gt;CTAR[0].B.BR = (uint8_t)(spi_config-&amp;gt;baud_rate_scale); // Baud Rate Scalerspi_config

    // Calculate and verify SCK based on:
    // SCK = (fPeriph / PBR) * (1 + DBR) * (1 / BR)
    //     = (132MHz /  2) *(1 + 0) *( 1 / config-&amp;gt;baud_rate_scale)
    // where fPeriph is the peripheral clock frequency, typically 132MHz as per absolosence board

    // Enable SPI
    spi_config-&amp;gt;port-&amp;gt;MCR.B.HALT = 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Command Sequence" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326079i93B0305F213AD817/image-size/large?v=v2&amp;amp;px=999" role="button" title="Command_Sequence.jpg" alt="Command Sequence" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Command Sequence&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="REG_C1CON(0x000)@8.5MHz" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326080i26080CC3802EEA92/image-size/large?v=v2&amp;amp;px=999" role="button" title="8.25MHz_REG_C1CON(0x000).jpg" alt="REG_C1CON(0x000)@8.5MHz" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;REG_C1CON(0x000)@8.5MHz&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="REG_C1CON(0x000)@10.5MHz" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326082i3F124DA75878CB02/image-size/large?v=v2&amp;amp;px=999" role="button" title="10.5MHz_REG_C1CON(0x000).jpg" alt="REG_C1CON(0x000)@10.5MHz" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;REG_C1CON(0x000)@10.5MHz&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="REG_C1CON(0x000)@16.5MHz" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326083iDAB39ECEFCDCBB00/image-size/large?v=v2&amp;amp;px=999" role="button" title="16.5MHz_REG_C1CON(0x000).jpg" alt="REG_C1CON(0x000)@16.5MHz" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;REG_C1CON(0x000)@16.5MHz&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Debug_Console@8.5Mhz" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326081i97D2D096E5E42077/image-size/large?v=v2&amp;amp;px=999" role="button" title="Debug_console_8.25MHz_REG_C1CON(0x000).png" alt="Debug_Console@8.5Mhz" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Debug_Console@8.5Mhz&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Debug_Console@16.5Mhz" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326084i5EFF3AB77243CFB5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Debug_Console_16.5MHz_REG_OSC(0xE00).png" alt="Debug_Console@16.5Mhz" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Debug_Console@16.5Mhz&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;: Other slaves, such as &lt;STRONG&gt;FRAM&lt;/STRONG&gt; and &lt;STRONG&gt;Flash&lt;/STRONG&gt;, are working fine in all frequencies&lt;/P&gt;&lt;P&gt;Kindly refer to the images below, along with the debug console outputs, for further inputs.&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;Narendra&lt;/P&gt;&lt;P&gt;&lt;LI-PRODUCT title="MPC5674F" id="MPC5674F"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 17:23:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2053163#M27341</guid>
      <dc:creator>CNarendra</dc:creator>
      <dc:date>2025-02-27T17:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2053445#M27343</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52613"&gt;@davidtosenovjan&lt;/a&gt;,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have continued debugging the issue and have been examining the &lt;STRONG&gt;DSPI Receive FIFO Registers (DSPI_x.RXFR[0].R)&lt;/STRONG&gt; to track message entries in the RX FIFO. We can see all data correctly in both &lt;STRONG&gt;POPR.R&lt;/STRONG&gt; and &lt;STRONG&gt;DSPI_x.RXFR[0].R&lt;/STRONG&gt;. However, it appears that one byte—either the first or the last—is being &lt;STRONG&gt;overwritten in the buffer&lt;/STRONG&gt;, which is causing the issue.&lt;/P&gt;&lt;P&gt;I am currently investigating the root cause, and I am uncertain whether this is due to &lt;STRONG&gt;compiler optimization or timing constraints from the SPI slave device&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Kindly refer to the attached files for further details.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Buffer_Overwritten" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326175iF12310FCD01ED6E8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Not_Working_Scenerio.png" alt="Buffer_Overwritten" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Buffer_Overwritten&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Working one" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326176iA75DAF8975E2C985/image-size/large?v=v2&amp;amp;px=999" role="button" title="Working_Scenerio.png" alt="Working one" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Working one&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Narendra .C&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 04:18:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2053445#M27343</guid>
      <dc:creator>CNarendra</dc:creator>
      <dc:date>2025-02-28T04:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2053571#M27346</link>
      <description>&lt;P&gt;Hi&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52613" target="_blank" rel="noopener"&gt;@davidtosenovjan&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;1. As part of debugging ,I added a random delay after the dummy write (for clocking), and now the read operation works correctly.&lt;/P&gt;&lt;PRE&gt;spi_status_enum_t spi_read(const spi_config_t *spi_config, volatile uint8_t *rx_buffer, uint32_t num_bytes)
{

    uint16_t pos = 0;
    uint16_t dummy;
    spi_status_enum_t spi_status = eSPI_SUCCESS;

    dummy = (uint8_t)(spi_config-&amp;gt;port-&amp;gt;POPR.R);

    spi_config-&amp;gt;port-&amp;gt;SR.B.RFDF = 1;

    if (spi_config-&amp;gt;mode == eSPI_POLLING_MODE)
    {
        for (pos = 0; pos &amp;lt; num_bytes; pos++)
        {

            // write data for clock
            spi_config-&amp;gt;port-&amp;gt;PUSHR.R = 0x00;

            // we are adding delay 
            delay2();

           // first byte always read as 0xff . we are bypassing here
            dummy = (uint8_t)(spi_config-&amp;gt;port-&amp;gt;POPR.R);

            // wait for data
            while (spi_config-&amp;gt;port-&amp;gt;SR.B.RFDF == 0)
            {

            }

            rx_buffer[pos] = (uint8_t)(spi_config-&amp;gt;port-&amp;gt;POPR.R);

            spi_config-&amp;gt;port-&amp;gt;SR.B.RFDF = 1;

        }
    }

    return spi_status;
}


void delay2()
{
   uint64_t i = 0;
   for(i = 0 ; i &amp;lt; 100 ;i++)
   {
   }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. However, as I mentioned earlier, if I comment out the following line:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;dummy = (&lt;SPAN class=""&gt;uint8_t&lt;/SPAN&gt;)(spi_config-&amp;gt;port-&amp;gt;POPR.R);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;the first byte always reads as 0xFF.&lt;/P&gt;&lt;P&gt;We are reading this 0xFF into dummy as a bypass, but the first byte consistently comes as 0xFF across all frequencies.&lt;/P&gt;&lt;P&gt;Kindly help us in giving inputs .This is critical one&lt;BR /&gt;&lt;BR /&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Narendra .C&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 07:27:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2053571#M27346</guid>
      <dc:creator>CNarendra</dc:creator>
      <dc:date>2025-02-28T07:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2053800#M27350</link>
      <description>&lt;P&gt;Probably the problem is that you are doing pop operation too early after push operation. Due to that probably RxFIFO underflow happens.&lt;/P&gt;
&lt;P&gt;Looking to my example code I did in the past with using of polling method I always did it this way:&lt;/P&gt;
&lt;P&gt;PUSH&lt;BR /&gt;WAIT_UNTIL_RxFIFO_IS_NOT_EMPTY;&lt;BR /&gt;POP&lt;/P&gt;
&lt;P&gt;where following macro is defined&lt;BR /&gt;#define WAIT_UNTIL_RxFIFO_IS_NOT_EMPTY while (!(DSPI_B.SR.B.RFDF)) {}&lt;/P&gt;
&lt;P&gt;Example code you may donwload here:&lt;BR /&gt;&lt;A href="https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5676R-DSPI-ext-SPI-memory-S25FL129P-CW210/ta-p/1104839" target="_blank"&gt;https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5676R-DSPI-ext-SPI-memory-S25FL129P-CW210/ta-p/1104839&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Mentioned SPI code snippets in dspi_S25FL129.c and .h&lt;/P&gt;
&lt;P&gt;Hope it helps&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 13:07:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2053800#M27350</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2025-02-28T13:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2054185#M27355</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52613"&gt;@davidtosenovjan&lt;/a&gt;&amp;nbsp;, &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52961"&gt;@PetrS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have implemented the suggested changes, but the issue still persists. I also used SPI_Popr_Read_Fix for analysis. The first byte received is either 0xFF or 0x00, even though the correct data is visible in the RXFIFO (debug register DSPI_A.RXFR[0].R).&lt;/P&gt;&lt;P&gt;The first byte in the RX FIFO is not getting updated in DSPI_A.POPR.R (shift register). I have attached a debug screenshot for reference. While using a delay and dummy read has served as a temporary workaround, we need a permanent solution.&lt;/P&gt;&lt;P&gt;Kindly assist us in identifying the root cause and providing a reliable fix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define PPC_NOP(x)   {uint8_t n = x; do{ PPCASM(" e_nop"); } while(n--);}

#define SPI_DUMMY_READ_DATA()              ((uint8_t)DSPI_A.POPR.R)

#define SPI_WRITE_DUMMY_DATA()              (DSPI_A.PUSHR.R = 0x00)

#define SPI_TRANSMIT(data)            \
    do {                              \
        DSPI_A.SR.B.TCF = 1;          \
        DSPI_A.PUSHR.R = (uint32_t)((uint8_t)(data) &amp;amp; 0xFF);  \
        while (DSPI_A.SR.B.TCF == 0); \
    } while (0)

#define SPI_RECEIVE(buffer)           \
    do {                              \
        while (DSPI_A.SR.B.RFDF == 0); \
        buffer = (uint8_t)(DSPI_A.POPR.R); \
        DSPI_A.SR.B.RFDF = 1;          \
    } while (0)


// by default we are reading only 4 byte register 
void MCP2518_Read_Data(CAN_DEV_LIST_t selectedDevice, uint8_t cmd, uint16_t address, uint8_t *p_rxbuffer, uint8_t length)
{
	uint8_t i = 0;
	uint16_t data = 0;
	uint8_t spi_tx_cmd[2] = {0};

	if(!p_rxbuffer)
	{
		 return eSPI_ERROR;
	}

	data = ( ((cmd) &amp;lt;&amp;lt; 12) | ((address) &amp;amp; 0xFFF) );
	// pack command and address
	spi_tx_cmd[0] = ((data &amp;gt;&amp;gt; &lt;LI-EMOJI id="lia_smiling-face-with-sunglasses" title=":smiling_face_with_sunglasses:"&gt;&lt;/LI-EMOJI&gt; &amp;amp; 0xFF);
	spi_tx_cmd[1] = data;

	  // chip select LOW
	MCP2518_Device_Select[selectedDevice]();

    // send command
    SPI_TRANSMIT(spi_tx_cmd[0]);

    // send Register Address
    SPI_TRANSMIT(spi_tx_cmd[1]);
    
    //1st byte
    SPI_WRITE_DUMMY_DATA();
    if(SPI_Popr_Read_Fix)
    {
         // adding delay for fix
	   PPC_NOP(1)
        // we are always receiving first byte as 0xff or 0x00 even we see 
        // correct data in RXFIFO(debug register DSPI_A.RXFR[0].R)
        // but DSPI_A.POPR.R shift register value is 0x00 or 0xff
        // here we are reading dummy
	   SPI_DUMMY_READ_DATA();
    }
    SPI_RECEIVE(p_rxbuffer[0]);


    // 2nd byte
    SPI_WRITE_DUMMY_DATA();
    SPI_RECEIVE(p_rxbuffer[1]);


    // 3rd byte
    SPI_WRITE_DUMMY_DATA();
    SPI_RECEIVE(p_rxbuffer[2]);


    // 4 th byte
    SPI_WRITE_DUMMY_DATA();
    SPI_RECEIVE(p_rxbuffer[3]);


    // chip select High
    MCP2518_Device_Deselect[selectedDevice]();

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Spi read issue" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326358i4CD987A815E35F81/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI_Read_Malfunction.png" alt="Spi read issue" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Spi read issue&lt;/span&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="First Byte in POPR.R(shift register) is not getting updated from RXFIFO" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326360i8BF23818B3CDF64B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Shift_Register_is _not_getting_1st_byte_from_FIFO.png" alt="First Byte in POPR.R(shift register) is not getting updated from RXFIFO" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;First Byte in POPR.R(shift register) is not getting updated from RXFIFO&lt;/span&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Spi Read Working" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326361iA0CCAB44FB50653B/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI_Read_Working.png" alt="Spi Read Working" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Spi Read Working&lt;/span&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;P&gt;Narendra.C&lt;/P&gt;&lt;P&gt;&lt;LI-PRODUCT title="MPC5674F" id="MPC5674F"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Mar 2025 12:48:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2054185#M27355</guid>
      <dc:creator>CNarendra</dc:creator>
      <dc:date>2025-03-02T12:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2054583#M27356</link>
      <description>&lt;DIV id="tinyMceEditordavidtosenovjan_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;Don't use .B instance. Petr already mentioned it in the very first response (EB758). It is very important.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 589px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326465iFB1A7B4A81CF04D7/image-dimensions/589x347?v=v2" width="589" height="347" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 09:09:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2054583#M27356</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2025-03-03T09:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2054596#M27357</link>
      <description>&lt;P&gt;Check status register whether you see overflow/underflow and also check whether you have enabled FIFOs.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 09:32:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2054596#M27357</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2025-03-03T09:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Issue on MPC5674F: Incorrect Data Received from MCP2518FD CAN Extender</title>
      <link>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2102302#M27623</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Issue got resolved after enabling FIFO(s) in DSPI&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; regards&lt;BR /&gt;Narendra.C&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 04:14:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/SPI-Read-Issue-on-MPC5674F-Incorrect-Data-Received-from/m-p/2102302#M27623</guid>
      <dc:creator>CNarendra</dc:creator>
      <dc:date>2025-05-22T04:14:15Z</dc:date>
    </item>
  </channel>
</rss>

