Throughout this series we have seen interrupts make firmware more responsive, more accurate, and more efficient. In this final part we bring all of those ideas together in the context of power management. This is where interrupt-driven design pays its biggest dividend. A microcontroller running a polling loop at full speed consumes its maximum current […]
Peripheral Interrupts: UART, SPI, I2C, and ADC
In the previous parts we focused on external pin interrupts and timer interrupts. These are triggered by signals on GPIO pins or by hardware counters. But microcontrollers contain many other built-in peripherals — serial communication interfaces, analog-to-digital converters, and more — and all of them can generate interrupts too. In fact, peripheral interrupts are where […]
Interrupt Priorities, Nesting, and the NVIC
In Parts 1 through 3 we learned what interrupts are, how to write safe ISRs, and how to use timer interrupts for precise periodic tasks. So far we have treated interrupts as if only one can exist at a time. In reality, a microcontroller may have dozens of interrupt sources, and several of them can […]
Timer Interrupts: Precise Timing Without Blocking Your Main Loop
In part 1 and part 2 we covered what interrupts are and how to write safe ISRs. Now we tackle one of the most useful and widely used interrupt sources in embedded systems: hardware timers. Timer interrupts are the backbone of almost every real embedded application — from blinking an LED at an exact frequency, […]
Writing Your First ISR — Rules, Pitfalls, and the volatile Keyword
In Part 1 we established what interrupts are and why they exist. Now it is time to write actual interrupt service routines (ISRs) and learn the rules that keep them working correctly. This is where many beginners run into mysterious bugs — code that works fine until an interrupt fires, then behaves unpredictably. Almost always, […]
What Are Interrupts and Why Do They Exist?
This is first part of an intended series about interrupts. If you are just starting out with microcontrollers or microprocessors, you have probably written a simple program that turns an LED on and off, reads a button, or sends some text over a serial port. These programs usually follow a straight line: do this, then […]
AVRISP mkII
Until recently I have extensively used my MacBook, AVRDude and USBTiny for my μController projects: Now I got myself a proper tool, the AVRISP markII, mostly because I wanted to use AVRStudio 6.0 features: Key features: Programs both flash and EEPROM Supports fuses and lock bit programming Upgradeable for future device support Supports target voltages from […]