Timer interrupt latency on the ATmega328

Sdílet
Vložit
  • čas přidán 27. 08. 2024

Komentáře • 7

  • @SenseiTG
    @SenseiTG Před 2 lety +1

    But, this is written in C. Doesn't the compiler output a few PUSH instructions at entry intro an interrupt? It would be very interesting to know what the actual latency is, for a naked interrupt. Also, it might be worth noting where the jitter comes from. I'm fairly certain that depending on whether the CPU is executing a 1, 2 or 3 cycle instruction at the time the interrupt occurs, the interrupt may be delayed - leading to exactly what we see here :) Very nice video, I like your channel!

    • @uwezimmermann5427
      @uwezimmermann5427  Před 2 lety

      actually you can look into the compiled code - in Microchip Studio there is an assembler output file easily accessible. There is almost no push happening normally, not even the status register is saved.
      However, I was interested in the average latency which happens when writing C-code for these microcontrollers.

  • @avr_stm_pro2955
    @avr_stm_pro2955 Před 2 lety

    Class 🙂👍👍👍

  • @tomaszrybicki8730
    @tomaszrybicki8730 Před 2 lety

    Uwe, Thanks very much for the video like that or the previous one. When Arduino era came nobody really cares about that. Only the library os some kind and fast forward 😀 to not optimal success. I started to get to know about the problems you show using 8051 family and assembler of course.

    • @uwezimmermann5427
      @uwezimmermann5427  Před 2 lety

      That is exactly my feeling. Especially the "maker community" goes for microcontrollers with more and more power, instead of utilizing the power of even a simple beast like the ATmega328. And everyone is relying on poorly documented libraries.

    • @tomaszrybicki8730
      @tomaszrybicki8730 Před 2 lety

      @@uwezimmermann5427we at Lodz University of Technology, Poland are still trying to show students some elements of now called 😀 "bare-metal" programing using some low level methods, but when they got to know C/C++ they'd rather "forget" to use them in future projects.
      Where do you teach your students? Regards. Tom.

    • @uwezimmermann5427
      @uwezimmermann5427  Před 2 lety

      Hi Tom, I am teaching at Uppsala University in Sweden. And in the particular course which is ongoing right now I go as "deep" as C/C++. I just briefly mention assembler programming, but honestly in the case of the gcc-compiler and the AVR-family I would say there is not a big difference - and while we are not really counting clock cycles I still point out the importance of utilizing limited resources in an efficient way. The focus of this course is the close interaction between software and hardware.