Tutorial on STM32 External Interrupts and callback funktions

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 34

  • @simonedecrescenzo8052
    @simonedecrescenzo8052 2 місяці тому +2

    I found this tutorial really helpful as I'm approaching CubeMX and CubeIDE for the first time. Thank you sir, from an Italian student!

    • @prtechtalk416
      @prtechtalk416  23 дні тому +1

      Thanks, Greate to hear that you found it helpful

  • @mikejones-vd3fg
    @mikejones-vd3fg 4 місяці тому +2

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

    • @prtechtalk416
      @prtechtalk416  3 місяці тому

      Thanks for your feedback, /PR TechTalk

  • @ghettodredd
    @ghettodredd 11 місяців тому

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

    • @prtechtalk416
      @prtechtalk416  11 місяців тому +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

  • @osamaqamar6203
    @osamaqamar6203 Місяць тому +1

    hello sir your way of keeping code small in callback function is cool but i was thinking when controller return from performing function which should be in callback function, will it continue it working from previous stage where it was interrupted?

    • @prtechtalk416
      @prtechtalk416  Місяць тому +2

      Short answer: You are correct. After have served the interrupt it restore the run status as it had when the int accured and just proceed.
      /PR TechTalk

  • @KukinhaGamer
    @KukinhaGamer 2 місяці тому +1

    Hello there. You helped me a lot 👍👍👍👍

    • @prtechtalk416
      @prtechtalk416  2 місяці тому +2

      That is Greate to hear. Hope i also gained you as a subscriber :-)
      /PR TechTalk

  • @mohamedanasbenhebibi1511
    @mohamedanasbenhebibi1511 11 місяців тому +2

    Excellent Video.

  • @Musicroombar
    @Musicroombar 5 місяців тому +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  5 місяців тому

      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 10 місяців тому

    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 10 місяців тому

      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  10 місяців тому

      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 10 місяців тому

      Many thanks, Peter!

  • @heronumberone-f6k
    @heronumberone-f6k Рік тому +2

    it is a very informative video---thanks

  • @abirthabti9111
    @abirthabti9111 5 місяців тому +1

    Plz do an application with trust zone enable for stm32h5

    • @prtechtalk416
      @prtechtalk416  5 місяців тому

      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

  • @ghaith210
    @ghaith210 7 місяців тому

    Thanks but what is the role of function callback

    • @prtechtalk416
      @prtechtalk416  7 місяців тому

      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 11 місяців тому +4

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

    • @prtechtalk416
      @prtechtalk416  11 місяців тому

      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

  • @jugnu361
    @jugnu361 Рік тому +2

    Nu cube ide plz
    On bare metal

    • @prtechtalk416
      @prtechtalk416  Рік тому +4

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

  • @TuralMontin-w9k
    @TuralMontin-w9k 11 місяців тому +1

    Subscribed 👍

  • @gireeshkumarks
    @gireeshkumarks Рік тому

    suscribed

  • @soranfatah1033
    @soranfatah1033 3 місяці тому

    you are very slow

    • @prtechtalk416
      @prtechtalk416  3 місяці тому

      Thank you for your “feedback” ??!!!