Other Parts Discussed in Thread: HALCOGEN,
Hi,
I am using the TMS570LS0432 SPI2 port as SPI slave. I would like to change the data frame format of the SPI receiver during runtime. I am using spiReceiveData(spiBASE_t *spi, spiDAT1_t *dataconfig_t, uint32 blocksize, uint16 * destbuff) function to receive the data. I have two data formats set in HALCoGen and are defined in the code as shown below
dataconfig1_t.CS_HOLD = FALSE;
dataconfig1_t.WDEL = FALSE;
dataconfig1_t.DFSEL = SPI_FMT_1;
dataconfig1_t.CSNR = SPI_CS_0;
dataconfig2_t.CS_HOLD = FALSE;
dataconfig2_t.WDEL = FALSE;
dataconfig2_t.DFSEL = SPI_FMT_0;
dataconfig2_t.CSNR = SPI_CS_0;
The only difference in the formats is the Char length. The SPI_FMT_0 has the Char length of 16 bits and SPI_FMT_1 has the Char length of 8 bits. I use dataconfig2_t by default and it works fine (i.e., 16 bits). If I change the char length and try to receive the data, I do not get all data. I miss last 2 bytes. (i.e., if I have to recevie I only receive 8 bytes) .
Is it possible for the SPI receiver to change the data format during runtime?
Thanks & best regards,
sreekanth challa