中级会员
 
- 积分
- 342
- 金钱
- 342
- 注册时间
- 2012-6-27
- 在线时间
- 44 小时
|
1金钱
我在配置串口时候参考原子的代码
temp =((float)32*1000000)/(baund*16);
mantissa =(uint16_t)temp;
fraction =(temp - mantissa) )*16;
mantissa<<=4;
mantissa += fraction;
在程序后面配置GPIOA口时候,
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7; //sck mosi miso
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_40MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
程序不能烧录第二次了,但是把串口修改成这样就可以正常烧录了了
//temp =((float)32*1000000)/(baund*16);
mantissa =17;
fraction =5;
mantissa<<=4;
mantissa += fraction;
有大神知道是怎么回事不
|
|