34. STM32CubeIDE Button debounce. Interrupt with STM32F103C8T6

  Рет қаралды 20,438

MicroPeta by Nizar Mohideen

MicroPeta by Nizar Mohideen

2 жыл бұрын

STM32 Blue Pill for beginners
Code and diagram are at www.micropeta.com/video34

Пікірлер: 32
@mckryall
@mckryall 2 жыл бұрын
Great video, thank you! Good idea using the tweezers' cap as a nonconductive rod to poke things with.
@tszulpinedo757
@tszulpinedo757 Жыл бұрын
La gente de India es bien inteligente... Gracias por compartir el conocimiento. Muchas gracias.
@NizarMohideen
@NizarMohideen Жыл бұрын
Thanks
@muzaffersemihturan9944
@muzaffersemihturan9944 2 жыл бұрын
very good explanation thank u
@NizarMohideen
@NizarMohideen 2 жыл бұрын
Glad you liked it
@theblitz1687
@theblitz1687 11 ай бұрын
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
@shambhusingh5094
@shambhusingh5094 2 жыл бұрын
Very good 👍
@NizarMohideen
@NizarMohideen 2 жыл бұрын
Thank you 👍
@paraskhosla9622
@paraskhosla9622 Жыл бұрын
but you set the led pin to output like this "GPIOA->ODR |= GPIO_ODR_6;" or you created some function for led to toggle?
@user-br6gp7hc4l
@user-br6gp7hc4l 3 ай бұрын
Спасибо
@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 20 күн бұрын
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 жыл бұрын
kzfaq.info/get/bejne/j7ySjbVkkqvTe4E.html
@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
@njan1242
@njan1242 9 ай бұрын
I want to make keyboard using push button that use arrow keys, space key, enter key, back space key, shift key
@mz9zn
@mz9zn Күн бұрын
Works very bad and unstable. Sometimes it's ok, sometimes the LED returns to the previous state after button release.
@NizarMohideen
@NizarMohideen Күн бұрын
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 Күн бұрын
@@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 22 сағат бұрын
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 10 ай бұрын
You should check falling or rising edge of trigger of clock
@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
Tutorial on STM32 External Interrupts and callback funktions
24:31
33. STM32CubeIDE internal temperature sensor with STM32F103C8T6
7:33
MicroPeta by Nizar Mohideen
Рет қаралды 12 М.
1 or 2?🐄
00:12
Kan Andrey
Рет қаралды 55 МЛН
I Can't Believe We Did This...
00:38
Stokes Twins
Рет қаралды 102 МЛН
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 4,5 МЛН
14. STM32CubeIDE button. GPIO INPUT with STM32F103C8T6
5:38
MicroPeta by Nizar Mohideen
Рет қаралды 14 М.
29. STM32CubeIDE SD CARD. SPI with STM32F103C8T6
14:45
MicroPeta by Nizar Mohideen
Рет қаралды 22 М.
Lecture 11: External interrupts (EXTI)
12:50
Embedded Systems and Deep Learning
Рет қаралды 60 М.
Hardware interrupts
27:36
Ben Eater
Рет қаралды 590 М.
HAL: #2 How to - GPIO Interrupt
4:35
Web learning
Рет қаралды 62 М.
STM32CubeIDE basics - 04 EXTI HAL lab
15:34
STMicroelectronics
Рет қаралды 45 М.
STM32 BLUEPILL USB BOOTLOADER SUPPORT
7:02
Saravanan AL
Рет қаралды 29 М.
46. STM32CubeIDE Internal RTC. Alarm with STM32F103C8T6
10:28
MicroPeta by Nizar Mohideen
Рет қаралды 14 М.