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 […]
RETI Instructions
If you spend enough time writing interrupt service routines in low-level embedded code, one tiny instruction shows up again and again: RETI. On paper it looks simple. It means RETurn from Interrupt. In practice, though, that small instruction exposes deep architectural differences between microcontroller families. On some CPUs RETI is a real instruction with distinct […]