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.

TMDSEVM6678L - SYS/BIOS - PLL Configuration

Hello,

I'm newbie on DSP field. I'm using EVM with C6678. I would like to configure PLL using SYS/BIOS. Before loading my application to Core0 I'm calling function "Global Default Setup" from scripts menu (GEL file). It works good.

I would like to get periodic interrupt for example blinking LED. In this case period is estimated 500 clocks ticks.

    /* Create a periodic Clock Instance with period = 500 system time units */
    Clock_Params_init(&clkParams);
    clkParams.period = 500;
    clkParams.startFlag = TRUE;
    Clock_create(clk0Fxn, 500, &clkParams, NULL);

My function "clk0Fxn":

Void clk0Fxn(UArg arg0)
{
		if (flag)
		{
			platform_led(0, PLATFORM_LED_ON, PLATFORM_USER_LED_CLASS);
			flag = FALSE;
		}
		else
		{
			platform_led(0, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
			flag = TRUE;
		}
}

This function works good and period is 500 clock ticks. I chacked it by "Clock_getTicks". My GEL file (provided with EVM) should setting up my core frequency to 1000MHz but my LED flashing with estimated 1Hz. It means core frequency is 1kHz instead of 1GHz. In my case it should be 500ns periodic interrupt. How can I fix it ? How can I configure PLL using SYS/BIOS in cfg file or code ?

  • Maciej,

    Can you please clarify… are you saying that when you use the GEL file that the CPU seems to be running at 1KHz?  

    Or are you asking how to have SYS/BIOS configure the PLL?  If this is what you are asking, then the answer is that the SYS/BIOS kernel doesn’t provide any support for setting up the PLL on this device.

    Scott

  • Thank you for your comment Scott. Question is why GEL file (provided with EVM) can't set PLL correctly ? CPU frequency look like 1kHz instead of 1GHz. Here is very simple loop:

    	unsigned int i, k;
    
    	for(k = 0;k < 10000; k++)
    	{
    		for(i = 0;i < 5550; i++);
    }

    It takes about 500 ticks but it's 0.5s. I measured overhead of this loop by "Clock_getTicks()". I don't understand it.
  • Hi,

    The GEL file will set it to 1GHz properly, you can check it using

    platform_get_frequency

    About platform_led: EVM LEDs are controlled by the FPGA and they communicate through SPI. So this is not fast enough to activate the LEDs @ 500 ns.

    About your loop: The 0.5 s for the two loops is expected, but can you clarify how you're getting these 500 ticks?

    Regards

    J

  • Hello,

    I checked frequency using platform_info (or something like that). It's correct - just 1000MHz. I know this issue about EVM LED's. It's driving by SPI using FPGA and its' probably too slow for 500ns. I think it's obvious - it can't get very long delay (about 0.5s).

    I got 500 ticks using simple code:

    unsigned int time_start, time_overhead, i, k;
    
    time_start = Clock_getTicks();
    for(k = 0;k < 10000; k++)
    {
    	for(i = 0;i < 5550; i++);
    }
    time_overhead = Clock_getTicks() - time_start;

    I measured it in task.

     

  • Hi,

    How are you configuring your clock module?

    If you're not using any compiler optimization, each increment will take about 9 cycles, so 9*10000*5550/1GHz = 500 ms.

    J

  • I'm not using compiler opitimization. I haven't clock configuration i cfg file (only clock module include). I have only configuration in code - I attached it in my first post. My code is based on "clock example" from CCS5.

  • Hi,

    Open your .cfg file of your project and see SYS/BIOS tab (not Source), it will open a SYS/BIOS - System Overview graphic interface and then click on Clock, under Threads. In the clock example of CCS 5 you will see that the 'Tick period (us)' under Timer Control is set to 1000, so 1 ms. If you're using this same .cfg file in your project, each clock tick is 1 ms, so when you get 500 ticks, it means 500 ms, like the loop.

    Regards

    J

  • Thank you Johannes for your advcse. I changed "Tick period" from 1000us to 10us. It's work good and it solved my problem.