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: edgeEnableNotification on pin30 disables PWM-Signal generated on pin4

Part Number: TMS570LC4357

Tool/software: Code Composer Studio

Hello,

my goal is to trigger an interrupt, if a rising edge occurs on pin30.

In order to do this, I generated a PWM-Signal on pin4 with a frequency of 2,5 kHz first.

After this I used the ECNT-instruction as follows in the HET-file:

ECNT {next=L00, pin=30, event=RISE, reg=B, irq=ON, data=0}

I selected pin30 as input pin for Edge detection, enabled edge 0 interrupt and selected PSL for bit 30.

The main-function is very simple:

int main(void){

hetInit();

edgeEnableNotification(hetRAM1, edge0);

while(1){};

return 0;

}

I added a print-command to the edgeNotification-function implemented in the HL_notification.c-file to test, if a interrupt is caused.

I dont know why, but if I enable the edge notification, there is no PWM-Signal on pin4 and I get no interrupts.

Did I forgot something?

Best regards

Kenan

  • Hello Kenan,

    Can you simulate your code using HET IDE? This is the simple code for PWM generation and edge detection:

    L00 CNT { reg=A, irq=OFF, max= 8 }
    L01 ECMP { en_pin_action=ON, pin=4, action=PULSELO, reg=A, data= 4, hr_data=10}
    L02 ECNT { pin=30, event=RISE, reg=B, irq=ON, data=0}
    L03 BR { next= L00, cond_addr=L00, event= NOCOND }

    You need connect pin4 and pin30 externally on your board. You will see that the value in register B or the data field of ECNT increments.
  • Hello Wang,

    thanks for your help.

    But I get the same problem, if I use your Assemblercode.  After the edgeEnableNotification-function the Signal on pin4 goes high (3,3 V).

    You can find the files in this folder:

    8831.HET_PWM (2).zip

    Best reagrds

    Kenan

  • ... I have found an error: edgeEnableNotification(hetRAM1, edge0); --> edgeEnableNotification(hetREG1, edge0);

    Now the Signal on pin4 doesnt go high (3,3 V) after the edgeEnableNotification-function.

    I changed my main-function as follows

    int main(void)
    {
    /* USER CODE BEGIN (3) */
        volatile uint32 EdgeCounter=0;
       hetInit();
       edgeEnableNotification(hetREG1, edge0);
    
       while(1){
           EdgeCounter=edgeGetCounter(hetRAM1, 0);
           printf("Edges:%d\n",EdgeCounter);
       };
    /* USER CODE END */
    
        return 0;
    }
    

    My problem now is, that pin30 doesnt collect rising Edges.

    Best regards

    Kenan