Hardware Software Interaction

A mote includes a CPU, memory, and peripherals. As a rule, peripherals possess three types of registers: data, control, and status. Data registers are employed as buffers between the CPU and peripherals, while control registers are used to adjust the I/O device functionality for a specific application. Status registers



New schedule v

FIGURE 37.3 A schedule is modified for extra power reduction.

are read by the processor to check whether a specific operation is done. In spite of the huge variety of peripherals, the communication between the CPU and the I/O devices remains routine and easy to define.

Modifying one or more bits in a register, the CPU must keep the rest of the pattern unchanged. A common way to implement bit manipulation is to read a register, modify bits, and write the result back. The two memory accesses make the read-modify-write instructions power inefficient. In an attempt to improve the situation, Atmel has taken another approach with the AT91 microcontroller [17]. Instead of one control register, the microcontroller employs three registers mapped into three consecutive memory locations. The first register is used to set individual bits, the second to clear bits, and the third to obtain the current pattern. To set or reset a bit, a high bit is written to the corresponding position at the set or reset register.

In the AT91 microcontroller, a PLL circuitry and a programmable prescaler complement the ARM7TDMI core to a variable-frequency processor. The PLL circuitry multiplies the oscillator frequency; the highest multiplication factor is 64. As a result, the oscillator may run at a frequency 64 times lower than the actual clock and thus the oscillator saves energy. The programmable prescaler with a division factor of 64 allows the AT91 clock frequency to go down to 512 Hz. The CPU and embedded peripherals can be individually enabled and disabled. The ARM processor clock is enabled from the next interrupt or reset. The on-chip RAM reduces external memory accesses and allows further power reduction. Finally, the processor may switch to the 16-bit instruction set and benefit from a narrower memory.

Similarly to the analog-to-digital conversion, the measurement of time intervals also falls under the accuracy-power trade-off. Figure 37.4 shows how a counter/timer determines a time interval using different clock rates. The highest possible frequency provides the highest accuracy. If a Smart Dust application is based on the AT91 microcontroller, the number of counter transitions for a 50-ms period may vary with the frequency up to 50,000.

FIGURE 37.4 Using different frequencies to measure a time interval. Copyright © 2005 by CRC Press LLC
0 0

Post a comment