AnsweredAssumed Answered

WDTH_CAP problem with BF518

Question asked by marco55 on Jun 25, 2014
Latest reply on Jul 3, 2014 by marco55

Hello,

i need to acquire the duty cycle value of a PWM signal.

I have the signal at PG8 (blackfin 518) and I configured it for the 3rd function (TMR6).

 

The Timer is cofigured as follow:

*pTIMER6_CONFIG = WDTH_CAP | IRQ_ENA | PULSE_HI | PERIOD_CNT;

 

in the interrupt I read the TIMER_PERIOD:

 

if((*pSIC_ISR1 & TIMER6_INT) != 0){

     *pTIMER_STATUS = TIMIL6;

     Period = *pTIMER6_PERIOD;

     ssync();

}

 

My problem is that with the oscilloscope at PG8 I can see that the signal has a period of 2ms, while the period read in the interrupt function is instable and vary between 3 to about 150 SCLK. SCLK is 80 MHz, so the period acquired in the interrupt function is unacceptable.

 

I can't understand where is the problem.

any suggestion?

 

Thank you

 

Marco

Outcomes