PIC18F45K22 EUSART1接收并显示在超级终端上

时间:2013-02-14 16:30:33

标签: c pic18 mplab usart

#include <p18f45k22.h>
#include <usart.h>

char uart_rd;

void main(void)
{

ANSELC = 0;

Open1USART(USART_TX_INT_ON &             // disables transmission interrupt     
           USART_RX_INT_OFF &// disables reception interrupt                            
           USART_ASYNCH_MODE & // sets USART to asynchronous mode  
           USART_EIGHT_BIT&  // sets USART to use 8-bit data mode 
           USART_CONT_RX &   // sets the port in continues receive mode 
           USART_BRGH_HIGH,   // uses the low speed Baud rate formula 
          52 // sets Baud to 9600 BPS using 8MHz in calculation (actual baud rate is 9600.614)
            );  

while (1) 
{ 
putrs1USART ("Hello world!\n"); 
} 

} 

我在超级终端上没有得到任何东西。我是否需要在代码中添加或删除任何内容。

非常感谢帮助。

干杯

0 个答案:

没有答案