Need help on M5211DEMO UART program

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

Need help on M5211DEMO UART program

2,299 次查看
MrWrong
Contributor I
Hi all,

I'd like to write a simple program to test the UART on M5211DEMO board. My program just needs to get a character sent by the PC COM1 port. Since I am a newbie to this board, can anyone help me get started?

Thank you.
标签 (1)
0 项奖励
回复
2 回复数

1,086 次查看
J2MEJediMaster
Specialist I
If you're using Codewarrior, take a look in the (Codewarrior Examples) directory. There are several example programs in there, one which has some UART code. This should help jump-start your work.

---Tom
0 项奖励
回复

1,086 次查看
MrWrong
Contributor I
Thank you very much for your reply.

Yes, I'm using the CodeWarrior software version 6.3. I looked into the (CodeWarrior Examples) folder and saw that M5208EVB using UART codes. However, the program does not show me how to read a character from UART. Are these the following steps we should do to use the UART in M5211DEMO board:
1. Initialize UART by uart_init(0, 83333, 19200, 0)
2. Wait for a character being present at the UART by uart_getchar_present(0)
3. If a character is present, read it by uart_getchar(0)

Please let me know if I'm missing out anything or is it the right process to do with UART?

Thank you very much.
0 项奖励
回复