Download Chapter 2: Firmware Overview

Transcript
MPG LEVEL 2
if(--u16SecondCounter == 0)
{
u16SecondCounter = 1000;
GGu32SysTime1s++;
}
/* Clear the interrupt flag */
SCB->ICSR |= SCB_ICSR_PENDSTCLR;
} /* end SysTickHandler(void) */
The definition for SCB_ICSR_PENDSTCLR must be added to lpc175x_.h (this register bit is defined on
page 170 in the Cortex Technical Reference manual).
2.3.2 Sleep
Managing power consumption in an embedded system is always important as saving power is always
good. The ANT radio system is specifically designed to consume as little power as possible which is one
of the reasons why it stands out so well from its competition. Many ANT systems can maintain an
average current in the uA range even while maintaining a data connection to another device.
Microcontrollers typically have several sleep modes where different parts of the MCU are put to sleep.
These can range from just shutting down the core and leaving peripherals running, to completely turning
off the device other than some basic logic to wake up the processor.
The course system will make use of two of the Cortex-M3 low power modes:
1. Sleep mode: the core clock is stopped but all peripheral functions continue to operate. Any
interrupt will wake the processor back up. Wakeup takes only a few cycles, so the system can
respond quickly to any event.
2. Deep sleep mode: practically everything in the microcontroller is shut down. The processor can
only be woken up in certain ways, including external interrupts. In this mode, the system will
rely entirely on the ANT subsystem to wake it back up so it can process gaming instructions,
perform any user interface updates, then go back to sleep. The disadvantage of Deep Sleep is
that it takes about 4096 instruction cycles to start back up (341us), and all of the clock
configuration must be repeated with each wake up. This creates substantial latency in the
system, though for our device the timing is still insignificant.
Deep Sleep is a bit more challenging to implement successfully and there is some further information to
explore to fully understand what options are available, what state the processor will be in, and what the
wakeup requirements are. Therefore, it will be left for an advanced exercise, though all the design up to
that point will be done keeping the needs of Deep Sleep in mind.
notes_mpgl2_chapter2.docx
Release 1.1
Page 21 of 35