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.

TMS570 CLOCK PROBLEM

Other Parts Discussed in Thread: TMS570LS20216, HALCOGEN

Dear TI Support:

    I use TMS570LS20216 USB Kit and HallCoGen3.06.00 do the clock test. Here is my HallCoGen configuration:

 

   

I use main oscillator for the RTI model's clock source, on the usb kit, it's a 16MHz crystal.

And this is my RTI configuration:

     I use block0 and block1 to generate compare0 and compare3 interrupts, the period of this two interrupts is 1ms and 10ms. In the interrupt notificaiton, flash the LEDs.

    But the problem is : watch the LED flash frequency, it seems the actual period is about 4 times longer (4ms and 40ms), please tell me why.

   Regards,

   Node

  • Hi Node,

    Can you let us know how did you measure the LED frequency, using a oscilloscope and the measuring the time period of the output waveform?

    I quickly tried with your settings to toggle a GIO and see a proper 1ms/10ms output, when i measured the GIO output time period using an oscilloscope.

    Regards,

    Praveen

  • Hi Praveen:

        I use the RTI compare(compare0 and compare3) interrupt to flash the LED. In thertiNotification() program, I process it like this:

    void rtiNotification(uint32 notification)
    {
    /*  enter user code between the USER CODE BEGIN and USER CODE END. */
    /* USER CODE BEGIN (5) */
    	if(notification == rtiNOTIFICATION_COMPARE0)
    	{
    		ulTimeCounter0 += 1;
    		
    		if((ulTimeCounter0 % 1000) == 0)
    		{
    			ulLED0Bit ^= 1;
    			gioSetBit(hetPORT, 0, ulLED0Bit);
    		}
    	}
    	
    	if(notification == rtiNOTIFICATION_COMPARE3)
    	{
    		ulTimeCounter3 += 1;
    		
    		if((ulTimeCounter3 % 50) == 0)
    		{
    			ulLED3Bit ^= 1;
    			gioSetBit(hetPORT, 3, ulLED3Bit);
    		}
    	}
    /* USER CODE END */
    }


    You can see, when the compare interrupt happens, the uiTimeCounter0/3 increased by 1. Then use the timecounter remaind by 1000 and 50, so the LED flash frequency should be 1 seconds and 0.5 seconds. This can be seen by eyes.

    Regards,

    Node

  • Node,

    I've checked your code and everything looks good to me.
    Here is attached a project (CCS and Halcogen) that I've created using your code.

    The 2 LEDs blink at the correct speed to me.

    3240.RTI.zip

    Please have a try and let me know.

  • Hi Jean:

       I tried your code on the USB Kit, it works correct. So I check the configuration of HalCoGen's Global Clock Module and PLL, I find some difference between us:

       This is your configuration:

      

    My configuration is:

    If you try the configuration as mine, the result will be different.

    I set the VCLK1 at 10Mhz, because in my product, I have an extern SPI device which has a low speed(50~80K buard rate), and I also use the NHET module, so I set the VCLK2 at 70MHz.

     

    So my question is : will this two clock domains(VCLK1 and VCLK2)  affect the RTI module? Is there any problem if I set the PLL output at the high speed(140MHz for TMS570LS20216PGE)?

     

    Please let me know, thank you.

     

    Regards,

    Node