MPC5777M SPI Pin Configuration issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5777M SPI Pin Configuration issue

1,598件の閲覧回数
chidambaramvelu
Contributor II

Hi,

 

We tried configuring DSPI port 2 and 1 as master and slave respectively.  CS and clocks are generating. MOSI is also generating. We have verified with Oscilloscope. RFDF interrupt also generated. But the slave Rx data register always read as zero. And we tried looping back of MOSI to MISO of master itself. Master Rx data register too read as zero.

 

Please go thru our code. Is there any mistake in SPI Input direction pin assignment? 

 

Thanks & regards,

Chidambaram.V

Original Attachment has been moved to: spicode.txt.zip

ラベル(1)
タグ(1)
0 件の賞賛
返信
7 返答(返信)

1,165件の閲覧回数
sandeepnagaraja
Contributor III

chidambaramvelusamy

Hi Chidambaram,

1. The TX FIFO in the PUSHR register is of 2 bytes long, so must be transmitting the 64 bytes data splitting each of 2bytes.

2. You could use CLR_TXF control field in MCR control register to flush out the transmit buffer before transmitting new data.

     Regards

Sandeep Nagarajan

0 件の賞賛
返信

1,165件の閲覧回数
chidambaramvelu
Contributor II

HI to all,

While transmitting 64 bytes of data from slave,last byte was missing.On next transmission i can get the last byte of the previous transmission.So that while starting transmission first byte is zero.is there any settings for clearing the shift register in SPI while initializing the module.

0 件の賞賛
返信

1,165件の閲覧回数
sandeepnagaraja
Contributor III

Hi Mr. Chidhabaram, We are also facing same problem and we are also writing spi driver code for mpc 5777m ,  but for us we are not at all gettting clock, cs and mosi on oscilloscope and my code looks not working . we got your code , but there is no definition for HW_INIT function . Can you please share your complete driver code with All function definition Or at least the HW_INIT function.chidambaramvelusamy

0 件の賞賛
返信

1,165件の閲覧回数
chidambaramvelu
Contributor II

Hi Sandeep Nagarajan

I had attached my code with the previous post. Please refer that one. our device was working fine in master mode. but not Slave Mode. We have some issues while transmitting from slave.

0 件の賞賛
返信

1,165件の閲覧回数
sandeepnagaraja
Contributor III

@chidambaram velusamy : With your code for spi master, Once the SPI_2 master init completes with halt = 0x0, the sck pin has to generate the oscillations, which is not happening in my board. i used same gpio inits and as per the IO signal table, the SSS values matches with your configurations, could you please share any tips over the issue.

0 件の賞賛
返信

1,165件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

I think you have used wrong values for SSS fields. I the lines below I have commented out what you have wrong replacing it with values to be in accordance to MPC5777M_cut2_IO_Definition_v1_41_17Feb2015.xlsx:

/*SPI02 DIN-PL[13]*/
//SIUL2.MSCR_MUX[374].B.SSS=0x8;
SIUL2.MSCR_MUX[374].B.SSS=0x2;


/*SPI01 DIN-pf[4]*/
//SIUL2.MSCR_MUX[371].B.SSS=0x3;
SIUL2.MSCR_MUX[371].B.SSS=0x2;

/*SPI01 CLK-pf[5]*/
//SIUL2.MSCR_MUX[372].B.SSS=0x2;
SIUL2.MSCR_MUX[372].B.SSS=0x1;

/* SPI01 CS-ph[14]*/
//SIUL2.MSCR_MUX[373].B.SSS=0x3;
SIUL2.MSCR_MUX[373].B.SSS=0x2;

0 件の賞賛
返信

1,165件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, I have been noticed my comment here is wrong. Please ignore it.

Original configuration is correct. I am sorry for confusing you.

0 件の賞賛
返信