亚洲春色中文字幕久久久-三上亚,一吻二脱三床四吻胸,国产真实伦对白视频全集,在线毛片观看,精品成品入口黄网,国产毛aⅴ片久久久,亚洲AV色香蕉一区二区三区老师,萧皇后A级艳片,色情日本视频更新,99久久亚洲精品日本无码

標(biāo)題: 關(guān)于STC12C5A60S2串口2的程序,用串口調(diào)試助手收不了數(shù)據(jù)。求高手指點(diǎn) [打印本頁]

作者: qsherong    時(shí)間: 2012-8-3 13:53
標(biāo)題: 關(guān)于STC12C5A60S2串口2的程序,用串口調(diào)試助手收不了數(shù)據(jù)。求高手指點(diǎn)
#include "12C5A60S2.h"
#define uint8 unsigned char
#define uint16 unsigned int
uint8 num=0;
void UartInit(void)  //9600bps@11.0592MHz
{
AUXR &= 0xf7;  //波特率不倍速
S2CON = 0x50;  //8位數(shù)據(jù),可變波特率
BRT = 0xFD;      //設(shè)定獨(dú)立波特率發(fā)生器重裝值
AUXR &= 0xfb;  //獨(dú)立波特率發(fā)生器時(shí)鐘為Fosc/12,即12T
AUXR |= 0x10;  //啟動(dòng)獨(dú)立波特率發(fā)生器
EA=1;
IE2=0x01;

void send(uint8 ch)
{

IE2=0x00;   
S2CON&=~S2TI; 
S2BUF=ch;     
while(!(S2CON&S2TI)); 
S2CON &=~S2TI;  
IE2=0x01;   
}


void main()
{
UartInit();
while(1);
}
void Uart2() interrupt 8       
{
if(S2CON&S2RI)
{
  S2CON&=~S2RI;
  num=S2BUF;
  send(num);
}
}




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