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.

[参考译文] TMS320F280025C:SCI 模式中的 LIN 错误处理

Guru**** 2460010 points


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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1052171/tms320f280025c-lin-error-handling-in-sci-mode

器件型号:TMS320F280025C

我在多缓冲器 SCI 模式下使用 LIN。 配置代码如下所示:

void LINB_configureSCIMode()
{
    //
    // Enter LIN reset state to perform configurations
    //
    LIN_enterSoftwareReset(LINB_BASE);

    //
    // Switch LIN into SCI mode
    //
    LIN_enableSCIMode(LINB_BASE);

    //
    // Set the SCI communication mode to idle line
    //
    LIN_setSCICommMode(LINB_BASE, LIN_COMM_SCI_IDLELINE);

    //
    // Set SCI to transmit one stop bit
    //
    LIN_setSCIStopBits(LINB_BASE, LIN_SCI_STOP_ONE);

    //Setting baud rate to 115200
    LIN_setBaudRatePrescaler(LINB_BASE, 53, 4);

    //
    // Disable parity check
    //
    LIN_disableSCIParity(LINB_BASE);

    //
    // Enable multi-buffer mode
    //

    LIN_enableMultibufferMode(LINB_BASE);


    //
    // Module set to complete operations when halted by debugger
    //
    LIN_setDebugSuspendMode(LINB_BASE, LIN_DEBUG_COMPLETE);

    //
    // Set character length as 8-bits
    //
    LIN_setSCICharLength(LINB_BASE, 8);

    //
    // Set to 8 character in response field
    //
    LIN_setSCIFrameLength(LINB_BASE, 8);


    //
    // Disable Internal Loopback mode
    //
    LIN_disableIntLoopback(LINB_BASE);

    //
    // Exit LIN reset state
    //
    LIN_exitSoftwareReset(LINB_BASE);
}

在我的测试过程中、我注意到 LINB 接口停止接收数据。 但它会不断发送数据。 我怀疑 LINB 接收器可能会进入某种错误状态。 在这方面、请告诉我"LIN_getInterruptStatus"是否是读取错误标志的正确函数? 其次、如果检测到任何错误、则可以使用"LIN_performSoftwareReset"清除这些错误。 请告诉我是否有更有效的方法来检查和清除错误。

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

    您好、Asad、

    是的、LIN_getInterruptStatus 将读取设置的任何错误标志。 您应该使用 LIN_clearInterruptStatus 清除中断标志、而不是 SW 复位。

    此致、

    Nirav

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

    非常感谢您的指导。 让我实施并测试这种方法。 如果有任何问题、我会告诉您。