LPUART2 on MCXA153 is not working

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

LPUART2 on MCXA153 is not working

765 次查看
Gurunath
Contributor II

Hi, i want to use LPUART2, on Tx(Port3_15) and Rx(Port3_14) pins in my mcxa153 frdm development board, and interfaced to a usb-to-uart converter, but I am not able to see any bytes if I send some string every one sec.

i have enabled the clock for port3 as given below,

CLOCK_EnableClock(kCLOCK_GatePORT3);

//release peripherals from reset.

RESET_ReleasePeripheralReset(kLPUART2_RST_SHIFT_RSTn);

RESET_ReleasePeripheralReset(kPORT3_RST_SHIFT_RSTn);

below is the settings i assigned to LPUART2 Rx (port3_14)  port pin configuration,

port_pin_config_t   port3_14_config = { kPORT_PullUp, kPORT_LowPullResistor, kPORT_FastSlewRate,
kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, 
kPORT_NormalDriveStrength, kPORT_MuxAlt2, kPORT_InputBufferEnable, kPORT_InputNormal,

kPORT_UnlockRegister};

PORT_SetPinConfig(PORT3, 14U, &port3_14_config);

 

below is the settings i assigned to LPUART2 Tx (port3_15)  port pin configuration,

port_pin_config_t   port3_14_config = { kPORT_PullUp, kPORT_LowPullResistor, kPORT_FastSlewRate,
kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, 
kPORT_NormalDriveStrength, kPORT_MuxAlt2, kPORT_InputBufferEnable, kPORT_InputNormal,

kPORT_UnlockRegister};

PORT_SetPinConfig(PORT3, 15U, &port3_14_config);

 

//uart configuration settings

lpuart_config_t config;

LPUART_GetDefaultConfig(&config);
config.baudRate_Bps = BOARD_DEBUG_UART_BAUDRATE; //115200
config.enableTx = true;
config.enableRx = true;

//initializes LPUART2

LPUART_Init(LPUART2, &config, DEMO_LPUART_CLK_FREQ); // clock freq is 12000000

uint8_t txbuff[] = "Lpuart polling example\r\n"; // message to be transmitted

//the below uart tx function is not working for LPUART2 

I am calling it in while loop after after calling, I have given a delay also of around 50mSec.

LPUART_WriteBlocking(LPUART2, txbuff, sizeof(txbuff) - 1);

Please let me know what is wrong or am i missing something?

标签 (1)
标记 (2)
0 项奖励
回复
4 回复数

698 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Gurunath 

Has your problem been solved according to pallav's suggestion? 

If no, tell us. Also there is UART demo under SDK. And can use MCUXpressoo config tool to config, it will generate code automatically.

You can refer to. 

 

BR

Alice

0 项奖励
回复

694 次查看
Gurunath
Contributor II

Yes the issue was clock . It has been resolved Thank You!

0 项奖励
回复

720 次查看
pallav_aggarwal
Contributor II

The problem is clock is not enabled for LPUART2.

0 项奖励
回复

695 次查看
Gurunath
Contributor II

Thank you sir

0 项奖励
回复