<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Interrupt Architecture &amp; Firmware Patterns on Embedded Systems Development</title><link>https://applied-ee.github.io/embedded/docs/digital-interfaces/interrupts/</link><description>Recent content in Interrupt Architecture &amp; Firmware Patterns on Embedded Systems Development</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://applied-ee.github.io/embedded/docs/digital-interfaces/interrupts/index.xml" rel="self" type="application/rss+xml"/><item><title>NVIC Configuration &amp; Priority Grouping</title><link>https://applied-ee.github.io/embedded/docs/digital-interfaces/interrupts/nvic-configuration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://applied-ee.github.io/embedded/docs/digital-interfaces/interrupts/nvic-configuration/</guid><description>&lt;h1 id="nvic-configuration--priority-grouping"&gt;NVIC Configuration &amp;amp; Priority Grouping&lt;a class="anchor" href="#nvic-configuration--priority-grouping"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;The Nested Vectored Interrupt Controller (NVIC) is the hardware block on every ARM Cortex-M processor that arbitrates between interrupt sources, determines which handler runs next, and manages preemption. On STM32F4 and STM32H7 devices, the NVIC implements 4 priority bits per interrupt, yielding 16 priority levels (0-15). Understanding how those bits divide between preemption priority and sub-priority — and what that division means for real-time behavior — is essential to building firmware that responds deterministically under load.&lt;/p&gt;</description></item><item><title>ISR Design Rules</title><link>https://applied-ee.github.io/embedded/docs/digital-interfaces/interrupts/isr-design-rules/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://applied-ee.github.io/embedded/docs/digital-interfaces/interrupts/isr-design-rules/</guid><description>&lt;h1 id="isr-design-rules"&gt;ISR Design Rules&lt;a class="anchor" href="#isr-design-rules"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;An interrupt service routine (ISR) runs in exception context with elevated privileges and a hard constraint: every cycle spent inside the handler is a cycle that no other equal-or-lower-priority interrupt can execute. The fundamental design rule is to do the minimum work necessary — capture the event, copy the data, clear the flag — and defer everything else to the main loop or an RTOS task. Violating this rule produces systems that appear to work on the bench but fail under load, miss deadlines, or corrupt shared state in ways that only surface weeks into deployment.&lt;/p&gt;</description></item><item><title>Shared Data &amp; Volatile Semantics</title><link>https://applied-ee.github.io/embedded/docs/digital-interfaces/interrupts/shared-data-and-volatile/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://applied-ee.github.io/embedded/docs/digital-interfaces/interrupts/shared-data-and-volatile/</guid><description>&lt;h1 id="shared-data--volatile-semantics"&gt;Shared Data &amp;amp; Volatile Semantics&lt;a class="anchor" href="#shared-data--volatile-semantics"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;When a variable is written inside an ISR and read in the main loop (or vice versa), the compiler has no visibility into the asynchronous relationship between those two execution contexts. Without explicit annotation, the optimizer treats the main-loop code as the only thread of execution and may cache the variable in a register, reorder reads and writes, or eliminate accesses entirely. The &lt;code&gt;volatile&lt;/code&gt; qualifier is the primary tool for preventing these optimizations, but it is both necessary in more places than most firmware expects and insufficient in others. Getting this right is the difference between firmware that works reliably and firmware that works only at &lt;code&gt;-O0&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Critical Sections &amp; Interrupt Masking</title><link>https://applied-ee.github.io/embedded/docs/digital-interfaces/interrupts/critical-sections/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://applied-ee.github.io/embedded/docs/digital-interfaces/interrupts/critical-sections/</guid><description>&lt;h1 id="critical-sections--interrupt-masking"&gt;Critical Sections &amp;amp; Interrupt Masking&lt;a class="anchor" href="#critical-sections--interrupt-masking"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;A critical section is a region of code that must execute without interruption — either to protect shared data from concurrent access or to enforce timing guarantees on a sequence of operations. On Cortex-M, critical sections are implemented by masking interrupts: temporarily preventing the processor from responding to interrupt requests while the protected code executes. The cost is interrupt latency — every cycle spent with interrupts disabled is a cycle that incoming interrupts must wait. The design challenge is making critical sections as short as possible while still protecting everything that needs protection.&lt;/p&gt;</description></item></channel></rss>