Problem with LINFlexD LIN frame transmit

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem with LINFlexD LIN frame transmit

1,444件の閲覧回数
xinweichang
Contributor III


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 */

}

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

997件の閲覧回数
martin_kovar
NXP Employee
NXP Employee

Hi,

about the code, please check this example. It shows, how to use LINFlexD module. Example is created for MPC5744P, but the modules are similar.

Example MPC5744P LIN Master Slave test GHS614

Check also SIUL2 configuration and jumper settings (SIUL2 configuration will be probably different from example above).

Regards,

Martin

0 件の賞賛
返信

997件の閲覧回数
xinweichang
Contributor III

I think no LIN frame was sent out after HTRQ was set

0 件の賞賛
返信