The technical field of this invention is an electronic device with a central processing unit and more particularly an interrupt control mechanism and a corresponding method.
Applications or functionalities are often controlled by central processing units (CPUs) such as microcontrollers or microprocessors. Many applications only require a specific functionality or control task to be performed for a very short time. If not used the CPU enters into a sleep mode or inactive mode to reduce power consumption of the CPU to a minimum. The CPU can then be woken up by an interrupt signal (interrupt) to control or serve a functional stage linked with the interrupt. A functional stage linked with the interrupt means can generate the interrupt itself or can perform the necessary steps required when an interrupt is received by the CPU.
An interrupt generally relates to a specific event, which can be that a specific amount of time has expired or that some data arrived at an interface or various other events. Many different interrupts are typically used for microcontroller or microprocessor based applications. The interrupts are routed by an interrupt controller, which manages and organizes plural interrupts for all kinds of events before they are transferred to the CPU. Once the interrupt is received, the CPU executes a specific subroutine (software program code). The start address of this specific subroutine is determined by an address pointer or a look-up table associated with the interrupt.
Some of these subroutines need hardware functional blocks to perform a specific functionality. For example, the CPU may be required to read in a digital value from an analog-to-digital (ADC) converter responsive to an interrupt. Before this can be done, the ADC must be switched on. This may require several reference stages to be powered on or other related stages to settle before the ADC can be used. Further, the ADC may also need some time (conversion time) before valid digital output is available. The CPU is active and consuming power during the time needed to settle the ADC. Both the power consumed to power up the ADC and the power consumed by the CPU contribute to the overall power consumption. In prior art solutions, the CPU must be activated to qualify the interrupt and to switch on the ADC. Thus the CPU can not be switched off. Some prior art solutions minimize the settling time of the functional stage by speeding up the settling behavior. This often increases the power consumption.
It is an object of the present invention to provide an electronic device including a CPU with reduced power consumption.
Accordingly, the present invention provides an electronic device including a CPU configured to be switched from a first mode into a second mode in response to an interrupt received from an interrupt generating stage. An interrupt relay is coupled between the interrupt generator and the CPU. A functional stage is coupled to the interrupt relay and functionally linked with the interrupt to be used during the second mode of the CPU. The interrupt relay relays the received interrupt to the CPU only after a time needed for the functional stage to settle. In the present context, settling means that the functional stage provides a specific functionality or enters into a specific internal activation state. Generally, the CPU consumes less power in the first mode (which is a sleep inactive mode) than in the second, active mode. The interrupt is not immediately routed to the interrupt controller, but is logically qualified or evaluated before being routed. Only after the functional stage becomes available by activating, settling or entering into a specific state, does the interrupt relay route the interrupt to the CPU and become valid. No power is used by the CPU while waiting for the functional stage to become available. This reduces the power consumed by the device.
The interrupt relay sends a wake up signal to the functional stage after receipt of the interrupt. This means the CPU does not have wake up to wake up the functional stage. The functional stage transmits a release signal to the interrupt relay to indicate that it has settled and is available. The interrupt relay relays the received interrupt only after receipt of the release signal. The CPU wakes up only after the functional stage has settled. Power can be saved by not waking up the CPU during the settling time of the functional stage.
The functional stage may be any analog or digital module such as a reference voltage generator, an analog-to-digital converter or a digital interface controller. This device may be used for any complex analog or digital functionality, for example communications interfaces, which regularly poll for some information or regularly send data. Regular in this context is used to describe a specific use, however, the device can also be used where it is required to have single or multiple regular or irregular requests of a functionality.
This invention also provides a method of managing an interrupt used to switch a CPU from a first mode into a second mode. The method comprises receiving an interrupt before the interrupt arrives at the CPU, waking up a functional stage in response to the received interrupt, waiting until the functional stage has settled into a predetermined state and relaying the interrupt to the CPU after the waiting step for switching the CPU from the first mode into the second mode. A received interrupt is not routed to the CPU, but is used to wake up the functional stage. After a time for the functional stage to settle, the interrupt is then routed to the CPU. Thus the CPU is switched from the first mode into the second mode only after the functional stage has settled into its predetermined state. This provides considerable reduction in power consumption compared to prior art.
The method according to the present invention can be used for single or multiple requests of functionality. When only a single request is made, the step of generating the interrupt takes place once per event. However, for multiple requests, the interrupt is generated multiple times. When the signal is generated multiple times, the interrupt can either be generated periodically or irregularly. However, at least some of the interrupts are handled by the interrupt relay as described.
These and other aspects of this invention are illustrated in the drawings, in which:
Functional stage 4 can be an analog voltage reference, an analog device, a complex digital system, such as a communications system, or a further control circuit. CPU 1 can be a standard microcontroller or a microprocessor.
Interrupt relay 3 receives an interrupt INT from interrupt generator 5. Interrupt relay 3 then sends a wake up signal WU to functional stage 4. Wake up signal WU switches on functional stage 4. Functional stage 4 does not settle into its predetermined functional state right away and takes some time to settle. This time is known as the reference settling time tref. For example, if functional stage 4 is a reference voltage generator this settling time is the time required for the reference voltage to become stable. If functional stage 4 is an analog-to-digital converter the settling time is the time required for the functional stage to be ready for conversion. After the time tref, functional stage 4 stabilizes into its predetermined functional state and transmits a release signal RL to interrupt relay 3 indicating that functional stage 4 has settled. Interrupt relay 3 relays the interrupt INT to interrupt controller 2 in response to the release signal RL. Interrupt controller 2 routes the interrupt INT to the CPU 1. This switches CPU 1 so that it wakes up from an inactive or sleep mode to an active or wake mode. However, the interrupt can also be used to switch CPU 1 between any two defined modes such as a first and a second mode), or to jump to a specific point in a program or subroutine. As long as the second mode requires more power of CPU 1 than the first mode, power savings are achieved with the present invention. Functional stage 4 is then used for a time tconv during the active mode of CPU 1. After time tconv when the functionality of functional stage 4 is no longer required, functional stage 4 is switched off or disabled and CPU 1 enters its inactive mode again. This process is repeated as often as the functionality is required, either periodically or randomly.
This invention dramatically reduces the total system power consumption in the device. Power consumption may be more than halved compared with the power consumed by a prior art device. As noted above in conjunction with
Thus the system does not start to consume power until the time at which the falling edge of the interrupt occurs at the start of tref. During the reference settling time tref while functional stage 4 is still settling, only functional stage 4 is consuming power. Because the CPU 1 is in sleep mode during tref, it does not consume any power during this time. Only after tref does CPU 1 start to consume power for the time tconv.
In this invention CPU noise is dramatically reduced compared to prior art devices. This is because the CPU is in an inactive mode for a longer time. No switching of the internal logic occurs in the CPU during the time the CPU is inactive. Thus no current peaks appear on the power supply rails and substrate noise in an integrated device embodying this invention is minimized.
Although the invention has been described hereinabove with reference to a specific embodiment, it is not limited to this embodiment and no doubt further alternatives will occur to the skilled person that lie within the scope of the invention as claimed.
Number | Date | Country | Kind |
---|---|---|---|
10 2007 031 529.7 | Jul 2007 | DE | national |
This application claims priority under 35 U.S.C. 119(a) to German Patent Application No. 10 2007 031 529.7 filed Jul. 6, 2007 and 35 U.S.C. 119(e)(1) to U.S. Provisional Application No. 61/016,728 filed Dec. 26, 2007.
Number | Date | Country | |
---|---|---|---|
61016728 | Dec 2007 | US |