Hi,
I took the example project "lpspi_transfer_s32k148" and made some modification to it:
What remain is clock and the pin and spi0 initialization.
Also I changed the size input of the MasterTransferBlocking from 1 to 5 and the PE is configured for 40bits for transfer size.
what happen is only the 1 byte of the 5 byte transmit buffer is transferred and the bus after transmitting this byte is pulled high for remaining of the cycle.
in contrast to this I tried transmitting 5 bytes by using the function 5 times and passing 1 for the size and it works OK.
Could someone explain this contrast between transferring 5 bytes (40 bits clock cycle) and one byte at a time using 5 (8bits clock)?
LPSPI_DRV_MasterTransferBlocking(SEND, &masterDataSend, &masterDataReceive,5, 0);
// LPSPI_DRV_MasterTransferBlocking(SEND, &masterDataSend[1], &masterDataReceive,1, TIMEOUT);
//LPSPI_DRV_MasterTransferBlocking(SEND, &masterDataSend[2], &masterDataReceive,1, TIMEOUT);
//LPSPI_DRV_MasterTransferBlocking(SEND, &masterDataSend[3], &masterDataReceive,1, TIMEOUT);
//LPSPI_DRV_MasterTransferBlocking(SEND, &masterDataSend[4], &masterDataReceive,1, TIMEOUT);
//FTM_DRV_UpdatePwmChannel(INST_FLEXTIMER_PWM1, 1U, FTM_PWM_UPDATE_IN_DUTY_CYCLE, masterDataReceive<<8, 0U, true);
Thanks,
Koorosh