Microcontroller Interrupts | Embedded System Project Series #17

preview_player
Показать описание
I explain how microcontroller interrupts work by mixing theory with a code example. For fun, I let ChatGPT generate my code example. I also add some functions in my project that lets me add new GPIO interrupts more easily. Finally, I bump the clock speed of my microcontroller from 1 MHz to 16 MHz, not because I need to, but because I can.

0:00 Outline
3:12 Why polling is bad
9:40 How does interrupts work?
20:30 Interrupt advantages
21:38 ChatGPT code example
25:56 Interrupt vector table
28:47 Disassembly of ISR
30:36 GPIO interrupts in my project
38:25 PORT1 and PORT2 ISRs
42:30 Test my code
44:25 Fix my code
46:43 Commit 1
47:27 Increase clock speed
53:25 Commit 2

#embeddedsystems #cprogramming #microcontroller

🌍 Links related to this video

🌍 Find me here

👨‍💻 About me
Hi and welcome. I'm Niklas, an embedded systems engineer from Sweden. On this channel, I make practical videos about embedded systems or, in general terms, about building and programming hardware.
Рекомендации по теме
Комментарии
Автор

Better than my university tutor, thanks!

alexdai_
Автор

Best explanation of interrupts I have ever seen! Please keep making such quality content.

subashgowtham
Автор

Thank you for such a good educational video! I am lerning the subject, which called "Operating System" and this explanation about microcontrollers interruption gave me much clear vision on how pc works.

contarr
Автор

Beautiful series! Everytime I come back to these videos I appreciate them even more, thank you man!

reinasama
Автор

There is a mistake in the code at 50:55. It should be:
BCSCTL1 = CALBC1_16MHZ;
DCOCTL = CALDCO_16MHZ;
I shouldn't or them. I notice and fix this in my next video.

artfulbytes
Автор

Your explanations in the videos are pretty clear and understandable. Thanks a lot. 👏👏👍

furkanozata
Автор

The use of simple data types (such as uint8_t) and the direct manipulation of pointers and ISR function registration indicates your attempt to write code that is intended to run very efficiently on small, resource-limited Atmel microcontrollers. Rather than being called, inline functions are inserted directly at the call point, eliminating the overhead associated with calling the function (stack preparation, jumping to the function and returning). This can save several CPU cycles. As I wrote this is a good resource if you need to stuff a lot of code into a limited microcontroller.

marekwolanin
Автор

Pretty much well explained, amazing content about interrupts.

raghunathpalla
Автор

Nice video series. It would be great if you can make one series on embedded Linux operating system based on yocto framework.

connectmekarthik
Автор

One question if the IVT is in the flash how can you change the ISR?

babis
Автор

Hey, which linux do you use and what is the name of that embedded system IDE name? -Thank you!

madhusudhanan
Автор

Please show us how to mount a flamethrower!

nfjeldberg
Автор

Ur an awesome & exceptional artist cum programmer cum hardware engineer ??? ....The IIT's in India need you .

I need some help from you

Can we get together & start a company . There are lots of oppurtunities in India we can focus on Iot / bluetooth products and sell them in the international market. The dev/qa labour cost is very cheap in India

Love to hear from you

zameerahmed