34. STM32CubeIDE Button debounce. Interrupt with STM32F103C8T6

  Рет қаралды 22,776

MicroPeta by Nizar Mohideen

MicroPeta by Nizar Mohideen

Күн бұрын

Пікірлер: 35
@tszulpinedo757
@tszulpinedo757 2 жыл бұрын
La gente de India es bien inteligente... Gracias por compartir el conocimiento. Muchas gracias.
@NizarMohideen
@NizarMohideen 2 жыл бұрын
Thanks
@theblitz1687
@theblitz1687 Жыл бұрын
As far as i understood, for a falling edge detector button, this method only prevents debounce during falling edge. But debouncing still can happen while on rising edge. Edit: Figured the rising edge problem by making the button fall/rise and writing the code accordingly
@mckryall
@mckryall 2 жыл бұрын
Great video, thank you! Good idea using the tweezers' cap as a nonconductive rod to poke things with.
@muzaffersemihturan9944
@muzaffersemihturan9944 2 жыл бұрын
very good explanation thank u
@NizarMohideen
@NizarMohideen 2 жыл бұрын
Glad you liked it
@ДмитрийТисов-ж6я
@ДмитрийТисов-ж6я 7 ай бұрын
Спасибо
@shambhusingh5094
@shambhusingh5094 2 жыл бұрын
Very good 👍
@NizarMohideen
@NizarMohideen 2 жыл бұрын
Thank you 👍
@paraskhosla9622
@paraskhosla9622 2 жыл бұрын
but you set the led pin to output like this "GPIOA->ODR |= GPIO_ODR_6;" or you created some function for led to toggle?
@Red_Fang.
@Red_Fang. Жыл бұрын
i want to make long pressed push button, how can i improve debouncing button to make long pressed one ? thank you
@KaiMusic00
@KaiMusic00 3 ай бұрын
Hi there I am using sensor as an input which will turn on the buzzer, and also using EXTERNAL interupt Buthon the to turn off the buzzer and turn on the LED but the code is not working. It is like when I siply power it only do one tast only butten not buzzer and also sensor stop working need help with example
@charnelmane2461
@charnelmane2461 2 жыл бұрын
thank you for this good tutorial can you please do the same thing with an STM32L432KC and three LED?
@NizarMohideen
@NizarMohideen 2 жыл бұрын
Hi Charnel, I don’t have STM32L432 but it is simple. You can set three interrupts and three GPIO_Output. Good luck
@charnelmane2461
@charnelmane2461 2 жыл бұрын
@@NizarMohideen I've already tried this a few times but it doesn't work properly
@NizarMohideen
@NizarMohideen 2 жыл бұрын
Is it working with only one button Click NVIC → EXTI line1 interrupt → Enabled (Tick) You need to tick correct line interrupt for the pin you are using
@charnelmane2461
@charnelmane2461 2 жыл бұрын
@@NizarMohideen ok Thank you verry much i will try it
@AMBOKMUHAMMADFIRDAUSBINIMRAN
@AMBOKMUHAMMADFIRDAUSBINIMRAN 6 күн бұрын
can the ground be connected at the same place
@NizarMohideen
@NizarMohideen 6 күн бұрын
Yes. You can
@KaiMusic00
@KaiMusic00 4 ай бұрын
Can you creat vedio on LIFO and FIFO using GPS DATA
@ruanpotgieter2596
@ruanpotgieter2596 2 жыл бұрын
How does the code look in the main loop? One only calls the function with the pin name as argument?
@NizarMohideen
@NizarMohideen 2 жыл бұрын
We don't check the button condition in the main loop. Instead, the button interrupts and HAL_GPIO_EXTI_Callback is called whenever pressed. For a simple button example, please see video no 14 in my channel
@NizarMohideen
@NizarMohideen 2 жыл бұрын
kzbin.info/www/bejne/j4fFi4VpYqqiga8
@njan1242
@njan1242 Жыл бұрын
I want to make keyboard using push button that use arrow keys, space key, enter key, back space key, shift key
@shambhusingh5094
@shambhusingh5094 2 жыл бұрын
Please explain below condition - What is 10? if (GPIO_Pin == GPIO_PIN_1 && (currentMillis - previousMillis > 10))
@NizarMohideen
@NizarMohideen 2 жыл бұрын
Push button debounces multiple times due to its mechanical nature. For single push, it can send several interrupts. In this video, I have avoided any interrupts within 10 milliseconds from the original interrupt. Depending on the sensitivity of your push button, you can adjust this timing. Thank you
@shambhusingh5094
@shambhusingh5094 2 жыл бұрын
@@NizarMohideen Thank you 😊
@talhadeveci9298
@talhadeveci9298 2 жыл бұрын
@@NizarMohideen is this 10 milisecond delay or timer interrupt ? I mean is the code waiting at 10 milisecond line ?
@NizarMohideen
@NizarMohideen 2 жыл бұрын
10 milisecond is not timer 10 milisecond is not delay 10 milisecond is a counter using HAL_GetTick() We use this counter to check whether the interrupt happened within 10 milisecond from the last interrupt. If it is within 10 milisecond, the interrupt is from the same push of the button, Otherwise it is a another push of the button HAL_GetTick() is similar to millis function in arduino
@mz9zn
@mz9zn 4 ай бұрын
Works very bad and unstable. Sometimes it's ok, sometimes the LED returns to the previous state after button release.
@NizarMohideen
@NizarMohideen 3 ай бұрын
I have used 10 milli seconds to ignore debounce interrupts If the push button is not smooth, you may need to increase the time if (GPIO_Pin == GPIO_PIN_1 && (currentMillis - previousMillis > 10)) ^^^
@mz9zn
@mz9zn 3 ай бұрын
@@NizarMohideen I've already tried to set 50ms, but it doesn't help. Also, it's not a button problem. The same button works flawlessly with 50ms debouncing delay in my PIC code. But I'm new to STM32 and can't make it work yet.
@NizarMohideen
@NizarMohideen 3 ай бұрын
I will search for better way of doing with interrupt service routine. If anything better, I will let you know. In the mean time, you can also search for isr documents in the net. Thanks
@olegdemkiv561
@olegdemkiv561 2 жыл бұрын
Іomeone has the problem this example? I thing, this method work only on the first moment, when you press the button, but if you release the button this method can detect second press.
@atpTUBE
@atpTUBE Жыл бұрын
You should check falling or rising edge of trigger of clock
Interrupts | #8 STM32 GPIO button interrupt
23:48
Terminal Two
Рет қаралды 57 М.
62. STM32CubeIDE Timer Interrupt with STM32F103C8T6
7:18
MicroPeta by Nizar Mohideen
Рет қаралды 22 М.
Wait… Maxim, did you just eat 8 BURGERS?!🍔😳| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 9 МЛН
Trick-or-Treating in a Rush. Part 2
00:37
Daniel LaBelle
Рет қаралды 42 МЛН
Will A Basketball Boat Hold My Weight?
00:30
MrBeast
Рет қаралды 154 МЛН
How to Use a Button with an Arduino (Lesson #5)
20:57
Science Buddies
Рет қаралды 94 М.
#7. EXTernal Interrupt using Registers || STM32F4 || STM32F1 || NO HAL
17:58
STM32 - Debouncing Buttons in Software
9:01
The C Programming Language
Рет қаралды 1,3 М.
14. STM32CubeIDE button. GPIO INPUT with STM32F103C8T6
5:38
MicroPeta by Nizar Mohideen
Рет қаралды 17 М.
11. Install STM32 CubeIDE and LED blink program for Windows (OpenOCD included)
17:56
MicroPeta by Nizar Mohideen
Рет қаралды 72 М.
Tutorial on STM32 External Interrupts and callback funktions
24:31
MOSFETs and Transistors with Arduino
40:50
DroneBot Workshop
Рет қаралды 1 МЛН
Lecture 9: Interrupts
20:43
Embedded Systems and Deep Learning
Рет қаралды 270 М.
Wait… Maxim, did you just eat 8 BURGERS?!🍔😳| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 9 МЛН