请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号: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"清除这些错误。 请告诉我是否有更有效的方法来检查和清除错误。