Microcontroller Solutions TechZone Magazine, April 2011 - Digikey
Microcontroller Solutions TechZone Magazine, April 2011 - Digikey
Microcontroller Solutions TechZone Magazine, April 2011 - Digikey
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Examples of deeply embedded, Internet-connected devices include<br />
information displays for the home that can integrate heating and<br />
cooling control with lighting, music, and information displays (e.g.<br />
a web browser); security still cameras that provide an extra level of<br />
coverage for monitored services; appliances that allow time-of-start<br />
control from utilities for smart-energy control, to reduce consumers’<br />
electricity bills; heavy equipment with sensors that can provide<br />
remote indication when in need of pending service; and toys or<br />
multimedia handsets that could be configured for subscription<br />
services, allowing updates during off periods.<br />
The 802.11 protocol provides two basic methods of connectivity. The<br />
primary method is called infrastructure, or basic service set, and is<br />
implemented as a structured network with at least one central point<br />
that routes traffic among the devices and onto other networks. In this<br />
method, the central point is commonly called an access point, and all<br />
communications occur through the access point. The second method<br />
allows “unrelated” devices to connect temporarily. This mode is called<br />
ad hoc, or independent basic service set. Ad hoc communication occurs<br />
from device to device, but allows many devices to share the common<br />
network. A primary advantage of 802.11 over other wireless protocols<br />
is its intrinsic ability to connect devices to the Internet. However, this<br />
functionality is provided primarily through the infrastructure mode of<br />
operation. The Microchip TCP/IP stack and Microchip 802.11 radio<br />
combination supports both infrastructure and ad hoc modes of operation.<br />
Figure 2: Basic methods of connectivity.<br />
One example of a use for a deeply embedded Wi-Fi solution is for<br />
vehicle diagnostics. Considerable effort is spent designing the hardware<br />
and software for user interfaces in these types of applications. However,<br />
PDAs such as the iPod Touch or cellular phones such as the iPhone<br />
are perfectly designed for user interfaces with a rich and intuitive<br />
feature set. Most include Wi-Fi connectivity, which allows the use<br />
of infrastructure or ad hoc modes in the Microchip Wi-Fi module. As<br />
shown in Figure 3, the PDA or phone can connect to the Microchip Wi-Fi<br />
module, and the PIC24F 16-bit microcontroller runs the Microchip TCP/<br />
IP stack for ad hoc mode. The PIC24F microcontroller connects to the<br />
vehicle using any of the standard On-Board Diagnostic (OBD) interfaces,<br />
such as J1850, J1939, ISO 15765-4, etc. Vehicle status, such as RPM,<br />
MPH, and battery voltage, can be displayed in a variety of forms such<br />
as raw values, graphs, or gauges. Once disconnected, the PIC24F can<br />
connect to a central server using infrastructure mode to upload data, or<br />
download new firmware or parameters.<br />
Figure 3: Application example.<br />
Latency is not a critical factor for data transfers in most deeply<br />
embedded devices. This means the data transfer has so little<br />
latency that a user does not discern a delay from an action to the<br />
corresponding reaction. Latency is often critical for handheld remotecontrol<br />
devices, because users get frustrated and consider it a poor<br />
user experience if the time for a local reaction to a button push on the<br />
device is discernable (more than 250 ms).<br />
The 802.11 specification has a mode called “power-save poll”<br />
within the infrastructure service. It allows a device to go to sleep<br />
while maintaining a connection to the access point. A device can<br />
wake immediately and begin communication. Latency can be a little<br />
more than 100 ms for an external client to begin transferring data<br />
to a sleeping device. This is an ideal mode for remote controls using<br />
infrastructure mode, as it provides the ability to power down without<br />
a user-perceived reduction in latency. Battery life is only days with<br />
this mode if the unit is frequently used, so this usage model should<br />
be considered with a charging station. This scenario makes the usage<br />
model for such a device similar to that of a cellular phone.<br />
“Power-save poll” mode is also an efficient way to reduce power<br />
consumption in devices where latency is not an important issue, such<br />
as those that transfer data more than four times a minute. In such<br />
cases, the act of reconnecting to the network consumes more energy<br />
than keeping the device connected via power-save poll. For example,<br />
the Microchip Wi-Fi radio provides the “power-save poll” mode<br />
autonomously to the microcontroller. An added advantage of this is that<br />
the entire client system can shut down during the sleep periods. An<br />
interrupt from the radio will provide the wake indication, in case there<br />
is data waiting on the AP. Additionally, for remote-control applications,<br />
a wake-on-button-press or wake-on-motion can be provided via the<br />
microcontroller, to maintain the illusion of always being on for the user.<br />
For deeply embedded devices where latency is not critical, the best<br />
methodology for increasing battery life is to turn off the radio. The off<br />
state with leakage is the hibernate mode on the Microchip Wi-Fi radio.<br />
Once outstanding traffic is resolved via the TCP/IP stack, a single<br />
GPIO pin is used to deselect the device. This operation automatically<br />
disconnects power from the Wi-Fi radio. This mechanism allows the<br />
microcontroller and Wi-Fi radio combination to utilize about 120 nA in<br />
power-down mode. Such a combination is ideal for deeply embedded<br />
devices, because their low active power consumption stretches the<br />
system’s battery life.<br />
www.digikey.ca/microcontroller<br />
41