wambob 发表于 2015-1-5 12:36:03

串口软件里的数据设置不对吧,看你的错误接收好像是字符的ASCII码

QianFan 发表于 2015-1-5 19:10:20

晓枫VS枯叶 发表于 2015-1-5 12:22
我也用过429,没出现这种问题,把SysInit()函数贴出来看看吧,你是基于标准库自己写的吧,表示自己用的时 ...

是不是应该看看PLL_M呢??

suna-2027220 发表于 2015-1-5 21:25:48

QianFan 发表于 2015-1-5 19:10
是不是应该看看PLL_M呢??

void SysInit(void)
{
                //Resets the RCC clock configuration to the default reset state
                RCC_DeInit();
       
                //Configures the External High Speed oscillator (HSE)
                RCC_HSEConfig(RCC_HSE_ON);
       
                //Waits for HSE start-up
                while( RCC_WaitForHSEStartUp() != SUCCESS );
       
                //Configures the main PLL clock source, multiplication and division factors
                //M=8,N=360,P=16,Q=7
                RCC_PLLConfig(RCC_PLLSource_HSE,8,360,2,7);
       
                //Enables or disables the main PLL
                RCC_PLLCmd(ENABLE);
       
                //Configures the system clock (SYSCLK)
                RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
               
                //Loop until the PLL become the SYSCLK source
                while(RCC_GetSYSCLKSource() != 0x08)
       
                //Configures the AHB clock (HCLK)
               RCC_HCLKConfig(RCC_HCLK_Div1);
               
               //Configures the Low Speed APB clock (PCLK1)
               RCC_PCLK1Config(RCC_HCLK_Div4);
               
               //Configures the High Speed APB clock (PCLK2).
               RCC_PCLK2Config(RCC_HCLK_Div2);
       
}

艴小鱼 发表于 2015-1-5 21:35:07

是时钟设置问题么?不懂,帮顶

suna-2027220 发表于 2015-1-5 21:40:00

QianFan 发表于 2015-1-5 19:10
是不是应该看看PLL_M呢??

这个是我抓到的Clock:


Clock该没有什么问题。

QianFan 发表于 2015-1-5 21:43:14

suna-2027220 发表于 2015-1-5 21:40
这个是我抓到的Clock:




小写a的Ascii码是多少来着?那个会不会是Ascill码吗?

数码小叶 发表于 2015-1-5 21:47:34

和速率……猜的

QianFan 发表于 2015-1-5 22:02:06

楼主把标志位TXE换成TC试试看?

suna-2027220 发表于 2015-1-5 22:15:13

问题找到!!!:lol
大伙们分析分析:
去掉下面两句就OK了!
        //GPIO_InitStructure.GPIO_OType=GPIO_OType_PP;
        //GPIO_InitStructure.GPIO_PuPd=GPIO_PuPd_UP;

suna-2027220 发表于 2015-1-5 22:27:43

现在进一步确认:
这个是导致问题的最终元凶:
GPIO_InitStructure.GPIO_OType=GPIO_OType_PP
页: 1 [2]
查看完整版本: STM32F4 USART不正常