Whenever you're ready, walk me through how you'd approach this.
Describe how to write an Interrupt Service Routine (ISR). What are the key constraints you must keep in mind to prevent system instability?
Discuss the ISR lifecycle, interrupt acknowledgment, shared data, timing, reentrancy, and how to defer substantial work outside the handler. Include a small C example if useful.
Scope: Embedded C on a microcontroller, with platform-specific register names abstracted away.