Receiver for LIN module with MPC5777M EVM board ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Receiver for LIN module with MPC5777M EVM board ?

633 Views
anishchoudhary
Contributor III

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)
}

Tags (2)
1 Reply

428 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

Simple LINFlex Master/Slave example is given here https://community.nxp.com/docs/DOC-329922

You can easily reuse it for the MPC5777M, the module is the same, just properly configure pins.

For the MPC5777M the possible configuration is mentioned in https://community.nxp.com/thread/470248  

BR, Petr