How to use the time0 capture mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use the time0 capture mode

854 Views
13560436802
Contributor II

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;

pastedImage_15.png

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

Labels (1)
0 Kudos
Reply
2 Replies

731 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Dylan,

Please look at the vAHI_TimerReadCaptureFreeRunning

JN516x Integrated Peripherals API User Guide

Regards,

Mario

0 Kudos
Reply

731 Views
13560436802
Contributor II

Hi Maro,

  What caused the error??

pastedImage_1.png

0 Kudos
Reply