STC12C5A60S2单片机11.0592晶振实现115200波特率串口通信

/////////STC12C5A60S2单片机11.0592晶振实现115200波特率串口通////////////////////////

/////////STC12C5A60S2或者STC12LE5A60S2单片机均可////////////////////////////////////////

#include "STC12C5A60S2.H"

#include "stdio.h"

void init_uart()

{

PCON&=0x7f;

SCON=0x50;

BRT=0xFD;

AUXR|=0x04;

AUXR|=0x01;

AUXR|=0x10;

}

char putchar(unsigned char i)

{

ES =0;

TI=0;

SBUF=i;

while(TI ==0);

TI=0;

ES =1;

return SBUF;

}

void main()

{ unsigned char i='a';

init_uart();

putchar (i);//重复发送a以测试

}

你可能感兴趣的:(STC12C5A60S2单片机11.0592晶振实现115200波特率串口通信)