Jameco Electronics 3000, 2000 manual Other Rabbit Software, 18.1Power Management Support

Models: 3000 2000

1 349
Download 349 pages 5.72 Kb
Page 250
Image 250
18.OTHER RABBIT SOFTWARE

18.OTHER RABBIT SOFTWARE

18.1Power Management Support

The power consumption and speed of operation can be throttled up and down with rough synchronism. This is done by changing the clock speed or the clock doubler. The range of control is quite wide: the speed can vary by a factor of 16 when the main clock is driving the processor. In addition, the main clock can be switched to the 32.768 kHz clock. In this case, the slowdown is very dramatic, a factor of perhaps 500. In this ultra slow mode, each clock takes about 30 µs, and a typical instruction takes 150 µs to execute. At this speed, the periodic interrupt cannot operate because the interrupt routine would execute too slowly to keep up with an interrupt every 16 clocks. Only about 3 instructions could be executed between ticks.

A different set of rules applies in the ultra slow or “sleepy” mode. The Rabbit 3000 auto- matically disables periodic interrupts when the clock mode is switched to 32 kHz or one of the multiples of 32 kHz. This means that the periodic-interrupt hardware does not function when running at any of these 32 kHz clock speeds simply because there are not enough clock cycles available to service the interrupt. Hence virtual watchdogs (which depend on the periodic interrupt) cannot be used in the sleepy mode. The user must set up an endless loop to determine when to exit sleepy mode. A routine, updateTimers(), is provided to update the system timer variables by directly reading the real-time clock and to hit the watchdog while in sleepy mode. If the user’s routine cannot get around the loop in the maximum watchdog timer time-out time, the user should put several calls to updateTimers() in the loop. The user should avoid indiscriminate direct access to the watchdog timer and real-time clock. The least significant bits of the real-time clock cannot be read in ultra slow mode because they count fast compared to the instruction execution time. To reduce bus activity and thus power consumption, it is useful to multiply zero by zero. This requires 12 clocks for one memory cycle and reduces power consumption. Typ- ically a number of mul instructions can be executed between each test of the condition being waited for.

Dynamic C libraries also provide functions to change clock speeds to enter and exit sleepy mode. See the Rabbit 3000 Designer’s Handbook chapter Low Power Design and Sup- port for more details.

User’s Manual

241

Page 250
Image 250
Jameco Electronics 3000, 2000 manual Other Rabbit Software, 18.1Power Management Support