1024手机基地看电影,午夜福利视频导航,国产精品福利在线一区,亚洲欧美日韩另类成人,在线观看午夜日本理论片,成年超爽免费网站,国产精品成人免费,精品动作一级毛片,成人免费观看网站,97精品伊人久久大香蕉

標題: HT46串口通信 [打印本頁]

作者: yangjinze    時間: 2012-1-6 19:30
標題: HT46串口通信

#include......

#pragma vector uart_isp @ 0x10;
unsigned int data;

void delay(unsigned int time)//延時函數,省略內容
{......
}

void uart_init()//初始化函數
{
_urc1=0x80;
_urc2=0xe4;
_brg=51;
_euri=1;//開串口中斷
_emi=1;//開總中斷
}

void uart_send(unsigned int data)//發送函數
{
unsigned int i;
_txen=1;
i=_usr;
_txr_rxr=data;
while(~_tidle);
}
void uart_isp()//接收函數
{
a[0]=a1];
a[1]=a[2];
data=_txr_rxr;
while(~_ridle);

}
void main()
{
uart_init();
while(1)
{
uart_send(w[0]);
uart_send(w[1]);
uart_send(w[2]);
delay(..)//延時

}
盛群單片機HT46的串口通信,目的是發送三個自己從鍵盤輸入的字符給單片機,然后單片機發送一樣的字符到電腦;
為什么實現不了,求正確例程與解釋

[此貼子已經被作者于2012-1-6 19:30:56編輯過]





歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1