Embedded Systems Design Europe - October 2007 - (Page 29) microcontrollers and is illustrated in Figure 1. Because the determination of the idle condition involves testing the variables shared with the foreground (ISRs), the background loop must disable interrupts before detecting the idle condition. Moreover, the idle condition remains valid only as long as interrupts remain disabled. If the interrupts were enabled after the background loop determines that all its work is done for now, but before actually switching to the low-power mode, an interrupt could preempt the background loop at this point and an ISR could produce new work for the background loop, thus invalidating the idle condition. By the simplistic nature of the foreground/background processing, the background loop always resumes at the point it was interrupted, so the back- ground loop would enter the low-power sleep mode while the MCU would have urgent work to do. The MCU will be stopped for a nondeterministic time period until the next interrupt wakes it up. Thus, enabling interrupts before transitioning to a low-power state opens a time window for a race condition between any enabled interrupt and the transition to the low-power mode. Entering a sleep mode while interrupts are disabled poses a chicken-andegg problem for waking the system up, because only an interrupt can terminate the low-power sleep mode. To operate in the foreground/background architecture, the MCU must allow entering the low-power sleep mode and enabling the interrupts at the same time, without creating this race condition. Many MCUs indeed allow such an atomic transition to the sleep mode. Other MCUs support multiple levels of disabling interrupts and can accomplish low-power transitions with interrupts disabled at one level. Yet other MCUs don’t provide any way to enter the low-power mode with interrupts disabled and require some different approaches. HC08 HC08 is an 8-bit MCU family from Freescale Semiconductors. The HC(S)08 instruction set includes two special instructions – WAIT and STOP – for transitioning to the low-power wait and stop modes, respectively.1 The HC08 documentation states very clearly that both WAIT and STOP instructions atomically enable interrupts as a side effect of entering the sleep mode. Clearly, the HC08 designers anticipated that the transition to the low-power mode Listing 1 Code for the CodeWarrior HC08 C-compiler shows a background loop with the atomic transition to the WAIT mode. main() { for (;;) { __asm SEI; if (idle_condition()) { __asm WAIT; } else { __asm CLI; } } } /* /* /* /* /* /* initialization */ for-ever background loop */ the main body of the background loop */ Set Interrupt Mask (disable interrupts) */ idle condition reached? */ atomically enter the WAIT mode */ /* idle condition not reached yet */ /* clear Interrupt Mask (enable interrupts) */ www.embedded.com/europe | embedded systems design europe | OCTOBER 2007 29 028-029-030-031-032-033-034_ESDE29 29 10/10/07 11:37:18 http://www.embedded.com/europe
Table of Contents Feed for the Digital Edition of Embedded Systems Design Europe - October 2007 Embedded Systems Design Europe - October 2007 Contents Linux Set to Dominate Torvalds Updates Linux Kernel ARM Establishes Smart Card Foundry Program Emerson Buys Motorola's Embedded Comms Group LynuxWroks and TTTech to Cooperate on Avionics MontaVista CEO Looks for Acquisitions in Europe Ready: Multiprocessing Technology Provides Opportunity Automotive to Drive MCU Market New Supporters Join COM Express Group Analyst Weighs TI Versus Xilinx Versus PicoChip Cover Feature: Embedded Systems Security Has Moved to the Forefront Trace Exposes the Toughest Real-Time Bugs Employ a Secure Flavor of Linux Use an MCU's Low-Power Modes in Foreground/Background Systems Transporting Video Over Wireless Networks New Products Advertising Contacts Embedded Systems Design Europe - October 2007 Embedded Systems Design Europe - October 2007 - Embedded Systems Design Europe - October 2007 (Page 1) Embedded Systems Design Europe - October 2007 - Embedded Systems Design Europe - October 2007 (Page 2) Embedded Systems Design Europe - October 2007 - Contents (Page 3) Embedded Systems Design Europe - October 2007 - Contents (Page 4) Embedded Systems Design Europe - October 2007 - Contents (Page 5) Embedded Systems Design Europe - October 2007 - ARM Establishes Smart Card Foundry Program (Page 6) Embedded Systems Design Europe - October 2007 - ARM Establishes Smart Card Foundry Program (Page 7) Embedded Systems Design Europe - October 2007 - LynuxWroks and TTTech to Cooperate on Avionics (Page 8) Embedded Systems Design Europe - October 2007 - Ready: Multiprocessing Technology Provides Opportunity (Page 9) Embedded Systems Design Europe - October 2007 - Analyst Weighs TI Versus Xilinx Versus PicoChip (Page 10) Embedded Systems Design Europe - October 2007 - Analyst Weighs TI Versus Xilinx Versus PicoChip (Page 11) Embedded Systems Design Europe - October 2007 - Cover Feature: Embedded Systems Security Has Moved to the Forefront (Page 12) Embedded Systems Design Europe - October 2007 - Cover Feature: Embedded Systems Security Has Moved to the Forefront (Page 13) Embedded Systems Design Europe - October 2007 - Cover Feature: Embedded Systems Security Has Moved to the Forefront (Page 14) Embedded Systems Design Europe - October 2007 - Cover Feature: Embedded Systems Security Has Moved to the Forefront (Page 15) Embedded Systems Design Europe - October 2007 - Cover Feature: Embedded Systems Security Has Moved to the Forefront (Page 16) Embedded Systems Design Europe - October 2007 - Trace Exposes the Toughest Real-Time Bugs (Page 17) Embedded Systems Design Europe - October 2007 - Trace Exposes the Toughest Real-Time Bugs (Page 18) Embedded Systems Design Europe - October 2007 - Trace Exposes the Toughest Real-Time Bugs (Page 19) Embedded Systems Design Europe - October 2007 - Trace Exposes the Toughest Real-Time Bugs (Page 20) Embedded Systems Design Europe - October 2007 - Trace Exposes the Toughest Real-Time Bugs (Page 21) Embedded Systems Design Europe - October 2007 - Employ a Secure Flavor of Linux (Page 22) Embedded Systems Design Europe - October 2007 - Employ a Secure Flavor of Linux (Page 23) Embedded Systems Design Europe - October 2007 - Employ a Secure Flavor of Linux (Page 24) Embedded Systems Design Europe - October 2007 - Employ a Secure Flavor of Linux (Page 25) Embedded Systems Design Europe - October 2007 - Employ a Secure Flavor of Linux (Page 26) Embedded Systems Design Europe - October 2007 - Employ a Secure Flavor of Linux (Page 27) Embedded Systems Design Europe - October 2007 - Use an MCU's Low-Power Modes in Foreground/Background Systems (Page 28) Embedded Systems Design Europe - October 2007 - Use an MCU's Low-Power Modes in Foreground/Background Systems (Page 29) Embedded Systems Design Europe - October 2007 - Use an MCU's Low-Power Modes in Foreground/Background Systems (Page 30) Embedded Systems Design Europe - October 2007 - Use an MCU's Low-Power Modes in Foreground/Background Systems (Page 31) Embedded Systems Design Europe - October 2007 - Use an MCU's Low-Power Modes in Foreground/Background Systems (Page 32) Embedded Systems Design Europe - October 2007 - Use an MCU's Low-Power Modes in Foreground/Background Systems (Page 33) Embedded Systems Design Europe - October 2007 - Use an MCU's Low-Power Modes in Foreground/Background Systems (Page 34) Embedded Systems Design Europe - October 2007 - Transporting Video Over Wireless Networks (Page 35) Embedded Systems Design Europe - October 2007 - Transporting Video Over Wireless Networks (Page 36) Embedded Systems Design Europe - October 2007 - Transporting Video Over Wireless Networks (Page 37) Embedded Systems Design Europe - October 2007 - Transporting Video Over Wireless Networks (Page 38) Embedded Systems Design Europe - October 2007 - New Products (Page 39) Embedded Systems Design Europe - October 2007 - New Products (Page 40) Embedded Systems Design Europe - October 2007 - New Products (Page 41) Embedded Systems Design Europe - October 2007 - New Products (Page 42) Embedded Systems Design Europe - October 2007 - Advertising Contacts (Page 43) Embedded Systems Design Europe - October 2007 - Advertising Contacts (Page 44)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.