MPC5645 DSPI Interrupt Reading

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

MPC5645 DSPI Interrupt Reading

970件の閲覧回数
rehan_khan
Contributor III

void ISR78_DSPI0ISR(void)

{

volatile uint32_t DSPI_SR_Value;

  receive_dspi_data0 = (uint16_t)DSPI_0.POPR.R;

  DSPI_SR_Value = DSPI_0.SR.R;

  DSPI_0.SR.R = DSPI_SR_Value | DSPI_SR_RFDF;

 

  if(DSPI_0.SR.B.RXCTR == 0x0) {

        receive_flag0 = 1;

    }

}

 

In above code I am trying to read the DSPI status register and checking RXCTR value but I never get RXCTR value greater than zero even if I have received frame. I can see the RXCTR value in JTAG debugger window but when I take value DSPI_0.SR.R in variable I cant see the RXCTR value, it is always zero in the value stored in variable.

 

Please help

ラベル(1)
0 件の賞賛
2 返答(返信)

767件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

RXCTR indicates the number of entries in the RX FIFO. The RXCTR is decremented every time the DSPI _POPR is read. It is exactly what you are doing several lines before you testing RXCTR if it is zero.

0 件の賞賛

767件の閲覧回数
rehan_khan
Contributor III

Thanks for your help

What is the best method to check DSPI SR register. Every time I read value in variable it is different. Specially for RFDF and RXCTR value. But at the same time when you look into debugger register windows The value of RFDF and RXCTR is always 1. But I am getting always zero in DSPI_0.SR.R . If use DSPI_0.SR.B.RXCTR even if it is 1 in debugger register windows I always get 0 value.

please note I have disabled RX FIFO and it is in double buffer mode.

0 件の賞賛