HAL: #2 How to - GPIO Interrupt

preview_player
Показать описание
In this video, I will show how to use the HAL EXTI Interrupt function.
Before you watch this, please see the video on how to use the STM32CubeMX if you dont already know how to use it.

*** 2 Free Board giveaway has ended ***. Make sure you subscribe and have the notification button on so you will know when you will get a chance to win also a board next time.

Рекомендации по теме
Комментарии
Автор

before this, I was just a nobody who couldn't even interrupt my mother. Now, I know all the ins and outs of HAL programming. I even stood up to my mother yesterday. Thanks a lot man

brdmz
Автор

Your mom: //walks into your room
Her input: 1:31 user manual for *NUCLEAR BOMB*
Your mom: //an *interruption* is triggered

epicmap
Автор

Hi how much is the time between interrupt(falling or rising edge) and function in normal case and how we can decrease this time ?
(Doing the function immediately after interrupt without any delay)

Cyrusradplus
Автор

I tried with SET and RESET than the led blinks very well but why it is not working with interupt

aaakkk
Автор

This is a trap for young players! You should never use an interrupt with an unconditioned mechanical push button, sure it works in simulation but you'll be pulling your hair out debugging the real circuit. There is one exception, when you have a properly designed hardware debounce circuit, but that requires additional components and a more expensive spdt switch.

casholsen
Автор

why you does not use the it.c instead of callback?


i'm trying on l451 nucleo board but into the USER CODE BEGIN/END 4 it's not works

WBrianez
Автор

how its comes to this HAL_GPIO_EXTI_Callback function when pressing button?

varigondasaikrishna
Автор

Thank you for this tutorial. However, I am still confused by the use of the "HAL_GPIO_EXTI_Callback" function. I'm still a learner: to toggle the LED, I would have written the "HAL_GPIO_Toggle" function in the stm32f3xx_it.c file, inside the "void TIM2_IRQHandler(void)" function. I didn't even know it could be done with the "HAL_GPIO_EXTI_Callback" function, in the main.c file. Do you also have a tutorial covering what a "callback" function is?
Thank you in advance.

GammaSigma
Автор

void GPIO_Pin)
{
if(GPIO_Pin == B1_Pin) {
HAL_GPIO_TogglePin(LD4_GPIO_Port, LD4_Pin);
}
else{
__NOP();
}
}

SIR I ADDED THE ABOVE CODE IN MY main.c on my stm32l152rc discovery board but my led at PB6 does not turn on when i press b1 at PA0 can you tell me why. I choose EXTI line0 interrupt in NVIC

aaakkk
Автор

Isn't the nop() unnecesary? Also I believe the falling edge thing is more related to the signal than how B1 is connected, B1 should have a falling and a rising edge.

NeuroMod
Автор

what is the HAL STATEMENT TO TURN ON AN LED

aaakkk
Автор

Can we use for loop, while loop, function call like In Arduino

Here in this software hal using

Shubham-
Автор

void GPIO_Pin)
{
if(GPIO_Pin == B1_Pin) {
HAL_GPIO_Set_Pin(LD4_GPIO_Port, LD4_Pin);
}
else{
__NOP();
}
}

Is the above code is ok for turning on an led by pressin the button

aaakkk