I am working on LIN module with MPC5777M EVM board. for that i configure LIN master , LIN Slave and configure GPIOs also. After that i made connection using jumper between PC9(master) and PA13(slave) on MPC5777M EVM board. In that I am able to generate the TX interrupt from the master side and able to see full frame on DSO/CRO also, But the RX interrupt is not trigged for slave to receive frame over the LIN bus(jumper wire) that make connection between master and slave ? Please find the code in following lines :
void LINFlexD_0_Init (void)
{
LINFlexD_0.UARTCR.B.UART = 0 ; // There is no meaning of LIN mode until UART bit is not reset in UARTCR register
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 = 0x0u ;
LINFlexD_0.LINCR1.B.LASE = 1 ; // Enable Auto-synchronization.(available for LINFlexD_0 that working in both master and slave mode)
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)
}
Hi,
For the MPC5777M the possible configuration is mentioned in https://community.nxp.com/thread/470248
BR, Petr