Other Parts Discussed in Thread: TMS570LS20216, HALCOGEN
hello,experts:
I'm using TMS570LS20216 to control a SPI device,i use the multi-buffered SPI mode,and this is my SPI5 HALCoGen configuration(Baudrate:50KHz,Charlen:8):
and the following picture is my SPI device data frame specification:
when i read the SPI device data reference the SPI Example code like this:
spiSetData(spiREG5, 0, m_data_out);
spiTransfer(spiREG5, 0);
while(!(spiIsTransferComplete(spiREG5, 0))){};
//sysDelay_us(700);
spiGetData(spi, 0, m_data_in);
the data read from the SPI device is not correct(CRC error),but when add the time delay(sysDelay_us(700)),the read data from the SPI device is correct(CRC passed).So, i check the spiIsTransferComplete() API function,it define like this:
int spiIsTransferComplete(spiBASE_t *spi, unsigned group)
{
return (spi->INTFLGRDY >> group) & 1;
}
It check the INTFLGRDY flag which descritpion is : "Transfer-group interrupt flag for a transfer-completed interrupt."
So, is the "transfer-completed" means all datas in the buffer has shifted out from the RX shift register?If not, how to config the register in HallCoGen and wich bit shoud i check to ensure my SPI data frame(3 bytes) has shifted out from the RX shift register so i can read the D0~D7 + CRC correct?
Thank you very much.