Assembly

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 […]

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 […]

Micro Project IDE - general IDE preferences - colors

Going Low Level

Some time ago I have on boarded on a very ambitious project that I though could be overkill, nevertheless I have persevered in my ambition to prove it is doable. However, as I needed to dig a bit into Assembly language, I have gathered some resources I thought it might be useful to share here.