2020-01-22 07:16 AM
i want to assign a number to parameter in program and check if my parameter is equal to my number , disable a pin after passing a 10 sec.
in the other hand i want to make a off delay timer with HAL library .
i use STM 32 AND KEIL IDE.
2020-01-22 08:07 AM
Ok
What STM32? There's like a thousand different "STM32"
Running at what frequency?
Using interrupts?
Or polling the TIM count?
Perhaps divide a clock down to 10's of milliseconds, and then count those off to get to 10 seconds.
2020-01-22 08:27 AM
Stm32f103c8t6
16 MHZ
i want to use internal interrupts .
and please tell me how to start and stop a timer
2020-01-22 08:34 AM
They have an "Enable" bit, and there is also a One-Shot mode.
Can't you just use a 1ms SysTick, and count off 10,000 ticks? Or make a simple scheduler?
From 16 MHz TIM CLK, using 16-bit Prescaler/Period
Prescaler = 64000-1
Period = 250 - 1
For 1Hz (1 Second)
Prescaler = 64000-1
Period = 2500 - 1
For 0.1Hz (10 Seconds)
An update interrupt will occur at startup (time zero), and every time it subsequently wraps.
2020-01-22 08:36 AM
Homework?
Did you already do a blinky?
Have you read relevant portions of RM0008?
JW
2020-01-25 02:43 AM
just set enable bit to start and clear will stop timer
2020-01-27 09:45 PM
have you done?