This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2530 input capture问题

在zll 套件的遥控器里面用input capture,用t1的ch0 和ch1捕捉上下沿, 能否提供例程?

现在发现会出现一个问题,2个通道上有上升(下降)沿(相隔时间<20ms,或者是同时发生) ,进入中断的次数会有差异,有时候是进入1次 ,有时候会进入2次,

读取T1CC0和T1CC1的值,会出现读取不到最新值的问题(以上都是仿真时候看到)

HAL_ISR_FUNCTION( halKeyCaptureIsr, T1_VECTOR)
{
  static uint16 u16TmpA,  u16TmpB;
  uint16 u16Tmp1;

  HAL_ENTER_ISR();
 
#if 1
  //if (T1STAT & 0x01)
  {
    u16TmpA  = T1CC0L;
    u16TmpA |= (T1CC0H << 8);    
  }
    
  //if (T1STAT & 0x02)
  {
    u16TmpB  = T1CC1L;
    u16TmpB |= (T1CC1H << 8);
  }
#endif

if (T1STAT & 0x01)
  {
    T1STAT = ~(0x01);
  }
  if (T1STAT & 0x02)
  {
    T1STAT = ~(0x02);
  }
  T1STAT = ~(1 << 5);
  CLEAR_SLEEP_MODE();
  HAL_EXIT_ISR();

}