The different modes of operating of the microprocessor

In the previous episode we have define how a microprocessor works, we will see now how it is working.

Firstly you have to know that a microprocessor is always working, to always do something if a user want to use it. We can take the example of a television: when the TV is turned off by your remote control, you can see a red led on your TV which indicate that this one is awaiting to be turn on from the remote control. This is also called the Idle mode (we will explain that later in the course).

Nevertheless the microprocessor which is not turn on don’t have to use the same energy as the one which is turned on, that’s why it’s need different mode of operation for a microprocessor.

The different modes of operating

 

The Running mode

The running mode is when the microprocessor is turned on. Both processor and peripherals are used. It can be when your television is turned on for example.

This is in this mode that the energy consumed is the most important because all the components are turned on. The energy consumed is from miliampere to a dozen of milliampere.
Once the user turn off the television this one goes to idle or sleep mode.

 

The IDLE mode

The idle mode is used when the microprocessor is sleeping. We turn off the processor because this is the component which consume the most of energy. The peripherals are keeping turned on to detect if the user want to use the system. For example if you push the button power of your TV remote control, this will turn on your television. By pushing this button the TV will leave the idle mode to go to running mode.

The energy consummate is from few hundred of microampere to few milliampere.

 

Sleep or Halt mode

For the sleep or halt mode, all peripherals and processor are turned off. This mode is not the most used because you can’t wake up your embedded system. For example it is when your television is plug off. Plug in your television and it will in the idle mode.

The different mode of wake up an embedded system

As we have previously mentioned, the microprocessor has different modes of operation. The goal of that is that the microprocessor has the least energy consummated. To do that, it has to mix the mode of operation. Therefore we will see now the different way to go from idle mode to running mode.

VERIFIE

  • Press detection in running mode

The first way to go to the running mode from idle is the detection from a user action. That’s mean that we will wait until the user is using the embedded system.

The microprocessor will only be in running mode even if it’s not used therefore it consume a lot of energy, as you can see on the diagram:

Détection d’appui en mode running
  • Detection with wake up call

Detection with wake up call permits to a microprocessor to wake up from time to time to catch an external event such as push a button of an elevator for example. The difference with the press detection in running mode is that the microprocessor doesn’t stay in a running mode to save more energy. Nevertheless with the wake up call detection the time between idle mode and running mode is really close, therefore the elevator can detect when the button is pressed.

• Scrutation avec phase de réveil

Therefore as we can see on the graphics there are an alternation of running and idle mode to have a less importante consumption.

  • Wake up call from an event

The wake up from an event is the consuming methods to use with a microprocessor. In fact, this one is in Running mode only when the user want to use the microprocessor. For example, when the user press a button of the remote control to turn on the TV, it’s a wake up call from an event.

• Scrutation avec phase de réveil

Pratical Exercise:  Calculation of the autonomy of the cell

We will study a wireless weather station. Thanks to this example we will explain the different mode of operating in order of the autonomy of the cell.

Schéma d’une station météo sans fils
Schéma d’une station météo sans fils

On the sketch, we can see a temperature sensor which is used to acquire the outside temperature. This is one is supplied with a 3 volts cell. Furthermore we have a wireless link between the sensor and the lcd screen situed inside the house and supplied by an electrical outlet.

The purpose of the exercise is to maximize the cell energy which is connected to the sensor to not change the cell oftenly. Therefore we want to know which mode of operating will save the most of cell energy.

For that we have to know the different consomations for each components of the circuit:

  • Wireless link: ILiaison = 20 mA
  • Microprocessor (running mode): IProcesseur = 1 mA
  • Temperature sensor: ICapteur = 10 µA
  • Standby microprocessor (IDLE mode): ISleep = 1 µA
  • Cell: 3V et 200 mAh

Solutions of the exercise

The cell can deliver 200 milliampere during an hour. Thanks to this information, we just have to calculate the average consumption to know how much time the cell can the necessary energie.

a) Press detection in Running mode

Here is the temperature sending in a loop because the sensor is used in Running mode:

IConsommation = ILiaison + IProcesseur + ICapteur

IConsommation = 20*10-3 + 1*10-3 + 10*10-6

IConsommation = 21,01 mA

Détection d’appui en mode running

The system has an average consumption of 21.01 mA in press detection of a push button mode.

We know that the battery has an autonomy of 200 mAh. Then we have:

Autonomie calcul

We have to compare this autonomy to the others modes of operating.

b) Detection with a wake up call

We will see now if by alternate the running and IDLE mode we can improve the autonomy of the battery. The detection with wake up call allows the temp sensor to wake up from time to time to send the temperature. Because the outside temperature doesn’t change every 5 minutes we can send it less often than in the running mode.

We would like now to have a wake up of 1 microseconds for a period of 2 seconds.

Therefore use the value of consumption previously mentionned for each components.

To sum up the situation, the running mode is activated every one 1 second during one milliseconds. When the running mode is not activate, this is the IDLE mode which is activate.Then we will calculate the average consumption of the IDLE mode and Running mode for the period which are activated.

IConsumption = IIDLE +IRunning

• Scrutation avec phase de réveil

The running mode, we have previously calculated, value 21,01 mA. We have to multiply by 0.01 because the running mode is activated every 1 millisecond.

The Idle mode has only processor which sleep and a running sensor. The sensor stay awake because quite often there is no IDLE mode on the sensor sell on the market.

We have :

IIDLE = ISensor + ISleep * 1 (because 1 second) = 10 μA+ 1 μA

IRunning = 21,01 * 0,01 = 21,01 μA (because 1 ms)

We have:

IConsumption = IIDLE + IRunning

IConsumption = 11 μA + 21,01 μA ≈ 32 μA

As we can see, the detection with wake up call as an average consumption 1000 less than the detection with a push button.

We will the autonomy impact on the battery:

Autonomie pile

We can see that by varying the different mode between IDLE and Running we rise significantly the autonomy of the micro-system for the same battery.