Hi,
We have a requirement of using two DSPI modules one DSPI-1 as master and DSPI-2 as SLAVE to interface with MC33664. I am able to transmit the data through DSPI-1 and able to see data in RXFIFO but DSPI-2 Slave not receiving it even though if i do loopback.
Please check these configuration if any changes required and let me know DSPI2 slave configuration to receive data .
please find the following code:
Original Attachment has been moved to: main_Z4_0.c.zip
Hi,
Does the function Port_Init(&PortConfig) configure DSPI pins anyhow?
The rest of SIUL2 setting you have is almost all wrong.
Output pins must have ODC and SSS set, OERC set the drive strength, so should be set similarly for outputs.
Inputs requires setting the IBE and SSS = 0 for those pins that have “-“ in Pin table. For other values respective MSCR512-995 register have to set the SSS to given value. Also the ISL should be set for desired input logic for all inputs. Considering this the setting could be.
SIUL2.MSCR0_255[105].R = 0x2200000E; // PG9: DSPI_1 CS0
SIUL2.MSCR0_255[107].R = 0x00380000; // PG11:DSPI_1 SIN
SIUL2.MSCR0_255[108].R = 0x2200000D; // PG12:DSPI_1 SOUT
SIUL2.MSCR0_255[109].R = 0x2200000D; // PG13:DSPI_1 CLK
SIUL2.MSCR0_255[167].R = 0x00380000; // PK7: DSPI_2 CLK
SIUL2.MSCR0_255[168].R = 0x00380000; // PK8: DSPI_2 SIN
SIUL2.MSCR512_995[803-512].R = 0x0000001; // PK8: DSPI_2 SIN
SIUL2.MSCR0_255[170].R = 0x2200000D; // PK10: DSPI_2 SOUT
SIUL2.MSCR0_255[171].R = 0x00380000; // PK11: DSPI_2 SS
Finaly if the Master is using the CS0 output the proper bit in the MCR should be set to select inactive state to high.
DSPI_1.MCR.R = 0x80010001;
BR, Petr