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.

CCS/TMS570LC4357: Internal timer

Part Number: TMS570LC4357

Tool/software: Code Composer Studio

Hi,

I need to use more than 4 timers for different applications in my program, currently I'm using RTI but this only allows me to have 4 comparisons, what other timer can I use in the  TMS570LC4357?

I have looked to the NHET timer but as far I understand this is to be used in relation with IO and this is not what I need, I need internal timers.

Thanks a lot for your help.

Jenniffer

  • Hello Jenniffer,

    You can use N2HET CNT instruction to generate an interrupt. When counter value (data field of CNT) reaches the maximum count specified in CNT instruction, HETFLG is set (interrupt flag register).

  • Hi Wang,

    I was reading more about the N2HET and how to do what you described. I'm not so sure about the following:

    1. Once to I have generated the .c and .h files in the HET IDE, how can I add these to the program in CCS and what do I need to enable in CCS  for the interrupt to work?

    2. Also if I want to create more than one timer in the HET project can I do it just adding more CNT instructions and generating interrupts? maybe using different registers on each instruction?

    Thanks and regards,

    Jenniffer

  • 1. The simplest way to use HET IDE code is:

    1. In CCS file structure, double click the het.c
    2. Delete the contents of the hetPROGRAM[] array.
    3. Switch to the HET IDE.
    4. Copy the contents of the array defined in the C File tab.
    5. Paste this code into the hetPROGRAM[]array in CCS.

    Another way, copy the c file generated by HET IDE to CCS project, then replace the following instruction with new one:

    replace:

            (void)memcpy((void *)hetRAM1, (const void *)het1PROGRAM, sizeof(het1PROGRAM));

    with:

             memcpy((void*)hetRAM1, (void*)HET_INIT0_PST, sizeof(HET_INIT0_PST));

    2. yes, you can