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.

[参考译文] TMS570LS3137:RTI 怀疑

Guru**** 2577385 points


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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1074232/tms570ls3137-rti-doubt

部件号:TMS570LS3137

您好,

我想使用 两 个 RTI 通知比较。 但是,只有当“比较期间0”达到指定值(30000)时,它才会中断。 “比较期间1”(1000)不起作用。

随后,我附上了 rtiNotification 的代码。

void rtiNotification(uint32 notification)
{
    uint8_t i,j;
    uint16 A2 = 0x00, A1 = 0x00, A0 = 0x00;
    uint8 exTime0 = 0, exTime1 = 0;

    switch (notification)
    {
    case rtiNOTIFICATION_COMPARE0:
        /*  enter user code between the USER CODE BEGIN and USER CODE END. */
        /* Toggle HET pin 15 */
        gioSetBit(hetPORT1, 15, 1);  //0x00100000
        gioSetBit(hetPORT1, 20, 1);  //0x00100000

        for(i = 0; i<10; i++){for(j = 0; j<10; j++){}} // It defines the pulse width

        gioSetBit(hetPORT1, 15, 0);  //0x00000000
        gioSetBit(hetPORT1, 20, 0);  //0x00100000
        break;
    case rtiNOTIFICATION_COMPARE1:
        exTime0++;
        if(255 < exTime0)
        {
            exTime0 = 0;
            exTime1++;
            writeCY15B(A2, A1, (A0+1), exTime1, 0, true);                //Write in an external FRAM direction.
        }
        writeCY15B(A2, A1, A0, exTime0, 0, true);                //Write in an external FRAM direction.
    }
}

谢谢,此致,

莱安德罗

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

    你好,莱安德罗,

    您需要为比较1启用中断:

    rtiEnableNotification (rtiNOTIFICATION_COMPARE1);

    “1000”的单位是什么? 是毫秒还是 RTI 时钟周期?

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

    QJ 您好,

    谢谢。 它已经奏效了。  '1000'的单位为毫秒。

    此致,

    莱安德罗