Part Number:MSP430FR2633
1.关于break 帧头的检测,目前 Tsynbrk = 13,Tsyndel = 1/5/10,这些都能正确检测到,现在有两种情况检测不到break: Tsynbrk = 13,Tsyndel = 14、 Tsynbrk = 26,Tsyndel = 1 ,请问这是为什么,能解决吗?
Green Deng:
你好,方便发送一下配置部分的关键代码吗?
,
user6341679:
const tUARTPort g_myLINPort ={ .pbReceiveCallback = &LINreceiveHandler, .pbErrorCallback = &LINerrorHandler, .peripheralParameters.selectClockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,//EUSCI_A_UART_CLOCKSOURCE_UCLK, //EUSCI_A_UART_CLOCKSOURCE_SMCLK, .peripheralParameters.clockPrescalar = 6, //26, .peripheralParameters.firstModReg = 8, //0, .peripheralParameters.secondModReg = 0x11, //0xB6, .peripheralParameters.parity = EUSCI_A_UART_NO_PARITY, .peripheralParameters.msborLsbFirst = EUSCI_A_UART_LSB_FIRST, .peripheralParameters.numberofStopBits = EUSCI_A_UART_ONE_STOP_BIT, .peripheralParameters.uartMode = EUSCI_A_UART_AUTOMATIC_BAUDRATE_DETECTION_MODE,//EUSCI_A_UART_AUTOMATIC_BAUDRATE_DETECTION_MODE .peripheralParameters.overSampling = EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION //EUSCI_A_UART_LOW_FREQUENCY_BAUDRATE_GENERATION//EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION};
void LIN_GPIO_Init(void){ P1OUT = (0); P1DIR = (0);//(GPIO_PIN0 | GPIO_PIN6 | GPIO_PIN7); P1SEL0 = (GPIO_PIN4 | GPIO_PIN5); //(GPIO_PIN2 | GPIO_PIN3 | GPIO_PIN4 | GPIO_PIN5); P1SEL1 = (0);
LIN_EN_POUT |= LIN_EN_PIN; LIN_EN_PDIR |= LIN_EN_PIN; LIN_EN_ON;}
void LIN_Init(void){ LIN_GPIO_Init(); UART_openPort(&g_myLINPort);}
void UART_openPort(const tUARTPort *pPort){ UART_closePort(); g_pUARTPort = pPort; UCA0CTLW0 |= UCSWRST; //reset UART0
MAP_EUSCI_A_UART_init( UART__EUSCI_A_PERIPHERAL, (EUSCI_A_UART_initParam*)&(g_pUARTPort->peripheralParameters) ); UCA0CTLW0 |=UCBRKIE; //打开break 中断 UCA0CTLW0 &= ~UCDORM;//Not dormant. All received characters will set UCAxRXIFG MAP_EUSCI_A_UART_enable(UART__EUSCI_A_PERIPHERAL); MAP_EUSCI_A_UART_clearInterrupt( UART__EUSCI_A_PERIPHERAL, EUSCI_A_UART_RECEIVE_INTERRUPT_FLAG ); MAP_EUSCI_A_UART_enableInterrupt( UART__EUSCI_A_PERIPHERAL, EUSCI_A_UART_RECEIVE_INTERRUPT ); MAP_EUSCI_A_UART_enableInterrupt( UART__EUSCI_A_PERIPHERAL, EUSCI_A_UART_BREAKCHAR_INTERRUPT ); g_UARTStatus = eUARTIsIdle;}
,
Green Deng:
你好,昨天将你的问题升级到了英文E2E论坛,现在有工程师回复了,你可以参考一下:e2e.ti.com/…/msp430fr2633-the-problem-of-serial-port-multiplexing-into-automatic-baud-rate-detection-mode-lin