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.

How to enable a PWM interrupt

Other Parts Discussed in Thread: HALCOGEN

Hello, I am using TMS570LS31HDK. I want to enable a PWM interrupt but failed. Can you help me to find out the problem? Thanks a lot!!

First, I config the project in HalCoGen. I enable the HET1 driver and GIO driver.My first question is should I enable the RTI driver?

Then I config the HET1. In the sub tag PWM Interrupts, I choose the E of Period 0 and use high level interrupt. In the sub tag PWM0-7, I config PWM0's period is 1s and duty is 75%, and enable its output to pin 0.

In the VIM tag, I config VIM channel 0-31, enable the "10:HET High" and IRQ.

Then I generate code and code in CCS.

In sys_main.c, the code is

hetInit();

gioSetDirection(hetPORT1, 0xFFFFFFFF);

gioSetBit(hetPORT1,17 ,1);  ////   I want to toggle this pin in the interrupt
while(1) {}

In file Notification.c

void pwmNotification(hetBASE_t * hetREG,uint32 pwm, uint32 notification)
{
/* enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (35) */
gioToggleBit(hetPORT1,17);

hetREG1->FLG = 0xFFFFFFFF;
/* USER CODE END */
}

That is all what I do. Please help me out.

1263.PWM.rar