欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: 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