AnsweredAssumed Answered

Troubles about operating the main function of STM32F103C8T6

Question asked by ling.letters on Apr 10, 2017
Latest reply on Apr 14, 2017 by ling.letters

Hello~all,thanks for reading my thread.I met some troubles in the process of operating STM32F103C8T6,here this is the STM32F103C8T6's datasheet. does anyone here can help me out?

The program is as following:


            while (1)









                                else                      Line_DDA(XY2_position.x0,XY2_position.y0,XY2_position.x1,XY2_position.y1);




void USART1_IRQHandler(void)        //串口1中断函数



        if(USART1->SR & 0x00000020)//检查指定的USART中断发生与否


                Receie_data[iPose]=USART1->DR & (uint16_t)0x01FF;//读取接收到的数据



                USART1->DR = (flag & (uint16_t)0x01FF);

                while((USART1->SR&0x00000040) == 0);//准备发送一个数据        



When I operated the program in the STM32,the reactive data which were reviewed shows normal.However,It always cant review that flag==1.Whats odd,the ninth digital of reactive data from series shows flag=1. According to its situation,I change another SCM to have a try,its normal in the first programming while there always display that the flag=1 from the second time.

Why? How to solve this problems? Please help me !

Thank you in advance!