Hello, everyone.
Recently i work on a project about communication between MPC5643L and TLE6204. And there is a problem that I set DSPI_2 as a master and just want to send a 16 bits data with 16 bit command.
after i operate following command:
DSPI_2.PUSHR.R = 0X08010000 | SendData16bit;
then i stay in while loop waiting for the TCF flag bit set.
while(DSPI_2.SR.B.TCF != 1)
{}
It will stay in wihile forever, according to the datasheet after sending a frame TCF will be set. But i don't get the right result.
Here is my whole project in attachment, hope someone kindly help me. Thank you!
Original Attachment has been moved to: vcu_5in1.zip
Solved! Go to Solution.
Before sending you are doing this:
DSPI_2.SR.B.EOQF = 0;
1) Flags are being cleared by 1.
2) .B instance should not be used at all because it would clear all flag set in the register. See following document, section 3.2:
http://www.nxp.com/files/32bit/doc/eng_bulletin/EB758.pdf
The correct solution is as follows:
#define DSPI_SR_EOQF (0x10000000)
DSPI_2.SR..R = DSPI_SR_EOQF;
Let me know whether it is was the issue.
Before sending you are doing this:
DSPI_2.SR.B.EOQF = 0;
1) Flags are being cleared by 1.
2) .B instance should not be used at all because it would clear all flag set in the register. See following document, section 3.2:
http://www.nxp.com/files/32bit/doc/eng_bulletin/EB758.pdf
The correct solution is as follows:
#define DSPI_SR_EOQF (0x10000000)
DSPI_2.SR..R = DSPI_SR_EOQF;
Let me know whether it is was the issue.
In the morning I test again get following conclusion:
1) As I set DPSI2 module as the project when run the chip the SCLK pin has no clock signal
2) I config A[1] pin as DPSI sout, but when the chip run, this pin will be pull to high woltage 3.3V
I think the DSPI module doesn't work so my config to DSPI2 is something wrong.
You have disabled DSPI module - pay attention to DSPI_MCR[MDIS] bit.
Thank you!!!!
Hello, happy Chinese Spring Festaval. Sorry for checking your advise late.
I just try by
#define DSPI_SR_EOQF (0x10000000)
DSPI_2.SR..R = DSPI_SR_EOQF;
but it still run in
while(DSPI_2.SR.B.TCF != 1)
waiting.
I am dault that why the TCF can not set, and i use scope to detect the SCK pin. The clock signal can be detect.
ok, I will take your advise and check the result. Thank you very much for your kindly help.