martinkovar
Hi Martin,
1. As the code has been done for interrupt way of operation, but the xcptn_xmpl() function under HW_INIT() does not have configurations for MPC5777M.
2. As we are trying to just test only the DSPI basic working mechanism on our MPC5777M evaluation board, So we are trying a simple polling way of code,
Code is like:
int spi_main(void)
{
int counter = 0;
HW_Init(); //excluded xcptn_xmpl() function initialization.
SPI0_Init(); //configured as master
SPI1_Init(); //configured as slave
unsigned int cnt = 0; //Just to have count.
unsigned int buf = 0x0004; //16 bit value to be loaded to DSPI_0 transmit buffer.
unsigned int reached = 0;
for(cnt=0;cnt<5;cnt++)
{
DSPI_0.PUSHR.PUSHR.B.TXDATA = buf; //data is written to the register.
while(DSPI_1.SR.B.RFDF != 1); // checking for the DSPI_1 receive buffer full flag.
reached = 5;
RecDataMaster = DSPI_2.POPR.B.RXDATA; // Reading from the receive buffer.
buf++;
cnt++;
}
return 0;
}
3.As you have used CS0_0 and CS0_2, so no need to use SS_0 and SS_2?
4. As in the code, the master starts the operation while in initialization stage itself making HALT = 0x00; but is that enough or do we have to declare SS_0 pin low to start a data transfer? where it is not mentioned in the code.
5.could you please share any link or POLLING example code for SPI for MPC5777M or MPC5775k pls.