#include <iom8V.h>
unsigned char temp;
//主函數
void main(void)
{
DDRD=0xff; //設置D口為推挽1輸出
PORTD=0x00;
OSCCAL=0xaa; //校正內部RC振蕩器頻率,不同的芯片參數有差異
UCSRB=0x18; //RXD.TXD使能
UBRR=51; //9600bps,8.0M
UCSRC=0X86; //8位數據,1位停止位,無校驗
while(1)
{
while(!(UCSRA&0x80)); //等待接收完成
temp=UDR; //接收數據
PORTD=temp;
while(!(UCSRA&0x20)); //等待移位寄存器空
UDR=temp; //發送數據
}
}
這是什么程序
???????
歡迎光臨 (http://www.raoushi.com/bbs/) | Powered by Discuz! X3.1 |