UART not working

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

UART not working

998 Views
coder1610
Contributor I

I want to use LPC804M101JDH24 for serial communication. I have attached code which is not working.

It seems that the character is not received. I have used PIO0_4 and PIO0_0 as TX and RX and linked all necessary header files as well.

Please suggest what is wrong in code.

Thanks in advance.

0 Kudos
3 Replies

892 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

You gave us only part of code, I do not know if you understand how to initialize the SWM:

Enable_Periph_Clock(CLK_SWM);

SWM->PINASSIGN_DATA[0]=0x0000;

SWM->PINASSIGN_DATA[0]|=4<<0|0<<8;

xiangjun_rong_1-1713331624280.png

Then PIO0_4  will function as UIART0_TXD, PIO0_0 will function as UART0_RXD

If the uart0  receiver can not get char, pls check the baud rate.

Hope it can help you

BR

XiangJun Rong

 

 

0 Kudos

875 Views
coder1610
Contributor I

Well I have included swm.h file, which is attached here.

Also, baud rate is 9600 which is not an issue.

Please help.

Thank you.

0 Kudos

868 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls write a code to repeat to output char, then connect a scope to an scope and check if you can see the waveform and check the baud rate.

Hope it can help you

BR

XiangJun Rong

0 Kudos