<?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中的主题 DSPIx_POPR error</title>
    <link>https://community.nxp.com/t5/MPC5xxx/DSPIx-POPR-error/m-p/2019000#M27114</link>
    <description>&lt;P&gt;/* main.c: performs a single transfer from DSPI_C to DSPI_D on MPC555x*/&lt;BR /&gt;/* Rev 1.0 Sept 14 2004 S.Mihalik */&lt;BR /&gt;/* Rev 2.0 Jan 3 2007 S. Mihalik - Modified to use two SPIs */&lt;BR /&gt;/* Rev 2.1 July 20 2007 SM - Modified for MPC551x, changed sysclk (50 MHz) */&lt;BR /&gt;/* Rev 2.2 Aug 13 2007 SM - Modified for sysclk of 64 MHz &amp;amp; lenghened CSSCK, ASC*/&lt;BR /&gt;/* Rev 2.3 Jun 04 2008 SM - initSysclk changed for MPC5633M support */&lt;BR /&gt;/* Rev 2.4 Aug 15 2008 SM - removed lines for MPC551x, MPC563x */&lt;BR /&gt;/* Rev 2.5 Aug 18 2008 D McKenna- Kept DSPI_MCR[HALT] set during initialization*/&lt;BR /&gt;/* Copyright Freescale Semiconductor, Inc. 2007 All rights reserved. */&lt;BR /&gt;/* Notes: */&lt;BR /&gt;/* 1. MMU not initialized; must be done by debug scripts or BAM */&lt;BR /&gt;/* 2. SRAM not initialized; must be done by debug scripts or in a crt0 type file */&lt;/P&gt;&lt;P&gt;#include "mpc5554.h" /* Use proper include file like mpc5510.h or mpc5554.h */&lt;/P&gt;&lt;P&gt;vuint32_t i = 0; /* Dummy idle counter */&lt;BR /&gt;uint16_t RecDataMaster = 0; /* Data recieved on master SPI */&lt;BR /&gt;uint16_t RecDataSlave = 0; /* Data received on slave SPI */&lt;/P&gt;&lt;P&gt;void initSysclk (void) {&lt;BR /&gt;FMPLL.SYNCR.R = 0x16080000; /* 8 MHz xtal: 0x16080000; 40MHz: 0x46100000 */&lt;BR /&gt;while (FMPLL.SYNSR.B.LOCK != 1) {}; /* Wait for FMPLL to LOCK */&lt;BR /&gt;FMPLL.SYNCR.R = 0x16000000; /* 8 MHz xtal: 0x16000000; 40MHz: 0x46080000 */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void initDSPI_C(void) {&lt;BR /&gt;DSPI_C.MCR.R = 0x80010001; /* Configure DSPI_C as master */&lt;BR /&gt;DSPI_C.CTAR[0].R = 0x780A7727; /* Configure CTAR0 */&lt;BR /&gt;DSPI_C.MCR.B.HALT = 0x0; /* Exit HALT mode: go from STOPPED to RUNNING state*/&lt;BR /&gt;SIU.PCR[107].R = 0x0A00; /* MPC555x: Config pad as DSPI_C SOUT output */&lt;BR /&gt;SIU.PCR[108].R = 0x0900; /* MPC555x: Config pad as DSPI_C SIN input */&lt;BR /&gt;SIU.PCR[109].R = 0x0A00; /* MPC555x: Config pad as DSPI_C SCK output */&lt;BR /&gt;SIU.PCR[110].R = 0x0A00; /* MPC555x: Config pad as DSPI_C PCS0 output */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void initDSPI_D(void) {&lt;BR /&gt;DSPI_D.MCR.R = 0x00010001; /* Configure DSPI_D as slave */&lt;BR /&gt;DSPI_D.CTAR[0].R = 0x780A7727; /* Configure CTAR0 */&lt;BR /&gt;DSPI_D.MCR.B.HALT = 0x0; /* Exit HALT mode: go from STOPPED to RUNNING state*/&lt;BR /&gt;SIU.PCR[98].R = 0x0900; /* MPC555x: Config pad as DSPI_D SCK input */&lt;BR /&gt;SIU.PCR[99].R = 0x0900; /* MPC555x: Config pad as DSPI_D SIN input */&lt;BR /&gt;SIU.PCR[100].R = 0x0A00; /* MPC555x: Config pad as DSPI_D SOUT output*/&lt;BR /&gt;SIU.PCR[106].R = 0x0900; /* MPC555x: Config pad as DSPI_D PCS0/SS input */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void ReadDataDSPI_D(void) {&lt;BR /&gt;while (DSPI_D.SR.B.RFDF != 1){} /* Wait for Receive FIFO Drain Flag = 1 */&lt;BR /&gt;RecDataSlave = DSPI_D.POPR.R; /* Read data received by slave SPI */&lt;BR /&gt;DSPI_D.SR.R = 0x80020000; /* Clear TCF, RDRF flags by writing 1 to them */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void ReadDataDSPI_C(void) {&lt;BR /&gt;while (DSPI_C.SR.B.RFDF != 1){} /* Wait for Receive FIFO Drain Flag = 1 */&lt;BR /&gt;RecDataMaster = DSPI_C.POPR.R; /* Read data received by master SPI */&lt;BR /&gt;DSPI_C.SR.R = 0x90020000; /* Clear TCF, RDRF, EOQ flags by writing 1 */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;int main(void) {&lt;BR /&gt;SIU.DISR.R = 0x0000C0FC; /* MPC555x only: Connect DSPI_C, DSPI_D internally */&lt;BR /&gt;initSysclk(); /* Set sysclk = 64MHz running from PLL */&lt;BR /&gt;initDSPI_C(); /* Initialize DSPI_C as master SPI and init CTAR0 */&lt;BR /&gt;initDSPI_D(); /* Initialize DSPI_D as Slave SPI and init CTAR0 */&lt;BR /&gt;DSPI_D.PUSHR.R = 0x00001234; /* Initialize slave DSPI_D's response to master */&lt;BR /&gt;DSPI_C.PUSHR.R = 0x08015678; /* Transmit data from master to slave SPI with EOQ */&lt;BR /&gt;ReadDataDSPI_D(); /* Read data on slave DSPI */&lt;BR /&gt;ReadDataDSPI_C(); /* Read data on master DSPI */&lt;BR /&gt;while (1) {i++; } /* Wait forever */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1): Why is the value of RecDataMaster&amp;nbsp; not&amp;nbsp;DSPI_C.POPR.R ?&lt;/P&gt;&lt;P&gt;2):&amp;nbsp;Why doesn't this line of code work？&lt;/P&gt;&lt;P&gt;DSPI_D.SR.R = 0x80020000; /* Clear TCF, RDRF flags by writing 1 to them */&lt;/P&gt;&lt;P&gt;DSPI_C.SR.R = 0x90020000; /* Clear TCF, RDRF, EOQ flags by writing 1 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Dec 2024 08:27:22 GMT</pubDate>
    <dc:creator>shenrwszai</dc:creator>
    <dc:date>2024-12-24T08:27:22Z</dc:date>
    <item>
      <title>DSPIx_POPR error</title>
      <link>https://community.nxp.com/t5/MPC5xxx/DSPIx-POPR-error/m-p/2019000#M27114</link>
      <description>&lt;P&gt;/* main.c: performs a single transfer from DSPI_C to DSPI_D on MPC555x*/&lt;BR /&gt;/* Rev 1.0 Sept 14 2004 S.Mihalik */&lt;BR /&gt;/* Rev 2.0 Jan 3 2007 S. Mihalik - Modified to use two SPIs */&lt;BR /&gt;/* Rev 2.1 July 20 2007 SM - Modified for MPC551x, changed sysclk (50 MHz) */&lt;BR /&gt;/* Rev 2.2 Aug 13 2007 SM - Modified for sysclk of 64 MHz &amp;amp; lenghened CSSCK, ASC*/&lt;BR /&gt;/* Rev 2.3 Jun 04 2008 SM - initSysclk changed for MPC5633M support */&lt;BR /&gt;/* Rev 2.4 Aug 15 2008 SM - removed lines for MPC551x, MPC563x */&lt;BR /&gt;/* Rev 2.5 Aug 18 2008 D McKenna- Kept DSPI_MCR[HALT] set during initialization*/&lt;BR /&gt;/* Copyright Freescale Semiconductor, Inc. 2007 All rights reserved. */&lt;BR /&gt;/* Notes: */&lt;BR /&gt;/* 1. MMU not initialized; must be done by debug scripts or BAM */&lt;BR /&gt;/* 2. SRAM not initialized; must be done by debug scripts or in a crt0 type file */&lt;/P&gt;&lt;P&gt;#include "mpc5554.h" /* Use proper include file like mpc5510.h or mpc5554.h */&lt;/P&gt;&lt;P&gt;vuint32_t i = 0; /* Dummy idle counter */&lt;BR /&gt;uint16_t RecDataMaster = 0; /* Data recieved on master SPI */&lt;BR /&gt;uint16_t RecDataSlave = 0; /* Data received on slave SPI */&lt;/P&gt;&lt;P&gt;void initSysclk (void) {&lt;BR /&gt;FMPLL.SYNCR.R = 0x16080000; /* 8 MHz xtal: 0x16080000; 40MHz: 0x46100000 */&lt;BR /&gt;while (FMPLL.SYNSR.B.LOCK != 1) {}; /* Wait for FMPLL to LOCK */&lt;BR /&gt;FMPLL.SYNCR.R = 0x16000000; /* 8 MHz xtal: 0x16000000; 40MHz: 0x46080000 */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void initDSPI_C(void) {&lt;BR /&gt;DSPI_C.MCR.R = 0x80010001; /* Configure DSPI_C as master */&lt;BR /&gt;DSPI_C.CTAR[0].R = 0x780A7727; /* Configure CTAR0 */&lt;BR /&gt;DSPI_C.MCR.B.HALT = 0x0; /* Exit HALT mode: go from STOPPED to RUNNING state*/&lt;BR /&gt;SIU.PCR[107].R = 0x0A00; /* MPC555x: Config pad as DSPI_C SOUT output */&lt;BR /&gt;SIU.PCR[108].R = 0x0900; /* MPC555x: Config pad as DSPI_C SIN input */&lt;BR /&gt;SIU.PCR[109].R = 0x0A00; /* MPC555x: Config pad as DSPI_C SCK output */&lt;BR /&gt;SIU.PCR[110].R = 0x0A00; /* MPC555x: Config pad as DSPI_C PCS0 output */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void initDSPI_D(void) {&lt;BR /&gt;DSPI_D.MCR.R = 0x00010001; /* Configure DSPI_D as slave */&lt;BR /&gt;DSPI_D.CTAR[0].R = 0x780A7727; /* Configure CTAR0 */&lt;BR /&gt;DSPI_D.MCR.B.HALT = 0x0; /* Exit HALT mode: go from STOPPED to RUNNING state*/&lt;BR /&gt;SIU.PCR[98].R = 0x0900; /* MPC555x: Config pad as DSPI_D SCK input */&lt;BR /&gt;SIU.PCR[99].R = 0x0900; /* MPC555x: Config pad as DSPI_D SIN input */&lt;BR /&gt;SIU.PCR[100].R = 0x0A00; /* MPC555x: Config pad as DSPI_D SOUT output*/&lt;BR /&gt;SIU.PCR[106].R = 0x0900; /* MPC555x: Config pad as DSPI_D PCS0/SS input */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void ReadDataDSPI_D(void) {&lt;BR /&gt;while (DSPI_D.SR.B.RFDF != 1){} /* Wait for Receive FIFO Drain Flag = 1 */&lt;BR /&gt;RecDataSlave = DSPI_D.POPR.R; /* Read data received by slave SPI */&lt;BR /&gt;DSPI_D.SR.R = 0x80020000; /* Clear TCF, RDRF flags by writing 1 to them */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void ReadDataDSPI_C(void) {&lt;BR /&gt;while (DSPI_C.SR.B.RFDF != 1){} /* Wait for Receive FIFO Drain Flag = 1 */&lt;BR /&gt;RecDataMaster = DSPI_C.POPR.R; /* Read data received by master SPI */&lt;BR /&gt;DSPI_C.SR.R = 0x90020000; /* Clear TCF, RDRF, EOQ flags by writing 1 */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;int main(void) {&lt;BR /&gt;SIU.DISR.R = 0x0000C0FC; /* MPC555x only: Connect DSPI_C, DSPI_D internally */&lt;BR /&gt;initSysclk(); /* Set sysclk = 64MHz running from PLL */&lt;BR /&gt;initDSPI_C(); /* Initialize DSPI_C as master SPI and init CTAR0 */&lt;BR /&gt;initDSPI_D(); /* Initialize DSPI_D as Slave SPI and init CTAR0 */&lt;BR /&gt;DSPI_D.PUSHR.R = 0x00001234; /* Initialize slave DSPI_D's response to master */&lt;BR /&gt;DSPI_C.PUSHR.R = 0x08015678; /* Transmit data from master to slave SPI with EOQ */&lt;BR /&gt;ReadDataDSPI_D(); /* Read data on slave DSPI */&lt;BR /&gt;ReadDataDSPI_C(); /* Read data on master DSPI */&lt;BR /&gt;while (1) {i++; } /* Wait forever */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1): Why is the value of RecDataMaster&amp;nbsp; not&amp;nbsp;DSPI_C.POPR.R ?&lt;/P&gt;&lt;P&gt;2):&amp;nbsp;Why doesn't this line of code work？&lt;/P&gt;&lt;P&gt;DSPI_D.SR.R = 0x80020000; /* Clear TCF, RDRF flags by writing 1 to them */&lt;/P&gt;&lt;P&gt;DSPI_C.SR.R = 0x90020000; /* Clear TCF, RDRF, EOQ flags by writing 1 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2024 08:27:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/DSPIx-POPR-error/m-p/2019000#M27114</guid>
      <dc:creator>shenrwszai</dc:creator>
      <dc:date>2024-12-24T08:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: DSPIx_POPR error</title>
      <link>https://community.nxp.com/t5/MPC5xxx/DSPIx-POPR-error/m-p/2021103#M27117</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;could you be more specific for both points?&lt;BR /&gt;If DSPIs are interconnected then running this code you should see&amp;nbsp;&lt;BR /&gt;1)&amp;nbsp;&lt;SPAN&gt;RecDataMaster = 0x1234&lt;BR /&gt;2) respective flags cleared in SR registers&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BR, Petr&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 07:36:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/DSPIx-POPR-error/m-p/2021103#M27117</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2025-01-02T07:36:50Z</dc:date>
    </item>
  </channel>
</rss>

