Enter UART Mode in MPC5604B

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Enter UART Mode in MPC5604B

跳至解决方案
1,290 次查看
liweimin
Contributor II

This is my Code.When I execute in code warrior ,It cannot entern UART mode .Could you please tell me where has problems? Thanks in advance for your kindly help!

LINFLEX_1.LINCR1.B.INIT = 1;    /* Put LINFlex hardware in init mode */

LINFLEX_1.UARTCR.B.UART = 1;    /* Select UART Mode */

LINFLEX_1.UARTCR.R = 0x23;      /* Receive Enable ,8-bit Data, Parity Disable*/

LINFLEX_1.LINIER.B.DRIE = 1;    /* Receive Interrupt Enable */

LINFLEX_1.LINIBRR.B.DIV_M= 0x1B4E; /* Mantissa baud rate divider component */

LINFLEX_1.LINFBRR.B.DIV_F = 0x8; /* Fraction baud rate divider comonent */

LINFLEX_1.LINCR1.R= 0x00000000; /* Configure module as LIN master & header */

标签 (1)
1 解答
1,117 次查看
martin_kovar
NXP Employee
NXP Employee

Hi Li weimin,

Before you are able to switch to UART mode, you have to switch LIN to initialization mode.

Add line LINFLEX_1.LINCR1.B.SLEEP = 0; under the line LINFLEX_1.LINCR1.B.INIT = 1; then it should run.

Do not forget to switch LIN back from initialization mode after you configure all functionality.

Regards,

Martin

在原帖中查看解决方案

2 回复数
1,118 次查看
martin_kovar
NXP Employee
NXP Employee

Hi Li weimin,

Before you are able to switch to UART mode, you have to switch LIN to initialization mode.

Add line LINFLEX_1.LINCR1.B.SLEEP = 0; under the line LINFLEX_1.LINCR1.B.INIT = 1; then it should run.

Do not forget to switch LIN back from initialization mode after you configure all functionality.

Regards,

Martin

1,117 次查看
liweimin
Contributor II

Thankyou verymuch!

0 项奖励
回复