想问个Keil自带的工程C:\Keil\ARM\RV30\Examples\Hello的问题,C:\Keil\ARM\RV30\Examples\Hello下编译成功后,烧进LPC2142后,用串口调试工具查看,而串口什么输出都没有。<br /><br />串口调试工具的设置:<br />波特率:9600<br />数据位:8<br />停止位:1<br />校验位:无<br /> <br /><br />下面是C:\Keil\ARM\RV30\Examples\Hello.c的源码<br /><br />#include /* prototype declarations for I/O functions */<br />#include /* LPC21xx definitions */<br /><br /><br />/****************/<br />/* main program */<br />/****************/<br />int main (void) { /* execution starts here */<br /><br /> /* initialize the serial interface */<br /> PINSEL0 = 0x00050000; /* Enable RxD1 and TxD1 */<br /> U1LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */<br /> U1DLL = 97; /* 9600 Baud Rate @ 15MHz VPB Clock */<br /> U1LCR = 0x03; /* DLAB = 0 */<br /><br /> printf ("Hello World\n"); /* the 'printf' function call */<br /><br /> while (1) { /* An embedded program does not stop and */<br /> printf ("Hello World\n");<br /><br /> /* ... */ /* never returns. We've used an endless */<br /> } /* loop. You may wish to put in your own */<br />} /* code were we've printed the dots (...). */<br /><br />请问这是什么原因?会不会是因为LPC2142的晶振是12M的原因?<br />谢谢:)<br /><br /> |
|