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.

problem with one-shot periodic timer

Hi,

I have a C5509A DSP, with DSP/Bios 5.31 .

I am using a one-shot periodic function, with 2 sec period.

This is an abstraction of my code:

void tskFxn

{

PRD_start (&PRD0);

GPIO_on();

}

void PRD0_fxn(void)

{

GPIO_off();

}

However, the period isn't 2 seconds, it is 1.2sec.

Does anyone have any explaination to this?

Thanks,

Shiri.

 

  • Wrong PRD rates are usually caused by one of two things: 1) You have told BIOS that the DSP is running at a different clock rate than it really is, or 2) The actual PRD_clock rate doesn't match the rate you assumed when setting up your PRD functions.

    I'm guessing that you created PRD0 in the BIOS configuration tool. First check under Global Settings / General to verify that "DSP Speed In MHz" matches the clock rate at which you are actually running your target. If you have checked "Modify CLKMD" you'll need to verify that the way you're programming the PLL actually matches the clock rate you entered above.

    Next, you need to look at Scheduling / CLK - Clock Manager and verify that the PRD tick interval is what you thought it was. Be certain that Fix TDDR is not checked, otherwise it may not match the tick interval you entered. Also, beware of checking "Directly configure on-device timer registers" unless you are really certain what you're doing.

    Finally, look at the period (in ticks) of PRD0 to verify that it makes sense in light of your settings above.

    David L. Rick

    Hach Company

     

  • David,

    Thank you for your answer!

    I already checked everything you wrote and it was correct.

    However, running the PRD_start() from a task and not from SWI solved the problem.

    Any idea why?