AnsweredAssumed Answered

SPC570S50E1 UART Confinguration

Question asked by Abdul Basit Khan on Mar 29, 2018
Latest reply on Mar 29, 2018 by Erwan Y

Hello Everyone!

I am trying to configure LIN_FLEX_0 channel for UART communication. Following is my code for the configuration.

#define LIN_CH0 LINFLEXD_0

LIN_CH0.LINCR1.B.INIT=1;         /* Put LIN into INIT mode to configure */

LIN_CH0.UARTCR.B.UART=1;             /* UART enable  */

LIN_CH0.UARTCR.B.ROSE=1;

LIN_CH0.UARTCR.B.OSR=4;

LIN_CH0.LINIBRR.R=200;     /* 100  kbits Buad Rate is selected .   80Mbits/(LINIBRR*OSR)   */

LIN_CH0.UARTCR.B.WL0=1;           /* Receive 8 bits  */

LIN_CH0.UARTCR.B.PCE=0;           /* Receive 8 bits without parity bit  */

LIN_CH0.UARTCR.B.RXEN=1;              /* Receiver Enable */

LIN_CH0.UARTCR.B.WL1=1;           /* Receive 8 bits  */

LIN_CH0.UARTCR.B.RFBM=0;            /* Rx Buffer Mode */

LIN_CH0.UARTCR.B.RDFL_RFC=3;           /* 4 bytes will be received */

LIN_CH0.UARTCR.B.WLS=0;           /* Special Word Length in UART is disabled  */

LIN_CH0.LINCR1.B.SLEEP=0;

LIN_CH0.UARTSR.R=0xFFFF;    /* Clearing UARTSR register.*/

LIN_CH0.LINIER.B.FEIE=1;

LIN_CH0.LINIER.B.DRIE=1;

LIN_CH0.LINIER.B.BOIE=1;

LIN_CH0.LINIER.B.SZIE=1;

LIN_CH0.LINCR1.B.INIT=0;        /* INITIAL MODE is finished to enter into NORMAL Mode   */

 

The problem is that when i Run this code and check LINFLEXD_0_UARTCR  Register then still it show some default values and does not initialize according to my code.  Please check the attached figure for UARTCR register. 

 

Can anyone please help me in initializing the LIN_FLEX_0 for UART communication..

 

Attachments

Outcomes