Thanks Rocco and Mac!
The issue was solved. As Rocco said, the problem is in initialize, CPHA bit in register SPICR1 should be cleared in init. Also my Reference Voltage in Max5250 is wrong, it should be VDD-1.4V, but I used VDD.
I have another question want to ask is that if I want to change the Max5250 DAC output A & B in the same time. How it should do?
I wrote the following code:
PTS &= ~PTS3_msk; //clear pin3 of port S to select SPI for MAX5250
// DAC A
SPI_Data_HIGH_Tmp = (unsigned char)(0x30 + ((Current1_uc &0xF0) >>4));
SPI_Data_LOW_Tmp = (unsigned char)((Current1_uc &0x3F) <<4);
SPI0DR = SPI_Data_HIGH_Tmp; // send the High byte data of SPI Data
while(!(SPI0SR &SPTEF0_msk)); //wait till data transfer finish
while(!(SPI0SR &SPIF0_msk ));
SPI_Data_HIGH_Tmp = SPI0DR;
SPI0DR = SPI_Data_LOW_Tmp; // send the Low byte data of SPI Data
while(!(SPI0SR &SPTEF0_msk )); //wait till data transfer finish
while(!(SPI0SR &SPIF0_msk )); SPI_Data_LOW_Tmp = SPI0DR;
// DAC B
SPI_Data_HIGH_Tmp = (unsigned char)(0x70 + ((Current2_uc &0xF0) >>4));
SPI_Data_LOW_Tmp = (unsigned char)((Current2_uc &0x3F) <<4);
SPI0DR = SPI_Data_HIGH_Tmp; // send the High byte data of SPI Data
while(!(SPI0SR &SPTEF0_msk)); //wait till data transfer finish
while(!(SPI0SR &SPIF0_msk ));
SPI_Data_HIGH_Tmp = SPI0DR;
SPI0DR = SPI_Data_LOW_Tmp; // send the Low byte data of SPI Data
while(!(SPI0SR &SPTEF0_msk )); //wait till data transfer finish
while(!(SPI0SR &SPIF0_msk ));
SPI_Data_LOW_Tmp = SPI0DR;
PTS |= PTS3_msk; //SET pin3 of port S to deselect SPI for the first MAX5250
But it only DAC B have the output voltage, DAC A remains Zero. Any Ideas?
Big Thanks!
Albert