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: RTI Notification Interrupt

Part Number: TMS570LC4357

Tool/software: Code Composer Studio

/* USER CODE BEGIN (2) */
unsigned int start_app;
/* USER CODE END */

void main(void)
{
/* USER CODE BEGIN (3) */
    gioInit();
    rtiInit();

    /* enable Interrupts*/
    _enable_IRQ();

    rtiEnableNotification(rtiREG1,rtiNOTIFICATION_COMPARE0);
    rtiStartCounter(rtiREG1,rtiCOUNTER_BLOCK0);

    while(1){
        if(start_app){
            rtiResetCounter(rtiREG1,rtiCOUNTER_BLOCK0);
            start_app = 0;
            /* Execute TL generated Code (); */
            //Subsystem();
            gioSetBit(gioPORTB,6,1);
        }
        rtiStartCounter(rtiREG1,rtiCOUNTER_BLOCK0);
    }




void rtiNotification(rtiBASE_t *rtiREG, uint32 notification)
{
/*  enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (12) */
    rtiStopCounter(rtiREG1,rtiCOUNTER_BLOCK0);
    start_app = 1;
/* USER CODE END */
}

Hi,

i want that every 10ms an interrupt accurs and the LED gets on.

I cannot find my mistake.

thanks a lot

  • Hello,

    1. set the GIOB6 pin direction as output

    2. You don't need to reset the counter.

    3. try this modification

    rtiEnableNotification(rtiREG1,rtiNOTIFICATION_COMPARE0);
    rtiStartCounter(rtiREG1,rtiCOUNTER_BLOCK0);
    while(1){
    }

    void rtiNotification(rtiBASE_t *rtiREG, uint32 notification)
    {
        /*  enter user code between the USER CODE BEGIN and USER CODE END. */
        /* USER CODE BEGIN (12) */

        gioSetBit(gioPORTB,6, gioGetBit(gioPORTB,6) ^ 0x01);   //to toggle gio pin

        start_app = 1;
        /* USER CODE END */
    }

  • Thanks. It works well. But why i have not stop the counter?

    I know the Counter is 64 Bit. But what happens when it gets to the last value? 2^63-1 ??

    Thanks

  • Hello User,

    When the counter reaches 0xFFFFFFFF_FFFFFFFF it will roll over to 0x00000000_00000000.
  • Hello,

    It also generates an overflow interrupt (OVLINTx) to VIM if the overflow interrupt is enabled (RTISETINTENA register).
  • Thanks!

    What is the difference between the NHET and RTI? Both are using counters.
    When there is a NHET, why there is a EPWM Module to generate PWM Signals?

    Thanks a lot