Timer interrupt latency on the ATmega328

  Рет қаралды 567

Uwe Zimmermann

Uwe Zimmermann

Күн бұрын

How long does it take before an interrupt service routine is started on an ATmega328 after the actual trigger event?
The answer is: about 19-20 CPU clock cycles as you can see in the video.

Пікірлер: 7
@avr_stm_pro2955
@avr_stm_pro2955 2 жыл бұрын
Class 🙂👍👍👍
@SenseiTG
@SenseiTG 2 жыл бұрын
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 2 жыл бұрын
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.
@tomaszrybicki8730
@tomaszrybicki8730 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
@@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 2 жыл бұрын
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.
6 Horribly Common PCB Design Mistakes
10:40
Predictable Designs
Рет қаралды 182 М.
ATmega328 and PlatformIO - no Arduino!
16:21
Uwe Zimmermann
Рет қаралды 11 М.
How Many Balloons Does It Take To Fly?
00:18
MrBeast
Рет қаралды 185 МЛН
Gym belt !! 😂😂  @kauermtt
00:10
Tibo InShape
Рет қаралды 16 МЛН
What is an API Gateway?
10:19
IBM Technology
Рет қаралды 299 М.
Digital vs Analog. What's the Difference? Why Does it Matter?
7:12
Basics Explained, H3Vtux
Рет қаралды 188 М.
The RS-232 protocol
26:10
Ben Eater
Рет қаралды 828 М.
Why Are There No Computers in DUNE When Space Travel Exists ?
14:49
Kroft talks about Movies
Рет қаралды 6 М.
Op-Amps  - Using Operational Amplifiers
44:21
DroneBot Workshop
Рет қаралды 275 М.
RTAI - Measuring Interrupt Latency
10:47
aldo núñez
Рет қаралды 6 М.
What is Interrupt Latency ?
2:30
RTOS LOGICS
Рет қаралды 2,3 М.
How LoRa Modulation really works - long range communication using chirps
27:38
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 1 МЛН
BEKMOBILDA Tecno Camon 30 smartfoni🔥🤩 #bekmobil
1:01
Bekmobil shorts
Рет қаралды 2,3 МЛН
Ноутбук за 20\40\60 тысяч рублей
42:36
Ремонтяш
Рет қаралды 371 М.
iPhone 15 Pro Max vs IPhone Xs Max  troll face speed test
0:33