打印
[ZLG-ARM]

LPC2142的串口输出问题

[复制链接]
950|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
chgw|  楼主 | 2007-8-16 22:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
想问个Keil自带的工程C:\Keil\ARM\RV30\Examples\Hello的问题,C:\Keil\ARM\RV30\Examples\Hello下编译成功后,烧进LPC2142后,用串口调试工具查看,而串口什么输出都没有。

串口调试工具的设置:
波特率:9600
数据位:8
停止位:1
校验位:无
 

下面是C:\Keil\ARM\RV30\Examples\Hello.c的源码

#include                 /* prototype declarations for I/O functions */
#include               /* LPC21xx definitions                      */


/****************/
/* main program */
/****************/
int main (void)  {                /* execution starts here                    */

  /* initialize the serial interface   */
  PINSEL0 = 0x00050000;           /* Enable RxD1 and TxD1                     */
  U1LCR = 0x83;                   /* 8 bits, no Parity, 1 Stop bit            */
  U1DLL = 97;                     /* 9600 Baud Rate @ 15MHz VPB Clock         */
  U1LCR = 0x03;                   /* DLAB = 0                                 */

  printf ("Hello World\n");       /* the 'printf' function call               */

  while (1) {                     /* An embedded program does not stop and    */
  printf ("Hello World\n");

 /* ... */                  /* never returns.  We've used an endless    */
  }                               /* loop.  You may wish to put in your own   */
}                                 /* code were we've printed the dots (...).  */

请问这是什么原因?会不会是因为LPC2142的晶振是12M的原因?
谢谢:)

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2

主题

2

帖子

1

粉丝