Tutorial on STM32 External Interrupts and callback funktions

Поделиться
HTML-код
  • Опубликовано: 18 сен 2023
  • In this tutorial, we're going to learn about external interrupts and callback functions on the Nucleo -G491 board. We'll cover the basics of how interrupts and callbacks work, and how to use them in your code.
    This tutorial is perfect for beginners who want to learn about external interrupts and callbacks on the STM32G491 board. If you're ready to start programming on the STM32G491 board, then this tutorial is for you!
  • НаукаНаука

Комментарии • 25

  • @mikejones-vd3fg
    @mikejones-vd3fg 10 дней назад

    Good point about keeping the code small in the callback function and showing how to do it.

  • @mohamedanasbenhebibi1511
    @mohamedanasbenhebibi1511 7 месяцев назад +2

    Excellent Video.

  • @user-ej4mk2tf8f
    @user-ej4mk2tf8f 8 месяцев назад +2

    it is a very informative video---thanks

  • @ghettodredd
    @ghettodredd 7 месяцев назад

    Thanks for the video , would have loved to hear your thoughts on issues to do with debouncing on this type of implementation

    • @prtechtalk416
      @prtechtalk416  7 месяцев назад +1

      Hey, thanks for the comment! I'll definitely keep your suggestion in mind and make a video specifically discussing debouncing issues. Stay tuned for that!
      PR TechTalk

  • @user-nn2ev1nl3x
    @user-nn2ev1nl3x 7 месяцев назад +1

    Subscribed 👍

  • @abirthabti9111
    @abirthabti9111 Месяц назад +1

    Plz do an application with trust zone enable for stm32h5

    • @prtechtalk416
      @prtechtalk416  Месяц назад

      Hi and thanks for your suggestion, TrustZone is a good suggestion so hit the subscribe button and the bell to get notified when/if I release a video on this topic.
      /PR TechTalk

  • @gireeshkumarks
    @gireeshkumarks 9 месяцев назад

    suscribed

  • @ltlt6117
    @ltlt6117 Месяц назад +1

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

    • @prtechtalk416
      @prtechtalk416  Месяц назад

      Hi, one way to measure the time taken is to count MCU cycles, take a note on the current counter on int and then when the callback have started , then you have your time. To minimize time then one way is to maximize clock frequency. Don't forget to hit the Subscribe button :-)
      /PR TechTalk

  • @Kriszu72
    @Kriszu72 6 месяцев назад

    Hi Peter, many thanks for your video tutorials, I learned a lot from them! I tried to write a similar Main.c source code but accidentally added the Callback routine to the "User code begin 2" section. That way the code didn't work. I noticed my fault and moved the Callback routine to "User code begin 4". Do you have any idea why the "4" section is more proper than the "2" section? Both sections are directly in Main() and not within sub-routines. And I assume a Callback routine is called only in case of an interrupt. So I don't see why the position of the Callback routines are important. Thank you!

    • @Kriszu72
      @Kriszu72 6 месяцев назад

      Hi Peter, I'm sorry, I just noticed that I'm wrong, the "User code begin 4" section is outside of Main(). I don't know what's behind this logic but I can accept it. I'm sorry for bothering you!

    • @prtechtalk416
      @prtechtalk416  6 месяцев назад

      Hi Krisztian, greate that you found your bug on your own :-) Placing of code do have some impact.
      I normally place all callbackfunctions in Section 4 and al other rutines in Section 0. But then you also need to declare prototypes for these. You can also put your code in separate .c & .h files and just include them in your main file.

    • @Kriszu72
      @Kriszu72 6 месяцев назад

      Many thanks, Peter!

  • @jugnu361
    @jugnu361 8 месяцев назад +2

    Nu cube ide plz
    On bare metal

    • @prtechtalk416
      @prtechtalk416  8 месяцев назад +4

      Thanks for your input, stay tuned it might come in the future.

  • @ghaith210
    @ghaith210 3 месяца назад

    Thanks but what is the role of function callback

    • @prtechtalk416
      @prtechtalk416  3 месяца назад

      That is up to you to decide what you want to happen. Interrupt and callback is a way to organize your software, and their are several other methods that you can use or combine. Main Loop is One, RTOS is another. all have their pros and cons. /PR TechTalk

  • @Zurenio
    @Zurenio 7 месяцев назад +3

    You place the code in the wrong zone ....!

    • @prtechtalk416
      @prtechtalk416  7 месяцев назад

      Hi Daniel; Ouups I found the error. 21:14 - 22:56. i did indeed put some code outside the "Begin" and "End" statement.
      if i would go to CubeMX and make any changes all this code would be gone.
      So thanks Daniel for having these Hawk Eyes. And if their are any other errors just let me know.
      /Pr TechTalk