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.

RM57L843: How to calibrate RTI interrupt cycle time

Part Number: RM57L843

Tool/software:

Hi TI team.

When measuring the RTI 1ms interrupt execution cycle, I confirmed that it was executed about 60004 times after 60 seconds.
The measurement cycle was based on external signal input that comes in every 60 seconds.
[Question]
Is it possible to manipulate the register of the RTI module so that the 1ms interrupt occurs exactly 60000 times every 60 seconds?
If possible, I would like to know how.

Best regards.

Gene.

  • RTI module configuration is as follow.

    void rtiInit(void)
    {
    /* USER CODE BEGIN (2) */
    /* USER CODE END */
        /** @b Initialize @b RTI1: */
    
        /** - Setup NTU source, debug options and disable both counter blocks */
        rtiREG1->GCTRL = (uint32)((uint32)0xAU << 16U) | 0x00000000U;
    
        /** - Setup timebase for free running counter 0 */
        rtiREG1->TBCTRL = 0x00000000U;
    
        /** - Enable/Disable capture event sources for both counter blocks */
        rtiREG1->CAPCTRL = 2U | 0U;
    
        /** - Setup input source compare 0-3 */
        rtiREG1->COMPCTRL = 0x00001000U | 0x00000100U | 0x00000000U | 0x00000000U;
    
        /** - Reset up counter 0 */
        rtiREG1->CNT[0U].UCx = 0x00000000U;
    
        /** - Reset free running counter 0 */
        rtiREG1->CNT[0U].FRCx = 0x00000000U;
    
        /** - Setup up counter 0 compare value 
        *     - 0x00000000: Divide by 2^32
        *     - 0x00000001-0xFFFFFFFF: Divide by (CPUC0 + 1)
        */
        rtiREG1->CNT[0U].CPUCx = 10U;
    
        /** - Reset up counter 1 */
        rtiREG1->CNT[1U].UCx = 0x00000000U;
    
        /** - Reset free running counter 1 */
        rtiREG1->CNT[1U].FRCx  = 0x00000000U;
    
        /** - Setup up counter 1 compare value 
        *     - 0x00000000: Divide by 2^32
        *     - 0x00000001-0xFFFFFFFF: Divide by (CPUC1 + 1)
        */
        rtiREG1->CNT[1U].CPUCx = 10U;
    
        /** - Setup compare 0 value. This value is compared with selected free running counter. */
        rtiREG1->CMP[0U].COMPx = 1000U;
    
        /** - Setup update compare 0 value. This value is added to the compare 0 value on each compare match. */
        rtiREG1->CMP[0U].UDCPx = 1000U;
    
        /** - Setup compare 1 value. This value is compared with selected free running counter. */
        rtiREG1->CMP[1U].COMPx = 10000U;
    
        /** - Setup update compare 1 value. This value is added to the compare 1 value on each compare match. */
        rtiREG1->CMP[1U].UDCPx = 10000U;
    
        /** - Setup compare 2 value. This value is compared with selected free running counter. */
        rtiREG1->CMP[2U].COMPx = 100000U;
    
        /** - Setup update compare 2 value. This value is added to the compare 2 value on each compare match. */
        rtiREG1->CMP[2U].UDCPx = 100000U;
    
        /** - Setup compare 3 value. This value is compared with selected free running counter. */
        rtiREG1->CMP[3U].COMPx = 1000000U;
    
        /** - Setup update compare 3 value. This value is added to the compare 3 value on each compare match. */
        rtiREG1->CMP[3U].UDCPx = 1000000U;
    
        /** - Clear all pending interrupts */
        rtiREG1->INTFLAG = 0x0007000FU;
    
        /** - Disable all interrupts */
        rtiREG1->CLEARINTENA = 0x00070F0FU;
    
        /**   @note This function has to be called before the driver can be used.\n
        *           This function has to be executed in privileged mode.\n
        *           This function does not start the counters.
        */
    
    /* USER CODE BEGIN (3) */
    #if REGISTER_WRITTEN_READBACK
        (void)CheckDataReadback(&(rtiREG1->GCTRL), 1u);
    #endif /* REGISTER_WRITTEN_READBACK */
    
    /* USER CODE END */
    }
    

    1. NTU2 : PLL2 - 330 MHz

    2. RTI1CLK : 110 MHz

    3. Actual Requency : 10 MHz

    Best regrads.

    Gene.

  • Hi Gene,

    Actually, there is no calibration available, i mean we can't do any fine tuning using RTI module.

    All we can do is that we can change the compare value, 

    I mean as we are getting more than required count so just try to reduce the compare value by one and see the result. However, i don't think this will solve the issue because it might make the result value way less than the required, but please test it once.

    --
    Thanks & regards,
    Jagadish.