I have a problem that has troubled me for a long time. I used S32DS to generate SPI code. But I found that MISO and MOSI have no signals, but SCK and CS have signals, I think my SPI configuration should be no problem, maybe there is a problem with data assignment. So I went to the TDR register but... I found that there was no value in the register, but I was clearly calling the assignment statement. In addition, when debugging step by step, you can see that the TDR registers have been assigned.
just like that..i just want to send 0x55..
Below is my project, I hope you can help me.
The Transmit Data Register is a write-only register.
Do you want to use Continuous Transfer?
Please check the PCR[MUX] of the ports with the debugger.
Thank you for your answer. Actually, I don't quite understand what "Continuous Transfer" is, but if I assign this value to false, MISO and MOSI still have no signal. Then I checked the corresponding pin of S32DS and found that he was wrong, so I changed the pin again and finally saw the waveform on the corresponding pin of S32DS.
I still have a few questions that I hope you can answer.
1. Why is the pin corresponding to LPSPI0 routed to LPSPI1 in the S32DS (this is where my program had problems before)
2. PCR [MUX], we can only know two of these functions, but there are five other chip-specific. What does that mean?
During a continuous transfer the CS is kept asserted between frames.
Which LPSPI0 pin do you mean?
The alternative functions of the ports are listed in the S32K142_IO_Signal_Description_Input_Multiplexing.xlsx
that is attached to the RM.
Hello, thank you for your help.
Now I can operate on the SPI. I found that the generated code of the IDE may be initialized to other interfaces caused by LPSPI0. Thank you again for your answer.You are such a good person.(*^_^*)