Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE
Hi Team,
There's an issue from the customer need your help:
The following is the result of my debugging. In fact, the program flow is going quite smoothly. I will attach the complete version of my program first. What I attached to the above question is actually just the code of a sending and receiving process. , in fact my complete program requires several sending and receiving.
When I tested the first transmission and reception, the problem occurred that SPIDAT was always 0. When debugging the program, I ran to the SPI_TXbuff(cmd_loadkey,6) function. The function successfully progressed to the spi_xmit(Uint16 a) function and was about to send The data is sent to SPITXBUF, but unfortunately, the value in SPITXBUF does not appear in SPIDAT, and the value of SPIDAT always remains 0.
After using SPI_TXbuff(cmd_loadkey,6) to send an array data of length 6, the value of SPITXBUF is cmd_loadkey[6] = {0xAA,0xC3,0x00,0xA2,0x00,0x24} the last value of the array data 0x24 (worth Note that the parameter length required by spi_xmit (Uint16 a) is 16 bits, and the array elements I want to send are all 8-bit data, and the spi sending of dsp adopts MSB mode by default, so according to the suggestions of online information, The data is shifted left by 8 bits and forced type conversion is performed for sending (spi_xmit((Uint16)buff[i]<<8);), so the SPITXBUF data is displayed as 9216 (0x2400)). But the SPIDAT register is always 0. Of course, SPIRXBUF has no received return value and is always 0.
Following is the project:


Best Regards,
Ben








