MPC5645 DSPI Interrupt Reading

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MPC5645 DSPI Interrupt Reading

946 次查看
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 回复数

743 次查看
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 项奖励

743 次查看
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 项奖励