UART not working

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

UART not working

1,322件の閲覧回数
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 件の賞賛
返信
3 返答(返信)

1,216件の閲覧回数
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 件の賞賛
返信

1,199件の閲覧回数
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 件の賞賛
返信

1,192件の閲覧回数
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 件の賞賛
返信