SPC5studio generated code for spc560C50L3 SPI slave not working
- July 8, 2019
- 5 replies
- 1717 views
We are facing issue with SPI slave communication for spc560C50L3 controller.
The generated code for SPI slave from SPC5studio is not working.
We have written a register level code to transmit 1 byte and read 1 byte for SPI slave. The observations for the above controller is detailed below.
1. In fifo enabled mode the TxCNT increased when 4 bytes are pushed . We have pushed 'P' + Count++ as 4 bytes whereas count is zero initially.
2. After master provides read for 10 bytes the data received is only 'P' character for all 10 bytes read. The MCU is not pushing next character instead the same character is transmitted.
3. The TXCNT remains 4 for each byte transfer. The TXNXTPTR does not increment at all. It remains 1
4. The bytes 'PQRS' pushed in fifo can be read from TXFR register but after pushing the 4 byte it does not update with new byte.
5.The fifo does not get clear. It only transmits 1byte every time the master initaites a read request for 10 byte continuous read.
6.At master we only receive same character as 'P' for 10 bytes continueous read. It should be PQRSTUVWXY as per the logic.
Below is the complete code snippet written for spi slave. Please guide & suggest a solution if we are missing anything. Please share a working code as the generated code is not working.
PFA code and log for more details. Please refer.
Regards,
Ankit Channa
