LIN_Master

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,289件の閲覧回数
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,245件の閲覧回数
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,254件の閲覧回数
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,246件の閲覧回数
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,234件の閲覧回数
Ravikumar1
Contributor II

Thank you very much for the information.

0 件の賞賛
返信
2,281件の閲覧回数
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