AnsweredAssumed Answered

How to use the time0 capture mode

Question asked by dylan ou on Dec 12, 2018
Latest reply on Dec 16, 2018 by dylan ou

I want to use the time0(DIO3) capture mode to measure infrared pulse width,

1. time0 initialize :

    vAHI_TimerSetLocation(E_AHI_TIMER_0,TRUE,FALSE);
   vAHI_TimerEnable(E_AHI_TIMER_0,0,FALSE,TRUE,FALSE);
   vAHI_TimerConfigureInputs(E_AHI_TIMER_0,TRUE,FALSE);
   vAHI_TimerStartCapture(E_AHI_TIMER_0);

2. time0 interrupt callback:

   PUBLIC void vISR_TimCaptureCallback(void)
   {
      vAHI_TimerReadCapture(IR_CAPTURE_TIME,&pu16Hi,&pu16Lo);
      DBG_vPrintf(APP_TIM_DEBUG, "cap1:[Hi:0x%x][Lo:0x%x]-----------\n",pu16Hi,pu16Lo);
   }

3. problem:

    It enter the interrupt all the way when there isn't any pulse input;

 

Can you tell me how to use time0 capture mode to measure the continuous pulse width;

Outcomes