LPUART2 on MCXA153 is not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPUART2 on MCXA153 is not working

974 Views
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?

Labels (1)
Tags (2)
0 Kudos
Reply
4 Replies

907 Views
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 Kudos
Reply

903 Views
Gurunath
Contributor II

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

0 Kudos
Reply

929 Views
pallav_aggarwal
Contributor II

The problem is clock is not enabled for LPUART2.

0 Kudos
Reply

904 Views
Gurunath
Contributor II

Thank you sir

0 Kudos
Reply