AnsweredAssumed Answered

Receiver for LIN module with MPC5777M EVM board ?

Question asked by anishchoudhary on Feb 21, 2018
Latest reply on Mar 28, 2018 by Petr Stancik

With the MPC5777M EVM board I am trying to get frame in reception side after sending  frame from transmission (master) side but before sending the data LIN slave goes in idle mode and not come out from the idle mode i set the wake-up register also but its not came out. how i fixed that issue ? Please find the code below :


    LINFlexD_0.LINCR1.B.INIT = 1 ;                    // Put LINFlex hardware in init mode to come out reset that INIT bit
    LINFlexD_0.LINCR1.B.SLEEP = 0 ;               // Disable the request of sleep mode in LIN

    while ((LINFlexD_0.LINSR.B.LINS & 0x1) != 0x1 )
       {
           // Wait for INIT mode of LIN module
       }

    LINFlexD_0.LINSR.B.AUTOSYNC_COMP = 1 ;

 

    LINFlexD_0.LINIBRR.B.IBR = 480 ;
    LINFlexD_0.LINFBRR.B.FBR = 0 ;

 

    LINFlexD_0.LINCR2.B.IOBE = 1 ;                    // IOBE field: When slave = 0, this field always reads ‘0’ and cannot be programmed else this bit is programmable and reset value is 1.
    LINFlexD_0.LINTCSR.R = 0 ;                        // Avoid that get slave in idle state
    LINFlexD_0.BIDR.B.CCS = 0x1u ;                    // Checksum(CCS)=1 (1.3 and lower version of LIN)
    LINFlexD_0.LINCR1.B.LASE = 1 ;                    // Enable Auto-synchronization for LIN0.
    LINFlexD_0.LINCR1.B.AUTOWU = 1 ;                   // Auto-wake up is enabled to detecting a falling edge in sleep mode
    LINFlexD_0.LINCR1.B.CCD = 0x0u ;                // Checksum is calculated by hardware only if this bit is reset.

 

    LINFlexD_0.IFER.R = 0xF;                        // Enable filters 0-3(4 filters)
    LINFlexD_0.IFMR.R = 0x0;                        // Filters 0 - 3 are in identifier list mode. 0 = Filters 2n and 2n+1 are in identifier list mode.

 

    LINFlexD_0.IFCR[0].R = 0x1E37;                    // 8bytes, TX data(in response part of LIN frame), ID=0x37, CCS=1
    LINFlexD_0.IFCR[1].R = 0x1C35;                    // 8bytes, RX data(from response part of LIN frame), ID=0x35, CCS=1
    LINFlexD_0.IFCR[3].R = 0x1F38;                    // 8bytes,TX data(in response part of LIN frame), ID=0x38, CCS=1
    LINFlexD_0.IFCR[3].R = 0x1D34;                    // 8bytes, RX data(from response part of LIN frame), ID=0x34, CCS=1

 

    LINFlexD_0.LINCR1.B.MBL = 0x3u ;                // MBL=3 (Master Break Length)
    LINFlexD_0.LINCR1.B.MME  = 0x0u ;                // MME=0 (Slave)
    LINFlexD_0.LINCR1.B.INIT = 0x0u ;                // INIT=0 (Normal mode)
}

Outcomes