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.

CLKTEST register issue



Hello,

I'm using a TMS570 eval board. I tried to send out the VCLK clock to the external clock out pin.

The code i used is this.

      #if 1
      systemREG1->CLKTEST &= 0xFFF0FFF0;
     systemREG1->CLKTEST |= 0xFFF5FFFC;
      #endif
      systemREG1->SYSPC1 = 1;

But when ever I use the code with CLKTEST regsiter, my code composer studio hangs. If I comment out [#if 0] there seems to be no problem with the cod composer studio[eventhough I am not getting the right clock out].

 

Any comments...?

 

 

 

  • Yes that was it. Thanks.

  • Hi

    The problem you are experiencing can be easily solved by doing the following:

    Replace this line of code:
    systemREG1->CLKTEST |= 0xFFF5FFFC;

    with this line of code:
    systemREG1->CLKTEST |= 0x0005000C;

    The original problem was caused by the setting that was written to the CLKTEST register. The bits CLK_TEST_EN and SEL_ECP_PIN are set properly; however the ALTLIMPCLOCKENABLE bit is also set. ALTLIMPCLOCKENABLE bit should only be set when a valid external clock source is fed to the device through the GIOB[0] pin.   If there is not a clock source present on GIOB[0], the clock monitoring circuit will not have a valid clock and ultimately the clock sources to the device will be stopped.  This will cause the device to stop operating and the CCS JTAG connection to the microcontroller will be dropped .

    For more details on the CLKTEST register please see page 110 of the TMS570LS Series Technical Reference Manual (TRM) (SPNU489) available at: http://www.ti.com/litv/pdf/spnu489


    Also I noticed that your CLKTEST register setting will make VCLKA2 (FlexRay peripheral clock) visible on the ECLK pin, not VCLK as your original post indicated.   If you intend to bring VCLK out you do not need to use the CLKTEST register.
    You may use the SYSPC1 and ECPCNTL registers to make VCLK viewable on the ECLK pin.

    Keep in mind that the CLKTEST register should only be used for test and debug purposes.