while(!((CLK_ICKR>>1)&0x01));//等待高速内部RC振荡器就绪
CLK_CKDIVR=0x1c;//8分频
UART1_BRR2=0x00;
UART1_BRR1=0x0d;//9600波特率,2000000/9600=0xd0;
UART1_CR5=0x00;
UART1_CR3=0;
UART1_CR2 = 0x08;//发送使能
UART1_CR1=0x20; //使能URAT1
UART1_SR=0;
void fasong(void)
{
setd_7();//re,de高为发送状态
while(!(UART1_SR&0x80)); //txe不空等待
UART1_DR =0xaa;//发送数据
while(!(UART1_SR&0x40));//发送等待
clrd_7();
}
int main(void)
{
while(1)
{
fasong();
}
}
8s105s4单片机,调试助手没动静,这是怎么回事? |