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/TMS570LS1224: Interrupt access

Part Number: TMS570LS1224
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hi

I have a problem. With the help of HAL code generator, the pwm can be configured easily. But what if I wish to have an interrupt every time a pulse ends and the ISR changes the duty cycle for the subsequent cycles?

Is there any manual code configuration so that I could change the duty cycle and how to access the pwm interrupt in het?

  • Hello,

    HALCoGen generates some APIs for setting pwm parameters (for example pwmSetDuty() ). Thesae APIs are in file het.c.

    HET interrupt handler is also in  het.c . You can set HET to generate high level or low level interrupt.

    Best regards,
    Miro

  • How do i set het to generate interrupt? and which vim channel interrupt should be enabled. i'm literally confused!

  • Hello,

    HALCoGen provides easy setting of 8 PWM output.  This can be done from HETx tab (HET1 or HET2 tab). One of the sub-tabs is "PWM interrupts". From there you can enable Eof Duty and Eof Period interrupts of corresponding signal and level (priority) of interrupt - high or low. Doing this you will enable generation of interrupt to VIM (but this does not enable VIM to react to this interrupt).

    After enabling the HET to generate interrupt and choosing the priority you have to open VIM Channel x-y Tab. From VIM Channel 0-31 you can enable HET High (Channel 10) and HET Low (Channel 24) interrupt that comes from N2HET1 module. If you want to enable N2HET2 interrupts then Channel 63 is for HET2 High and Channel 73 is for HET2 Low.

    When all settings from HALCoGen are done (enabling needed modules from Driver Enable tab, setting PINMUX tab for example) and code is generated, het.c file will be generated as well. In this file some APIs are created as well interrupt handler (for HET1 - het1LowLevelInterrupt() and het1HighLevelInterrupt() ).

    I hope this helps.

    Best regards,
    Miro

  • void het1HighLevelInterrupt(void)
    {
    uint32 vec = hetREG1->OFF1;

    if (vec < 18U)
    {
    if ((vec & 1U) != 0U)
    {
    pwmNotification(hetREG1,(vec >> 1U) - 1U, pwmEND_OF_PERIOD);
    }
    else
    {
    pwmNotification(hetREG1,(vec >> 1U) - 1U, pwmEND_OF_DUTY);
    }
    }
    else
    {
    edgeNotification(hetREG1,vec - 18U);
    }
    }

    this was present in het.c

    But how do i write the code which i want to execute when interrupt occurs

  • Description Resource Path Location Type
    #20 identifier "het1HighLevelInterrupt" is undefined sys_vim.c /finalshayad/source line 82 C/C++ Problem

    how to get rid of this error?

  • Hello,

    In this ISR pwmNotification is called where you can write your code. pwmNotification is in notification.c file.

    Best regards,
    Miro

  • Please tell me how to get rid of the error I mentioned above

    thanks a lot

  • Hello,

    Did you manage this? It looks like het1HighLevelInterrupt is not declared but used.

    Best regards,
    Miro

  • Hello,

    I assume you have managed this issue, since there is no feedback. I am going to close this thread. You can always reopen this thread with writing at the end of it or you can open new thread instead.

    Best regards,
    Miro