LIN_Master

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LIN_Master

跳至解决方案
2,943 次查看
Ravikumar1
Contributor II

How to send break field, delimiter, and Sync byte using UART to implement LIN master. Means how we are going to send data with UART because need to send 13 dominant bits for sync break, however in uart we have 8 bit limit (and 1 start bit and 1 stop). If any one know the answer please share the information step by step process of break field, delimiter, and Sync byte.

Please help me to find the solution

Thanks in advance

 

0 项奖励
回复
1 解答
2,899 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

LIN Driver/Stack is free and part of SDK/RTM driver in S32Design studio.
If using RTD drivers, stack need to be added from https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SW32K1-REFSW-D
MCAl driver is available as well, refer device web page.

BR, Petr

 

在原帖中查看解决方案

4 回复数
2,908 次查看
Ravikumar1
Contributor II

Thank you for your response,

How will I get the Lin Stack/ Driver, Is it open source or its need any license required, If license require please send me those details.

0 项奖励
回复
2,900 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

LIN Driver/Stack is free and part of SDK/RTM driver in S32Design studio.
If using RTD drivers, stack need to be added from https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SW32K1-REFSW-D
MCAl driver is available as well, refer device web page.

BR, Petr

 

2,888 次查看
Ravikumar1
Contributor II

Thank you very much for the information.

0 项奖励
回复
2,935 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the way to send break is described in chapter 53.4.3.1 Send break and queued idle of the device RM.
The code to send LIN header could be

void LIN_SendHeader(uint8_t PID)
{
    			       
    while((LPUART0->STAT & LPUART_STAT_TDRE_MASK) == 0);    /* Wait until Transmit data buffer become empty */
    LPUART0->CTRL |= LPUART_CTRL_SBK_MASK;                  /* SBK=1: Queue break character(s) to be sent */  
	LPUART0->CTRL &= ~LPUART_CTRL_SBK_MASK;                 /* SBK=0: Normal transmitter operation */    
    
    while((LPUART0->STAT & LPUART_STAT_TDRE_MASK) == 0);    /* Wait until Transmit data buffer become empty */ 
	LPUART0->DATA = 0x55;                                   /* Transmit Sync Byte */
    
	while((LPUART0->STAT & LPUART_STAT_TDRE_MASK) == 0);    /* Wait until Transmit data buffer become empty */
	LPUART0->DATA = PID;                                    /* transmit PID */
    
    while((LPUART0->STAT & LPUART_STAT_TC_MASK) == 0);      /* transmission activity complete */
    
}

If interesting in SDK code then you can refer to lin_master_baremetal demo included in the S32Design Studio, which shows the usage of the LIN driver in master mode.

BR, Petr