The OP
Published on 2022-9-20 18:08
Only look at the author
This post is from GD32 MCU
Latest reply
It is timer_enable(TIMER), which executes the timer first and then turns on the interrupt to enter the interrupt state.
Details
Published on 2023-2-18 08:55
| ||
|
||
2
Published on 2022-9-20 18:26
Only look at the author
This post is from GD32 MCU
Comments
I have already known the answer through experiments. After the timer is initialized, that is, timer_enable(TIMER0); after this sentence is executed, the timer has already started to execute, but the interrupt flag is not turned on at this time, so the interrupt function cannot enter. So as long as the interrupt is turned on, you can enter the interrupt at this time
Details
Published on 2022-9-20 19:15
| ||
|
||
|
This post is from GD32 MCU
Comments | ||
|
||
|
This post is from GD32 MCU
| ||
|
||
|
秦天qintian0303
Currently offline
|
This post is from GD32 MCU
| |
|
||
|
秦天qintian0303
Currently offline
|
This post is from GD32 MCU
| |
|
||
|
7
Published on 2022-9-21 09:00
Only look at the author
This post is from GD32 MCU
| ||
|
||
|
8
Published on 2022-9-21 09:23
Only look at the author
This post is from GD32 MCU
Comments
I used an oscilloscope to see what the naked eye cannot do. My purpose is: there are two switches A and B. After A is turned on, B will delay for a period of time before starting, between 100uS and 5000us. So I use a timer as a control timing, but it seems that the two signals are synchronized. In fact, I want Timer6 to only interrupt each time it is turned on.
Details
Published on 2022-9-21 09:40
| ||
|
||
|
This post is from GD32 MCU
Comments
It is OK to turn off timer 6 after interruption. However, you should check the auto-reload value and reload it every time you start timer 6 in the main program, then enable interruption and start the timer immediately. In this way, the time can be controlled accurately.
Details
Published on 2022-9-21 09:55
| ||
|
||
|
10
Published on 2022-9-21 09:55
Only look at the author
This post is from GD32 MCU
Comments | ||
|
||
|
This post is from GD32 MCU
Comments | ||
|
||
|
12
Published on 2022-9-21 10:34
Only look at the author
This post is from GD32 MCU
| ||
|
||
|
cleverhorse
Currently offline
|
13
Published on 2022-9-22 16:45
Only look at the author
This post is from GD32 MCU
| |
|
||
|
14
Published on 2022-9-23 01:10
Only look at the author
This post is from GD32 MCU
| ||
|
||
|
hustjtj0806
Currently offline
|
15
Published on 2023-2-18 08:55
Only look at the author
This post is from GD32 MCU
| |
|
||
|
论坛测评队员
EEWorld Datasheet Technical Support
EEWorld
subscription
account
EEWorld
service
account
Automotive
development
circle
About Us Customer Service Contact Information Datasheet Sitemap LatestNews
Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190