Post Go back to editing

ADSP21469 Timer0 PWM Mode Jitter

Thread Summary

The user encountered 1us period jitter on a 40kHz PWM output generated by Timer0 on the ADSP-21469 EZ-Kit lite when other interrupts were enabled. The hardware timer is supposed to auto-reload without software intervention, but the jitter increased with more active interrupts. The user found a workaround using the PCG for PWM generation, achieving low jitter, and eventually replaced the AD DSP with an FPGA and i5-4250u in an Intel NUC.
AI Generated Content

Hi,

I am using the code below to set up timer0 to create a PWM output with a fixed period and from time to time I change the width.

   

*pTM0CTL = 0;                                                             // Clear any old settings

*pTM0CTL = (TIMODEPWM | PULSE | PRDCNT );          // Set PWM mode, High output, Count to end of period

*pTM0CNT =    0x01;

*pTM0PRD =     PWM_Freq;                                         // Set to 40kHz

*pTM0W =     PWM_VCXO;                                          // Set default to 50% Duty

asm("NOP;");

asm("NOP;");

*pTM0STAT = (TIM0EN);

There are no interrupts enabled for timer0 and it simply auto reloads at the end of each period count.

When no other interrupts are enabled I get a very nice PWM output and can vary the width from 0-100% with no measurable jitter.

When other interrupts are enabled I'm getting up to 1us jitter on the period.

I'm creating approximately 40kHz PWM so 1us represents a large % of the period.

Since this is a free-running hardware timer with no interrupts required to reload it why is there  jitter when other interrupts are enabled.

I can understand interrupt latency causing jitter if software had to handle the interrupts for timer0 but there is none for this timer and it's supposed to be hardware based...

Is there some latency in the hardware reload that is interrupt dependant?

Is there another way to configure the timer to produce PWM jitter-free (well, low jitter within the spec of the device)?

I can't use the PWM outputs because this chip does have them or the ability to map to the DPI...

Thanks in advance.

Parents
  • Hi Warren,

    Glad to know that you have got the work-around for your problem.

    But as far as Peripheral timer is concerned, once it is timed out , it automatically reloads the period count. A timer interrupt is generated at the end of each period. An ISR must clear the interrupt latch bit TIMxIRQ and might alter period and/or width values. So I would suggest you to try replicating the issue with simple code and send it to us, so that we can look into it and try to find the root cause of the jitter.

    Thanks,

    Harshit

Reply
  • Hi Warren,

    Glad to know that you have got the work-around for your problem.

    But as far as Peripheral timer is concerned, once it is timed out , it automatically reloads the period count. A timer interrupt is generated at the end of each period. An ISR must clear the interrupt latch bit TIMxIRQ and might alter period and/or width values. So I would suggest you to try replicating the issue with simple code and send it to us, so that we can look into it and try to find the root cause of the jitter.

    Thanks,

    Harshit

Children
No Data

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.