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:如何校准 RTI 中断周期时间

Guru**** 2390755 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1449322/rm57l843-how-to-calibrate-rti-interrupt-cycle-time

器件型号:RM57L843

工具与软件:

您好、TI 团队。

在测量 RTI 1ms 中断执行周期时、我确认在60秒后执行了大约60004次。
测量周期基于每60秒进入的外部信号输入。
[问题]
是否有可能操作 RTI 模块的寄存器以便1ms 中断每60秒恰好发生60000次?
如果可能、我想知道如何操作。

此致。

基因。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    RTI 模块配置如下所示。

    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.实际频率: 10 MHz

    最好的爬坡。

    基因。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Gene:

    实际上、没有校准可用、我的意思是我们不能使用 RTI 模块进行任何微调。

    我们所能做的就是、我们可以更改比较值、  

    我的意思是、我们得到的计数将超过所需的计数、因此只需将比较值减少1、就可以看到结果。 但是、我认为这不能解决问题、因为这可能会使结果值低于要求的值、但请进行一次测试。

    ——
    谢谢、此致、
    Jagadish。