AnsweredAssumed Answered

Problem with LINFlexD LIN frame transmit

Question asked by Xinwei Chang on Mar 14, 2016
Latest reply on Mar 14, 2016 by Xinwei Chang


Below is a LIN frame transmit function, when I run it on 5748G with single step mode, it always stuck here: while(0 == LINFlexD_1.LINSR.B.DTF). Could I missed something at the initial mode?

 

 

void TransmitData(uint16_t bidr_value)

{

    /* store the data in the message buffer BDR */

    LINFlexD_1.BDRL.B.DATA0 = 'H';

    LINFlexD_1.BDRL.B.DATA1 = 'e';

    LINFlexD_1.BDRL.B.DATA2 = 'l';

    LINFlexD_1.BDRL.B.DATA3 = 'l';

   

    LINFlexD_1.BDRM.B.DATA4 = 'o';

    LINFlexD_1.BDRM.B.DATA5 = '!';

    LINFlexD_1.BDRM.B.DATA6 = '!';

    LINFlexD_1.BDRM.B.DATA7 = '!';

 

 

    /* Master to publish x bytes with ID and CCS from bidr_value */

    LINFlexD_1.BIDR.R = bidr_value;

   

    /* Trigger Frame transmission */

    LINFlexD_1.LINCR2.B.HTRQ = 1;   

   

    /* wait until Master response to the LIN header has been sent successfully */

    while(0 == LINFlexD_1.LINSR.B.DTF)

    {

        /* track LIN Status for errors */

 

    }

   

    LINFlexD_1.LINSR.R = 0x0002; /* clear the DTF bit */

}

Outcomes