?? uart._c
字號:
/*****************************************
串行口測試程序
輸入數據:無
輸出:程序復位后先向串口發送"Hellow Word!",之后每從串口收到一個字符就把它從串口發送出去
作者:蔣劍東
CPU: M16L 晶振:片外8M
修改時間:2004-08-02
*****************************************/
#include "iom16.h"
#include "stdio.h"
#include "macros.h" // 常用的宏定義
#define uchar unsigned char
#define uint unsigned int
void cpu_init(void)
{
CLI();
UBRR = 0x33; // 波特率9600
UCR = 0x18;
}
void main(void)
{
cpu_init();
puts("Hellow Word!");
while(1)
{
while(!(USR&0x80));
UDR=UDR;
while(!(USR&0X40));
USR|0x40;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -