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.

Missing one pulse of two connected to TINP pin in C6416

 

Hi,

I'm trying to count pulses that are connected to my C6416's TINP input. Pulses are not so slow and coming approximately at a period of 1 second. I have configured the registers like following and in an interrupt I'm recording at which tick I receive the low-to-high transition.

      TIMER_CTL_RMK( /* Timer control register (CTL)*/
      TIMER_CTL_INVINP_NO, 
      TIMER_CTL_CLKSRC_EXTERNAL,
      TIMER_CTL_CP_CLOCK,                       
      TIMER_CTL_HLD_YES,                           
      TIMER_CTL_GO_NO,

      TIMER_CTL_PWID_ONE,

     TIMER_CTL_DATOUT_0,
      TIMER_CTL_INVOUT_NO,
      TIMER_CTL_FUNC_GPIO                           
); 

I set the count register to 0 and period to 1.

My problem is I'm entering the interrupt once in two pulse. Namely I'm missing one pulse at each time. I have read the timer reference manual and it seems to me the period which timer interrupt is generated is 2*period. Is it possible to generate an interrupt when every pulse is received? Am I making a wrong configuration?

 

Best regards,

Sertac

 

  • Sertac,

    Please see the Timer User's Guide spru582. Section 6 "Boundary Conditions in the Control Registers" and section 7 "Timer Interrupts" will help you understand the operation of the DSP timer interrupts.

    If you want the timer to act as a counter and to accumulate a count of pulses, then this operation should work well with a much higher value in the PRD register.

    If you want to generate a DSP interrupt for every pulse, then you do not need the timer module. The GPIO module will work well for this operation.

    Regards,
    RandyP

     

    If you need more help, please reply back. If this answers the question, please click  Verify Answer  , below.