stm32f103能用11.0592M的晶振吗,程序要改哪些内容

2025-04-03 07:48:22
推荐回答(1个)
回答1:

#includevoidInitUART(void){TMOD=0x20;SCON=0x50;TH1=0xFD;TL1=TH1;PCON=0x00;EA=1;ES=1;TR1=1;}voidmain(void){unsignedcharc=a1;InitUART();SendOneByte(c);while(1);}voidUARTInterrupt(void)interrupt4{if(RI){RI=0;//addyourcodehere!}elseTI=0;}voidSendOneByte(unsignedcharc){SBUF=c;while(!TI);TI=0;}