AnsweredAssumed Answered

LIN on DEVKIT-MPC5748G Board

Question asked by marek czelen on May 25, 2018
Latest reply on May 29, 2018 by marek czelen

Hi

 

I have a question about LIN on DEVKIT-MPC5748G Board.

I am trying to configure it as SLAVE (on the board only LINFlexD_0 available).

 

I configured INPUT anOUTPUT as belo:

    /* Configure PB2 for AF1 func: LIN0TX */
    SIUL2.MSCR[PB2].B.SSS = 1;    /* Pad PB2: Source signal is LIN0_TXD  */
    SIUL2.MSCR[PB2].B.OBE = 1;    /* Pad PB2: Output Buffer Enable */
    SIUL2.MSCR[PB2].B.ODE = 1;    /* Pad PB2: Output Drain Enable */
    SIUL2.MSCR[PB2].B.PUS = 1;    /* Pad PB2: Pull up selected */
    SIUL2.MSCR[PB2].B.PUE = 1;    /* Pad PB2: Pull Enable */
    SIUL2.MSCR[PB2].B.SRC = 3;    /* Pad PB2: Maximum slew rate */

 

    /* Configure  PB3 for LIN0RX */
    SIUL2.MSCR[PB3].B.IBE = 1;    /* Pad PB3: Enable pad for input - LIN0_RXD */
    SIUL2.IMCR[165].B.SSS = 1;   /* LIN0_RXD: connected to pad PB3 */

 

I also configured LIN module:

 


    /* enter INIT mode */
    LINFlexD_0.LINCR1.R = 0x0081; /* SLEEP=0, INIT=1 */

 

    /* wait for the INIT mode */
    while (0x1000 != (LINFlexD_0.LINSR.R & 0xF000)) {}

 

    /* configure baudrate 19200 */
    LINFlexD_0.LINFBRR.R = 3;
    LINFlexD_0.LINIBRR.R = 130;

 

    LINFlexD_0.LINCR2.B.IOBE = 1; /* IOBE=1, Bit error resets LIN state machine */

 

    LINFlexD_0.LINTCSR.R = 0; /* LIN timeout mode, no idle on timeout */

 

    LINFlexD_0.BIDR.B.CCS = 0; /* enhanced checksum for LIN Slave */

 

    LINFlexD_0.LINIER.B.HEIE = 1;

    LINFlexD_0.LINIER.B.DTIE = 1;
    LINFlexD_0.LINIER.B.DRIE = 1;

 

    /* enter NORMAL mode */

    LINFlexD_0.LINCR1.B.LASE = 1;
    LINFlexD_0.LINCR1.B.MBL = 0b0011;
    LINFlexD_0.LINCR1.B.MME = 0;
    LINFlexD_0.LINCR1.B.SSBL = 0;
    LINFlexD_0.LINCR1.B.INIT = 0;

 

I place also interrupts vectors:

(uint32_t) &LINFlexD_0_RX_ISR, /* Vector # 376 LinFLEX0_0 LinFlex_0_RXI */
(uint32_t) &LINFlexD_0_TX_ISR, /* Vector # 377 LinFlex0_1 LinFlex_0_TXI */

 

I am sure that on (LIN0_RX, PB3,  MCU pin 1) signal is proper, but MCU doesn't call interrupt function?

 

I have checked LINESR.SZF is set to "1".

 

Could you give me a suggestion what could be a problem, I wasn't able to find anything in documentation

Outcomes