3016 views|4 replies

3190

Posts

0

Resources
The OP
 

Serial port interruption problem [Copy link]

This post was last edited by chenbingjy on 2018-1-31 09:29 INTERRUPT_HANDLER(UART1_RX_IRQHandler, 18) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ setUartReceivedFlag(); Receive_Buffer[Receive_Cnt++] = UART1_ReceiveData8(); //?áè?′??ú?óê?êy?Y if(Receive_Cnt >= 600) Receive_Cnt = 0; UART1_ClearITPendingBit(UART1_IT_RXNE); //?D???o3???ê?·? ò??ú // ReceiveTime = 2; //éè??3?ê±±?á?£?ó???ò?êy?Y2?μ?3?1y20ms } I use STMS207C8T6 to write programs. The above is my serial port interrupt program. Please take a look. What's the problem? I always feel like there's something wrong here. Thanks!

This post is from stm32/stm8

Latest reply

The clock is the premise of the whole program. If it is not set correctly, it will affect your baud rate. The simplest way is: after setting the system clock, use the LED to flash once every 1S.  Details Published on 2018-1-31 15:09
Personal signature为江山踏坏了乌骓马,为社稷拉断了宝雕弓。
 

3471

Posts

11

Resources
2
 
I always feel that there is something wrong here. What is your basis? Look at the specific problem and see what it is. You can refer to the official routine.
This post is from stm32/stm8

Comments

There seemed to be something wrong there. Later I found out that there was something wrong with the clock configuration.  Details Published on 2018-1-31 13:46
There seemed to be something wrong there. Later I found out that there was something wrong with the clock configuration.  Details Published on 2018-1-31 13:46
 
 

3190

Posts

0

Resources
3
 
ienglgge posted on 2018-1-31 13:41 I always feel that there is a problem here. What is your basis? See what the specific problem is. You can refer to the official routine.
There seems to be a problem in that place. Later I found that there was a problem with the clock configuration.
This post is from stm32/stm8
 
Personal signature为江山踏坏了乌骓马,为社稷拉断了宝雕弓。
 

3190

Posts

0

Resources
4
 
ienglgge posted on 2018-1-31 13:41 I always feel that there is a problem here. What is your basis? See what the specific problem is. You can refer to the official routine.
There seems to be a problem in that place. Later I found that there was a problem with the clock configuration.
This post is from stm32/stm8

Comments

The clock is the premise of the whole program. If it is not set correctly, it will affect your baud rate. The simplest way is to set the system clock and use the LED to flash once every 1s.  Details Published on 2018-1-31 15:09
 
Personal signature为江山踏坏了乌骓马,为社稷拉断了宝雕弓。
 
 

4177

Posts

9

Resources
5
 
chenbingjy posted on 2018-1-31 13:46 There seems to be a problem in that place. Later I found that there was a problem with the clock configuration.
The clock is the premise of the whole program. If it is not set correctly, it will affect your baud rate. The simplest way is: after setting the system clock, use the LED to flash once every 1S.
This post is from stm32/stm8
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list