internet of things - Newark

10 downloads 0 Views 13MB Size Report
the core components that make up the Internet of Things. ... enablers are edge nodes or 'things' that take input from all ...... devices. While it's fine for cell phones.
INTELLIGENT LED CONTROL

RAPID PROTOTYPING FOR IOT

WIRELESS PROTOCOLS

WINTER 2014

NEWS FOR THE ELECTRONICS INDUSTRY

ISSUE 2

TECH JOURNAL

EXPLORING THE

INTERNET OF THINGS

›LIFE ON THE EDGE OF

THE INTERNET OF THINGS ULTRA-LOW POWER

WWW.ELEMENT14.COM/TECHJOURNAL

›A CLASH OF

ARCHITECTURES ARM vs X86

+

PLUS

n LAMP SERVERS FOR IOT n ARM SYSTEM IP n FPGA BASICS element14.com

A Place Engineers Call Home The element14 Community

element14

DESIGN CENTER

BETA

For the very latest Embedded & Analog development tools

www.element14.com/designcenter

START HERE Research > Design > Production

Connect with 275,000+ members globally at the world’s largest community for design engineers. Discover the latest development kits, single-board computers and hot new products that you can test & review for free at the element14 Design Center! Enjoy cutting-edge webinars, participate in design challenges and more.

Join for FREE today at element14.com

COMMUNITY

Issue 2  WINTER 2014 4

Exploring the Internet of Things EXPLORING THE IOT FROM END TO END

8

Rapid prototyping for IoT

10

Life on the edge of IoT

16

Wireless protocols

RAPID PROTOTYPING THE INTERNET OF THINGS

UNDERSTANDING ULTRA-LOW POWER

WIRELESS PROTOCOLS EXPLAINED

22 The IoT cloud

SHINING A LIGHT THROUGH THE IOT CLOUD

24 LAMP servers for IoT

DEPLOYING A LAMP SERVER INTO THE IOT

30 Intelligent lamp control

INTELLIGENT LAMP CONTROL WITH XMC1000

36 Efficient and intelligent lighting

USING INFINEON’S RGB LED LIGHTING SHIELD

38 Energy efficient white light

THE BIRTH OF ENERGY EFFICIENT WHITE LIGHT

40 ARM vs x86

A CLASH OF ARCHITECTURES

44 System IP

ARM TECHNOLOGY PART 2

EDITOR-IN-CHIEF CLIFF ORTMEYER MANAGING EDITOR ANKUR TOMAR © Premier Farnell Corp 2015. All rights reserved. No portion of this publication, whether in whole or in part, can be reproduced without the express written consent of Premier Farnell Corp. All other registered and/or unregistered trademarks displayed in this publication constitute the intellectual property of their respective holders. Errors and omissions in the printing of this magazine shall not be the responsibility of Premier Farnell Corp. Premier Farnell Corp reserves the right to make such corrections as may be necessary to the prices contained herein.

Welcome IoT: we’ve all heard of it. Some say it’s here, it’s coming, or that it has already come and gone. Whatever view you hold, there is no disputing the fact that the amount of information that we gather and have access to is evolving exponentially. Embedded systems are key enablers of the Internet of Things. The question is, how do we use these powerful embedded and analog products to gather, utilise and disseminate all the types of information in order to make IoT a reality? In this edition of the element14 Tech Journal, we will look at the core components that make up the Internet of Things. In Exploring IoT from End to End, we review what is needed to make the Internet of Things a reality. One of the key enablers are edge nodes or ‘things’ that take input from all around us. In Life on the Edge of IoT we explore how the usage of ultra low power edge node devices are at the heart of these end points and how engineers can better understand the energy usage of processors in their applications. Where this information runs through or is stored is the subject of Shining a Light on the IoT Cloud where we look at three models for cloud based services. One of the key methods of transmitting data from the edge nodes is through wireless communication. In Wireless Protocols Explained, we look the most common protocols as well as the parameters needed to help you decide what works best for your application. Additionally, we have included information on the systems and additional technologies that are available to help you better understand and bring your IoT designs to market faster. We hope you enjoy this edition of element14 Tech Journal and welcome your comments and suggestions. Please feel free to drop us a note.

David Shen Chief Technology Officer, Premier Farnell Email: [email protected]

WINTER 2014 

ELEMENT14  3

EXPLORING THE INTERNET OF THINGS FROM END TO END By STEVE NELSON / EXECUTIVE DIRECTOR, FREESCALE

In the recent past, devices were singular entities going about their tasks in silent anonymity. Sure, some industrial systems and computers within networked environments collected data and created a community of sorts, but nothing like what we have today. 4  ELEMENT14  WINTER 2014

WE NOW HAVE CONSTANT CONnectivity and devices that trade massive amounts of data; data that holds secrets we are only beginning to tap. Transportation, healthcare, agriculture, machine-to-machine communications, and entertainment are segments that are already reaping an information harvest that was unimaginable 10 years ago. The glue that holds the

promises of this technology together is the Internet of Things (IoT), a confederacy of devices, networks, and processing power that has vast potential to make life better by addressing truly global problems. Freescale has been a pioneer at every level of the IoT phenomenon and offers all of the fundamental IoT building blocks under one roof.

EDGE NODE SOLUTIONS

PAN/LAN Connectivity

Gateway

WAN Connectivity

Application/Action

MCUs Energy Sensors Connectivity

Cloud Big Data

Edge Nodes

●●INFRASTRUCTURE OF THE INTERNET OF THINGS

Kinetis microcontrollers Design potential. Realized. Industry’s most scalable ultra-low-power, mixed-signal MCU solutions based on the ARM Cortex-M and Cortex-M0+ architectures.

Freescale sensing Intelligent contextual sensing

IOT GATEWAY SOLUTIONS CLOUD SOLUTIONS i.MX applications processors Your interface to the world Industry’s most versatile solutions for multimedia and display applications, with multicore scalability and market-leading power, performance and integration.

QorIQ processors built on Layerscape Architecture Accelerating the network’s IQ Industry’s first software-aware, core-agnostic networking system architecture for the smarter, more capable networks of tomorrow, end to end.

The right combination of intelligent integration, logic and customizable software on the platform to deliver smarter, more differentiated applications.

Edge nodes

●●FREESCALE IOT SOLUTIONS MAPPING

Sensors measurements and monitoring The story of IoT begins at the edge node, the entry point for all information. This information collection is the primary role of the edge node and the possibilities for measurement are limited only by the imagination. Temperature, pressure, motion, position and many other factors can be measured, processed and transmitted.

We can easily recognise many edge node devices as integral parts of our lives, and the many forms of edge node devices are leading the growth of the IoT space. Smart phones, thermostats, entertainment and health tracking devices are a few familiar manifestations. While these applications are well understood, there are other devices that will soon impact life as we know it. For example, automobiles monitor road conditions and informatics around driving. Cities are beginning to implement integrated traffic, weather and infrastructure monitoring systems that offer the potential of improved safety and transportation efficiency. Healthcare providers are using monitoring devices to collect vital information such as blood pressure and blood sugar levels. These devices need the ability to sense information, process it and maintain connectivity with gateways. The endpoint in edge nodes is usually composed of sensors, an embedded processor (typically an MCU), a connectivity method and an energy source. The demands of endpoint devices are familiar. They are ideally low power in order to operate for long periods between charging or

battery replacement. Their structures must provide low complexity for interoperability and must be robust and industrial grade for prolonged use and reliability. These devices must be unobtrusive so that they can be incorporated into a small form factors and low cost for rapid development and implementation. There are two primary classes of edge node devices: those that are battery powered and those that receive a steady stream of energy. The device’s requirements will form the design parameters and as a result the power source. Is an edge node in a remote location where power will not be available? Is the device mission critical in such a way that its data collection could have an impact on safety or a company’s bottom line? Is the reporting of information only required at intermittent cycles or is a steady stream of data communication required? Those that operate on a battery must push the absolute limits on power management technologies in order to both collect data and then transmit this information on a regular basis, and also maximise the time between battery charging or replacement.

WINTER 2014 

ELEMENT14  5

E

With the proliferation of intelligence and connectivity in previously unimagined applications, time-to-market pressures will intensify in the IoT space. Freescale is the only supplier that delivers IoT solutions from the edge node, to the network to the cloud. We are focused on providing application-specific reference designs and platforms that empower developers with real-world implementations and enable rapid design prototyping. n

Freescale offers a wide array of software-operating systems, protocol stacks, middleware and application software that assist in overcoming development hurdles, and we engage the right partners to further streamline development and reduce risk.

●●KINETIS KL03 MCUS FOR EXTREMELY LOW POWER, SMALL FORM FACTOR APPLICATIONS

PROCESSING The processing at the end node level is gaining importance as devices have more sophisticated processing power and hence the ability to communicate important trends or differentials. Once data has been gathered, sensors usually conduct basic algorithms such as threshold detection and simple data analysis. This is important as the IoT landscape is moving from higher-level, cloudbased processing to a distributed intelligence model in which data-driven decision making is migrating toward the edge nodes. The ultimate goal is that they will begin to learn, adapt and act independently in a predictive manner. For example, in a healthcare application the processing might involve triggering communication if blood pressure is above an advisable level, but a constant transmission of blood pressure values that are within limits and are not changing is unnecessary. In a smart city application the sensing could involve monitoring and making sense of temperature, moisture wind or infrastructure changes. The key is that these devices operate based on the exception, not the rule. Constantly reporting a non-changing value is of little importance. That the value is changing, and maybe by how much and how quickly, is much more relevant information. Freescale’s embedded processor solutions deliver optimised performance and power to match virtually any IoT application, from batterypowered consumer devices to cars, homes, civil engineering and industrial automation. Freescale offers the smallest package for an MCU, the CSP that measures only 2x2mm with the full capability of a 32-bit microcontroller and the lowpower performance of the ARM Cortex-M0+, that not only will improve the accuracy of the acquired data, but also improve the battery life and achieve the smallest form factor so that the patient can forget he is wearing a device at all.

6  ELEMENT14  WINTER 2014

●●KINETIS KW2X MCUS FOR EDGE NODE APPLICATIONS

CONNECTIVITY The key to IoT is the connection of disparate devices with multiple hardware and software approaches. Without dependable connectivity the web of developing information is dead in the water. A product can be designed to reliably connect to a certain set of gateways or other devices. But, in the real world, a device may connect to any number of unknown products, which is why standards and compliance are critical. Freescale has worked hard in developing and engaging in partnerships and important standards bodies. Freescale connectivity solutions work seamlessly with a number of protocols. On the consumer side Freescale has been a partner and developer with consortiums such as Wi-Fi, Bluetooth Smart, ZigBee, 6LoWPAN and HPGP. On the industrial side Freescale has been instrumental in Wireless Hart, ISA100, EtherCAT, and Modbus. Freescale’s networking processors are designed with a systems view to deliver highperformance connectivity that scales with the needs of the emerging infrastructure demands of the IoT market. The future of connectivity will involve the forward looking partnerships such as Thread. These partnerships will allow a host of devices to not only network but create mesh environments where information moves in a web across devices. This type communication requires processors that can meet demanding throughput requirements with robust real-time, point-to-point communication.

●●QORIQ LS1 TOWER SYSTEM MODULE FOR GATEWAY DESIGNS (TWR-LS1021A)

GATEWAY As with many elements of IoT, the gateway is also a shape-shifting component, free from form factor constraint. Gateways are not required to assume a standard form and can manifest in different ways. Even a cell phone can act as a gateway in some instances. The gateway is not a one system fits all, there are a range of possibilities, depending on the additional functions that they gateway may perform. The gateway allows for the transferal of data through a variety of protocols. As the gateway appliance takes information, it applies a minimal level of processing and further conveys data on its way to further processing. This ecosystem of the gateway is composed of a number of complex relationships including software, processors, security and protocols.

Intelligent design, Incredible scale

Make it with Kinetis Microcontrollers If you can imagine It, you can build it with Freescale Kinetis MCUs, the world’s most scalable, energy-efficient MCU portfolio. Make it smarter — Create smaller, cheaper, greener and longer-lasting products with the world’s most energy-efficient portfolio of ARM Powered® MCUs. Make it faster — Reuse your code from prior designs—regardless of size or power—instead of starting from scratch every time. Make it smaller — Enable intelligent processing and connectivity in mobile and other compact designs with the industry’s smallest form factor MCUs. Make it easier — Access the industry’s easiest-to-use, most widely supported development tools to reduce costs and speed your time to market. Whatever your design needs, wherever you are in the world, we’re here to help you make it better. Learn more at freescale.com/Kinetis

Freescale, the Freescale logo and Kinetis are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. ARM is the registered trademark of ARM Limited. ARM Powered is a trademark of ARM Limited. All other product or service names are the property of their respective owners. © 2014 Freescale Semiconductor, Inc.

RAPID PROTOTYPING THE

INTERNET OF THINGS

O HELP DEVELOPERS take advantage of the green field that is IoT, semiconductor vendors are developing low cost, easy to use baseboards and leaving the extended functions like wireless connectivity, LED and LCD controls and the like, to be integrated onto add-on cards that designers can then add to their system if needed. An example of this type of baseboard and accessory board system that is designed for rapid prototypi n g i s t h e L a u n c h Pa d a n d BoosterPack ecosystem from Texas Instruments. These development

T

ooster & Potenti om RF B ete

ophone senso r Micr

+C

oos

C110

N L ( R F ) C e n tral

et w

or

se

ns

ter

or

32

RF B &H

ode

CC

00

kN

r& ste

r

RF B oo

By ADRIAN FERNANDEZ / PRODUCT MANAGER, TEXAS INSTRUMENTS

um

i d it y

P R F B o oster &

sensor

RF

8  ELEMENT14  WINTER 2014

Boos

ter & Lig ht s e

nso

r

RF

Boos

ter & R a n g e s e

nso

IR

Rapid Prototyping. Quicken time to market. Sink or swim. The onset of the Internet of Things is exciting and developers are hard at work to add cloud‑connectivity to existing applications or inventing new solutions all together. From wearables to home automation to the tweeting fridge, the cloud is poised to add new intelligence and value-add to a broad set of solutions.

r OVERVIEW OF A CLOUD-CONNECTED WIRELESS SENSOR NETWORK THAT WAS RAPIDLY PROTOTYPED USING OPEN SOURCE MODULAR HARDWARE.

Texas Instruments CC3200 LaunchPad element14.com/LaunchPad Created for the Internet of Things, the CC3200 LaunchPad is a wireless MCU that integrates a high‑performance ARM Cortex-M4. CC3200 Wi-Fi application processor, Standalone development platform featuring sensors, LEDs and push-buttons, Supports 4 wire JTAG and 2 Wire SWD, GDB (GNU Debugger) support over OpenOCD. VISUALISING THE SENSOR DATA IN OUR SUBGHZ RF STAR NETWORK THAT WE ARE AGGREGATING USING THE CC3200 WI-FI LAUNCHPAD, WHICH SERVES AS OUR SUBGHZ-TO-WI-FI GATEWAY.

tools are open source, modular and affordable, which enables developers to plug together various sub-circuitries to build complete systems. Where additional functionality is known to be needed, such as in the case of low-power wireless connectivity to enable IoT endpoint communications, the base boards may integrate additional functionality such as the TI CC3200 Wi-Fi LaunchPad, which is a complete development kit that features the CC3200, a single chip microcontroller + Wi-Fi network processor. Many of the baseboards also include an on-board debugger/programmer as well as a standardised interface for accepting their accessory boards or plug in modules. Some manufacturers such as TI have developed their own standardised type of plug in modules called BoosterPacks. The benefit of this type of system is that a designer is assured to have a tested accessory solution that they can get up and running with little effort. Many manufacturers have chosen to use add-on boards with footprints that might be compatible with a wide range of accessories from other manufacturers (such as Arduino Shields) which can potentially broaden the field of applicable accessories, with the limitation however that not all accessories

may work with the baseboard without additional software/driver porting. An example of how this type of rapid prototyping system can work is where designers may need to develop an application that is out of their normal expertise, such as the development of a complete wireless sensor network. Here we have started with the TI CC3200 Wi-Fi LaunchPad which will serves as a sub-1GHz-to-Wi-Fi gateway. By adding a CC110L SubGHz RF BoosterPack on top of the CC3200 Wi-Fi LaunchPad, we are able to easily create a cloud-connected gateway that operates as the centre of a sub1GHz RF star network. In this example, each sensor node is made up of a Texas Instruments Microcontroller LaunchPad kit + CC110L SubGHz RF Wireless BoosterPack + a sensor. In this configuration, each node sends its sensor data to the CC3200 LaunchPad via SubGHz RF. The CC3200 receives the data, encodes the datapoints into a JSON object and publishes it to the cloud over Wi-Fi via MQTT, a lightweight publish/subscribe communication protocol. Once the data is in the cloud, we can visualise the real-time sensor data on a cloud-side dashboard as shown above. In this example, we were able to

quickly create a public web dashboard that enables anyone anywhere in the world to visualise and monitor the data in the star network that we created. While modular, open source hardware is important to enable efficiency in a fast paced industry, open source and easy-to-use software examples are just as critical. To create the system above, we used a tool called Energia (energia.nu). Energia is an open source, community driven software development environment that is a fork of the popular Wiring/Arduino framework. Through software abstraction, Energia offers intuitive APIs and libraries that are at the functional level, enabling developers to focus on what they want to do as opposed to spending time figuring out how to actually do it. With the help of these rapid prototyping tools, developers are well-equipped to solve the problems of a connecting world. Through open source methodologies, developers are able to freely share and collaborate to develop the building blocks we need to build the IoT. Hardware and software developers are able to benefit from these tools that bring powerful technology to a growing developer community and lower the barrier of entry. n

WINTER 2014 

ELEMENT14  9

Powering loT for Next-Gen Designs Atmel® gives Makers and designers all the basic building blocks for Internet of Things (loT) applications. This includes everything from embedded processing and connectivity to sensors, security, and software. We tie it all together with a rich ecosystem of design tools and development partners to bring innovation, ease-of-use, and integrated solutions to your next big loT design.

Embedded Processing

Security

Atmel AVR and Atmel | SMART ARM -based MCUs and MPUs deliver a unique combination of performance and power efficiency. Flexible and highly integrated, Atmel devices are designed to optimize your system control, connectivity, and user interface management, all while delivering low power and ease-of-use. ®

®

Featured Products: • Atmel | SMART SAMA5 ARM Cortex®-A5 series of MPUs

feature high-performance, market leading low-power, and advanced security for cost-sensitive industrial and consumer applications

Atmel CryptoAuthentication™ devices provide protected hardware key storage and offer the ideal way to ensure products are genuine and that the data transferred back and forth is confidential and has not been tampered with. Atmel takes care of all the ultra-secure crypto engineering, and delivers tiny protected hardware devices that come complete with all the tools needed to make it easy to add security into any digital system, without the need to be a crypto expert. Featured Product: • ATECC108 provides a robust,

cost-effective, and easy-to-use hardware security that offers best-in-class feature sets and is supported by industry-leading personalization services for added value and trust

• Atmel | SMART SAM D ARM Cortex-M0+ based MCU

series sets new benchmarks for flexibility and ease-of-use while combining performance and energy efficiency • megaAVR 8-bit MCUs deliver low power, additional analog

functionality, pin-to-pin compatibility, and easy-to-use interface for any smart and connected design

Sensing Onboard sensors are an essential part of the loT, giving connected devices the ability to track and respond to environmental conditions. Atmel offers a complete system solution running on the Atmel platform allowing you to focus on differentiating your product features, enhancing the user experience, and providing faster time-to-market. Featured Product: • Atmel | SMART SAM G

ARM Cortex-M4 based MCUs are optimized for ultra-low-power and high-performance applications. They are available in small form factors with a highly-efficient set of serial peripherals

Communication Atmel offers SmartConnect solutions in SoC (systemon-chip) and modules that provide self-contained, low-power, and FCC certified products, bringing wireless Internet connectivity to any embedded design, without you needing 802.11, IP stack or RF design experience. Featured Product: • SAM W25 Wi-Fi module is a

fully-integrated single-source MCU + IEEE 802.11 b/g/n Wi-Fi solution. Use Atmel Studio 6 development tools to provide battery-powered endpoints that last for years

By MARKUS LEVY / PRESIDENT, EEMBC

LIFE ON THE EDGE OF IoT UNDERSTANDING ULTRA-LOW POWER

THE SIMPLIFIED STRUCTURE OF THE INTERNET OF THINGS CONSISTS OF THE CLOUD, THE HUBS (COLLECTORS OR AGGREGATORS) AND THE EDGE NODES (OTHERWISE KNOWN AS THE ‘THINGS’)

ANY ‘THINGS’ LIVing on the edge must utilise ultra-low p owe r m i c ro c o n trollers to handle the user interfaces, collect and transmit sensor data, provide security functions, and manage other tasks. One issue faced by ‘thing’ designers is ensuring that these microcontrollers are really optimised to meet the performance needs of their applications and to enable the long battery lives that are expected. Edge nodes can be grouped more or less arbitrarily according to their application domain. For example, home automation encompasses anything that is used to control or monitor the home or office systems and devices, such as lighting or environmental control, appliances (e.g. freezer, washing machine, coffee maker, or fire alarm. On the other hand, ‘wearable’ or ‘portable’ is anything that is worn or carried on

M

the person while in use. Examples include smart watch, smart glasses, heart rate monitor, pedometer, GPS tracking device, blood sugar monitor, music or video player, and wireless headset/microphone. There are also categories for health, environmental, and others. Many edge nodes in the ‘wearable’ domain, as well as other domains can be considered ultra-low power applications. These applications are typically running with batterypowered operation and implement short, occasional periods of activity interspersed with long periods of inactivity, and possibly infrequent human intervention. It’s this latter point that highlights energy efficiency as a key performance criterion for such devices, and dictates battery lives of weeks, months, years, or even decades (i.e. a smartphone is not an ultra-low power device, although some companies would choose to market it as such).

E WINTER 2014 

ELEMENT14  11

WHAT IS ULTRA-LOW POWER? What is this ‘holy grail’ of ultra-low power? At a fundamental level, ultra‑low power implies different things to different applications. The lowest active current is required when the power source is severely limited (e.g. energy harvesting). Alternatively, the lowest sleep current is required when the system spends most of its time in standby or sleep mode, waking up infrequently (periodically or asynchronously) to process some workload. Furthermore, ultra-low power can also imply great energy efficiency, whereby the most work is performed in a limited time period.

IoT applications can be designed utilising a combination of the above attributes, but it requires careful analysis and balancing of tradeoffs. Which brings up the ‘shocking truth’ that an increasing number of microcontroller vendors are ‘claiming’ ultra-low power capabilities and application developers should not rely on datasheet parameters alone. The ultra-low power claims can often be connected to reality due to features supported by modern-day microcontrollers. For example, devices can support super-optimised power modes: although some devices have such elaborate power modes it takes great effort to determine the optimal approach (it’s a balance of the application’s activemode duty cycle and the ability to execute the application correctly; in other words, ensuring that the device returns from its low power mode in the required latency). Modern-day microcontrollers also sport a variety of intelligent peripherals that serve to offload the CPU. These peripherals perform functions such as analog-to-digital conversion (ADC), pulse-width modulation, and communication protocols. In IoT applications, the ADC could be used for sensors handling pressure changes, monitoring temperature, or an infinite

12  ELEMENT14  WINTER 2014

variety of things. Other factors that help to yield ultra-low power claims include integrated memory subsystems, extensive clock gating, and of course, advanced process technologies. From the discussion in the last few paragraphs, you might see why developers should not rely on datasheet parameters alone to compare and select an appropriate microcontroller or to determine the microcontroller’s real-world functionality. The bottom line is that ‘energy efficiency’ is a nebulous phrase. Most vendors utilise different specifications when quantifying parameters. What workload should be used for the analysis? It could be something as simple as a few lines of code running a ‘while’ loop. Or perhaps it’s something a bit more real-world. Besides the workload determination, what should the conditions and the physical setup be for the device under test? What duty cycles should be used to represent the transitions from active to low power state? How should the clock source be utilised? Should the workload run from flash or RAM? What is the input voltage? All of these details must be specified and utilised by all vendors in order to allow you to make apples-to-apples comparisons.

The path to standardised datasheet parameters Atmel

In 2013, vendors including Analog Devices, ARM, Atmel, Cypress, Freescale, Microchip, Renesas, Silicon Labs, Spansion, STMicroelectronics, and TI, began work on an industry standard method to quantify energy efficiency for ultra-low power microcontrollers. The outcome of this is the EEMBC ULPBench, a benchmark providing a consistent method to measure energy efficiency, demonstrating both active power and idle (sleep) power.

The workload of ULPBench core profile consumes 10,000-20,000 CPU cycles each duty cycle, depending on the microcontroller’s architecture. Although the number of CPU cycles varies, each microcontroller is required to perform the same amount of work (as opposed to necessitating an arbitrary number of cycles). The diagram below portrays the duty cycle, whereby the device enters the active mode once per second; the testing setup requires a real-time clock (RTC) for waking up, typically with an accuracy of 20-30 ppm. There are no golden rules for achieve the best ULPBench results. Obviously, since the active mode makes a big portion of the energy consumed during the test, it’s

best to compile the code for maximum performance (minimise the active cycles). Not only can this be accomplished by selecting the most optimal compiler flags, but the selection of the compiler itself is very important (just like it is for any code development). If the main (faster) crystal oscillator is power hungry, another way to lower energy consumption is to try and run from a low power 32kHz crystal with the main crystal oscillator switched off completely. Furthermore, if the device’s leakage current during the active state is high, it might make sense to switch to a faster clock during active state and finish processing the workload quicker (and in turn return to sleep mode quicker).

SAMA5D3 Xplained element14.com/SAMA5D3

The SAMA5D3 Xplained is a rapid prototyping and evaluation platform for microprocessor‑based design. ■■

SAMA5D36 ARM Cortex-A5 Microprocessor

■■

2GBit DDR2 – Micron, 2GBit Flash – Micron

■■

Gigabit Ethernet, 10/100 Ethernet

■■

USB Device connector, 2 USB Host connectors

■■

Arduino R3 compatible headers

Texas Instruments

CC3200 LaunchPad element14.com/LaunchPad

Created for the IoT, the CC3200 LaunchPad is a wireless MCU that integrates a high‑performance ARM Cortex-M4. ■■

■■

CC3200 Wi-Fi application processor Standalone development platform featuring sensors, LEDs and push-buttons

■■

Supports 4 wire JTAG and 2 Wire SWD

■■

GDB support over OpenOCD

E Freescale

Approx 10k to 14k Clock cycles on Cortex-M processors (0 wait states)

element14.com/FreedomBoard

Featuring Freescale Kinetis E low-power, highly robust, mixed-signal 32-bit microcontroller built on ARM Cortex-M0+ core, 48 MHz, 128k flash.

SLEEP

1 SECOND

INITIALISATION

Freedom KE06

MEASUREMENT

ULPBENCH RUNS WITH A DUTY CYCLE WHERE THE DEVICE IS EXPECTED TO WAKE UP ONCE PER SECOND. THE ENERGYMONITOR CAPTURES ENERGY CONSUMPTION DATA FOR 10 SECONDS.

■■

IrDA transmitter and receiver

■■

CAN communication

■■

MMA8451Q accelerometer, thermistor

■■

■■

Motor control function for simple BLDC motor control on APMOTOR56F8000E Form factor compatible with Arduino R3 pin layout

WINTER 2014 

ELEMENT14  13

THE ENERGYMONITOR GUI CONTROLS AND RECORDS THE ENERGY MEASUREMENT FOR ULPBENCH.

Achieving accurate energy measurement Most microcontroller vendors in the ultra-low power domain have integrated proprietary tools for measuring energy and/or power into their evaluation/development boards. There are also a variety of energy measuring tools, the most obvious is the traditional oscilloscope, but these are relatively pricey.

To support the ULPBench energy measurement and reach a sub-$100 price point, EEMBC determined that it was necessary to develop a new measuring tool. Hence, the organisation has produced the EnergyMonitor, a USB-powered voltage/current supply for the target device under test. It connects to a target device through a 100mil, 2-pin header, and can measure the energy consumption of literally anything running on 3V and up to 28mA. So, although the primary purpose of the EnergyMonitor is to measure microcontroller energy, it could also be used to measure things such as sensors for Internet of Things applications. However, most importantly, it integrates directly with EEMBC ULPBench and provides a standardised method for measuring energy consumption.

14  ELEMENT14  WINTER 2014

Fundamentally, the Energy-Monitor is not an energy measuring tool, it’s actually a specialised power supply. Using patent-pending technology, it ‘counts’ the number of times its on-board capacitor is discharged, which in turn sources current to the device under test (this is an over-simplified explanation). In the ultra-low power domain of IoT devices, battery life is one of the key attributes. The energy consumption of microcontrollers varies tremendously, so choose carefully. Claims of ‘ultra-low power’ must be backed by concrete data, which can only be obtained if measurements are equitably made. The difference of a few micro Joules/ second can mean the difference between a device that needs a battery replaced every year versus one that needs a battery replaced only after 10 years. n

ELEMENT14.COM/INTERNETOFEVERYTHING

The Internet of Things is here and more engineers than ever are optimising their designs for an increasingly connected world. Here we present the webinars that have taken place on element14 over the last few months, where industry experts explain the intricacies of the IoT and discuss the opportunities that a connected world can bring for EE design.

8 Useful webinars to help you build the Internet of Things Designing for the  Internet of Things This webinar addresses the three main problems with designing an IoT solution. It divides the focus into three areas: cost, security, and features. The aim of the webinar is to help attendees strike a balance.

Connecting your project to the cloud This webinar explains how to quickly and easily connect, control and monitor all your projects with the cloud via Wi-Fi, completely free!

Home automation at your fingertips

Opportunities and challenges with IoT

Learn how you can build your very own open home automation solution using Eclipse SmartHome and the wide range of bindings, from EnOcean to Philips Hue, available from the open-source openHAB project.

This webinar reviews the opportunities and challenges ahead for the IoT from a market and technical point of view including the various connectivity technologies, microcontrollers and processors available with a strong focus on applications.

IoTise your embedded projects!

The Internet of  Things: in production

Learn about the Eclipse IoT initiative, and how you can effectively use projects like Paho, Californium, SmartHome or Kura to build IoT applications.

Dr. Verena Majuntke explains what impact the Internet of Things will have on manufacturing and how it might change business for manufacturers.

Architecture and protocols session This session provides a short overview of the IoT architecture and its protocols. This comprehensive architecture addresses these new concerns and presents a meaningful path forward for organisations developing and consuming IoT solutions.

Enable your smart home A practical introduction on how to enable your smart home with the use of Raspberry Pi and EnOcean sensors.

WINTER 2014

ELEMENT14 15

Of the countless design challenges attendant with wireless connectivity, perhaps the most immediate is the vast landscape of available technologies.

I-FI, BLUETOOTH, Bluetooth low energy, ANT, ZigBee, RF4CE and many others have come to comprise a design menu that can be rather hard to choose from. It’s a nice problem to have – an embarrassment of options – but as the number of potential solutions increases, the task of compar ing them g rows increasingly difficult.

W

WIRELESS PROTOCOLS EXPLAINED By DAVID FINCH / NEWARK ELEMENT14 and DANA MYERS / TEXAS INSTRUMENTS

16  ELEMENT14  WINTER 2014

Choices, choices In selecting the appropriate wireless technology, the designer must consider, for example, whether a proprietary solution is required or if

NETWORK TOPOLOGY ●●POINT-TO-POINT

●●STAR NETWORK

●●MESH NETWORK

●●TREE NETWORK

an industry standard should be adopted. The frequency band must be determined, as well as the standard wireless benchmarks of transmission range, power consumption, and data throughput. Within these benchmarks, of course, there are trade-offs, especially when it comes to power. Data throughput, for example, impacts the overall power consumption; a 54Mbps Wi-Fi-based network might last a day or two on a single Lithium Ion source, while an IEEE 802.15.4-based sensor network shuttling data at 250kbps might survive a few years on a small

battery. Other factors, such as systems compatibility and network topology, will also influence most wireless connectivity designs.

Operating band The operating band is one of the design points that many developers struggle with. If the various standards-based technologies comprise a menu of design options, then selecting an operating band is not unlike choosing the style of food you want: Italian, Thai, American (whatever that is). Whatever band you select helps to narrow down which

Network topology is another key design factor. Starting with a simple point-to-point (P2P) connection, topologies can be made more and more complex by the addition, arrangement, and function of interoperable nodes. For example, if you were to attach additional nodes – often referred to as endpoints or clients – to one of the endpoints (the hub) in a P2P connection, the result would be a star network topology, or LAN. In this configuration, the hub is responsible for the exchange of information between all the endpoints. Attaching multiple star networks forms a slightly more complex topology known as a tree. A WAN (wide area network) is an example of a tree network; the exchange of information is managed within each local star cluster by their respective hubs, and data passes from cluster to cluster along a bus. If an endpoint in any cluster goes offline – a workstation in

an office, for example – the network remains alive, but communication with that endpoint ceases. All the other workstations remain functional within the network. However, should the central connection between clusters fail, due for instance to loss of wireless connection, then the entire tree may fail. Enter the mesh network. Mesh networks empower each node with transmission and node-to-node communication capability. Data is transferred from one point to another by hopping wirelessly from node to node, making a mesh network not only autonomous but inherently self-healing. When one node in the network fails, the other nodes communicate with each other to determine the best alternate route for the data to get from Point A to Point B. So, the more nodes that exist in a mesh network, the more paths there are for data to get where it needs to be and the more robust the transmission system.

hardware and software is available to you. Each of the three most popular bands – sub-1GHz, 2.4GHz, and 5GHz – has cer tain advantages and disadvantages for any given application; it all depends upon the benchmark you’re designing for. For example, range is generally reduced by about half as frequency doubles, so long-range applications may require sub-1GHz operation. One of the trade-offs with lowerfrequency operation is data rate, which diminishes with frequency. Designers may run into the issue of duty

cycle restrictions in the sub-1GHz band as well. By comparison, the 5GHz band affords designers the highest available data rate of the three, at the expense of transmission range. Sub-1Ghz and 5GHz bands both currently have a congestion advantage over 2.4Ghz, which has been embraced by consumer technology and as such has grown rather crowded. For this reason, some consumer applications are beginning to target 5GHz operation. But for all its crowding issues, 2.4GHz remains a popular choice for wireless connectivity.

WINTER 2014 

ELEMENT14  17

E

AT A GLANCE...

the STANDARD TECHNOLOGIES ●●Wi-Fi  IEEE 802.11 a/b/g/n Wi-Fi continues to dominate the world of wireless connectivity. Current growth projections for the IoT alone indicate 50 billion connected devices by 2020, and it’s no wonder. Wi-Fi offers secure, high-bandwidth connectivity and Internet access for medical, consumer, and industrial applications, while boast-

n

ing data rates up to 54Mbps. Transmission range can reach 100 meters at 2.4GHz, better than Bluetooth and other lowenergy options, but less than what you might get from a Sub-1GHz radio frequency. But this performance makes Wi-Fi relatively power-hungry with respect to other 2.4GHz wire-

●●Bluetooth

SMART

With an installed base of more than 3 billion units, Bluetooth is designed for lower-power wireless connectivity between devices. Bluetooth devices can power down during periods of inactivity, which helps to mini-

Taking a good situation and making it better, Bluetooth low energy was designed to suit the needs of ultra-low-power wireless applications, including the ever-growing wearable sports

mise power consumption; AAA batteries are sufficient sources of power for Bluetooth products. Bluetooth operates in the industrial, scientific, and medical (ISM) band at 2.4 GHz to 2.485 GHz, which is available

and wellness markets. Compared to classic Bluetooth capabilities, Bluetooth low energy technology is a connectionless protocol, which significantly reduces the amount of time the radio must

ANT provides a simple, low-cost and ultra-low power solution for short-range wireless communication in point-to-point and more complex network topologies. Suitable for a wide range of applications, ANT is today a proven and established technology for collection, automatic transfer and tracking of sensor data within sports, wellness management and home health monitoring applications. In con18  ELEMENT14  WINTER 2014

n

zigbee.org alternative to traditional line-ofsight remote control technology, such as IR. In addition to non-lineof-sight control of remote devices, RF4CE offers a longer range, longer battery life, and richer communication to support enhanced features and functionality.

n

trast to BLE, ANT has a relatively simple protocol and doesn’t require a lot of overhead. It specifies 64-bit security versus 128-bit utilised by BLE. Both offer data rates of about 1Mbps, accommodate a range of a few tens of meters, and boast years of life on a coin cell battery. But perhaps the greatest difference for system-minded designers lies in the network topologies supported by each; BLE is suit-

bluetooth.com/le be on. Requiring only a fraction of the power consumption of traditional Bluetooth technology, Bluetooth low energy can enable target applications to operate on a coin cell for more than a year.

nology specifically targeted for wireless sensor networks, ZigBee 802.15.4 can be used in any monitoring and control application that requires a wireless link. ZigBee RF4CE, on the other hand, is something completely different. RF4CE was developed as an RF

●●ANT

bluetooth.com and unlicensed in most countries. Data throughput is less than that offered by Wi-Fi but still in the 2 Mbits/second range to support higher data-rate applications, including multimedia products.

n

●●ZigBee  IEEE 802.15.4 and ZigBee RF4CE The ZigBee standard was created to address the need for a cost-effective, standards-based wireless networking solution that supports low data rates, low power consumption, security, and reliability. ZigBee supports selfhealing mesh networking. A tech-

less options: think Lithium Ion batteries as opposed to AAAs or coin cells for portable applications. However, some new embedded Wi-Fi solutions, like TI’s new SimpleLink Wi-Fi platform, have lower performance but can run on 2 AA batteries for over a year, changing the game where Wi-Fi can play.

n

●●Bluetooth low energy

wi-fi.org

dynastream.com able for P2P or star topologies, while ANT supports the full range, including tree and mesh. On a side-by-side, technological comparison, ANT is arguably the more appealing option for wearable/IoT applications, if for no other reason than mesh support. But it’s worth noting once more the numbers associated with Bluetooth: it’s hard to ignore an installed base of 3B units.

wi-fi for All ®

connect more. anywhere. anything. anyone.

Connect more with TI’s SimpleLinkTM Wi-Fi® CC3100 and CC3200 solutions for the Internet of Things www.ti.com/simplelinkwifi

The platform bar is a trademark of Texas Instruments. © 2014 Texas Instruments Incorporated

E

It offers a reasonably high data rate, decent range, no duty cycle restrictions, and, notably, 2.4GHz band works worldwide, making it a slamdunk for designers.

Proprietary vs standard The decision to develop a proprietary solution versus leveraging a standard technology such as Bluetooth often boils down to the basic functionality required. Highly-specialised functions may necessitate a proprietary implementation, which immediately limits the number of solutions available from OEM suppliers. The upside is that a proprietary wireless platform may be

STANDARDS BASED SOLUTIONS AFFORD THE DESIGNER A WEALTH OF CONSUMER FRIENDLY CONNECTIVITY OPTIONS.

customised specifically for the application, decreasing the software footprint, among other things. And the dual-edged nature of any proprietary design applies to wireless connectivity: proprietary devices may be simpler to design because they only have to operate within one defined network, but those same devices won’t be able to communicate with standard consumer devices. Standards-based solutions, on the other hand, afford the designer a wealth of consumer-fr iendly connectivity options. You just have to cough up the code space and possibly sacrifice some power versus the

proprietary option. But with these sacrifices come the real advantages of OEMindependent interoperable nodes – namely, a freer user experience for consumers and greater opportunities for network expansion. The more nodes, the bigger the network.

Honed on the range Among the most important wireless connectivity design parameters is transmission range, which consists of two key factors: transmission power and receiver sensitivity. These are critical specs to consider when exploring IC options from semiconductor OEMs.

So, which technology is right for me? In an ideal world, technology alone would be the ultimate factor in any design decision. But, here in the real world, technology selection is driven by a number of other factors… Ease of design is one such critical factor. Especially if you’re a smaller firm or contract designer, it is important to find the solution that can get your product to market quickly. TI’s

SimpleLink portfolio, for example, is a platform of solutions that simplifies wireless connectivity design. The SimpleLink family provides selfcontained solutions that were designed to simplify

wireless development and certification by minimising the amount of RF expertise you need to wirelessly enable your application. So, whether you choose to develop your own proprietary

?

installation or leverage the vast landscape of standard solutions, when it comes to wireless design, you’ve got options. And that’s a decidedly good thing. n

WINTER 2014 

ELEMENT14  21

SHINING A LIGHT THROUGH THE IOT CLOUD By VANDANA LOKESHWAR / SENIOR TECHNOLOGY DEVELOPMENT MANAGER, NEWARK ELEMENT14

things

Cloud computing enables ubiquitous network access to connected hardware and software in remote locations over the internet. The model allows for applications, software, process management and data to be stored on virtualised servers. Users can then access the data and connected devices through mobile apps, web browsers or lightweight desktop environments. The shared resource structure for storage, software, networks and services allows for a scalable and lower cost

22  ELEMENT14  WINTER 2014

business operation. Cloud based services are largely subscription based or pay-per-use (metered). The metered services allow for customers to use only what they need, thereby keeping expenses low. The deployment models are primarily based on the resource management, accessibility, elasticity and most importantly the security of the cloud: private, public or hybrid clouds. Public clouds service providers such as AWS, Microsoft and Google have their own



ECHNOLOGY AND SOLUtions for intelligent end nodes, wearable devices, communication gateways and data aggregators is continuously evolving with respect to optimising performance, integration, energy efficiency and security. With the help of these solutions, a huge amount of data is being harvested from various sources e.g. Sensor data related to air quality, health vital signs, diagnostics and preventive maintenance information from industrial floors etc. All of this data has to be run through, or stored on the cloud.

T

THE INTERNET OF THINGS (OR EVERYTHING), A WORLD WITH SMART DEVICES (THINGS) AND SYSTEMS, NETWORKED TOGETHER AND RUNNING ON CLOUD BASED SERVICES AND APPLICATIONS. IDC PREDICTS THAT THERE WILL BE OVER 50 BILLION CONNECTED ‘THINGS’ BY THE YEAR 2020.

infrastructure setup within the data centres. Private clouds are typically within organisations, behind a firewall and quite capital intensive. Hybrid clouds are a cluster or combination of private and /or public clouds, to support temporary growth requirements. Clearly the IoT paradigm will eventually work for all of us, but not without first addressing the challenges related to security, data control, non-standard infrastructure and the handling of volumes of heterogeneous data. n

THERE ARE THREE KEY SERVICE MODELS FOR CLOUD COMPUTING

NETWORKING

STORAGE

SERVERS

VISUALISATION

O/S

MIDDLEWARE

RUNTIME

DATA

APPLICATIONS

●●SOFTWARE AS A SERVICE

MANAGED BY VENDOR

STORAGE

NETWORKING NETWORKING

SERVERS

VISUALISATION

STORAGE

YOU MANAGE

O/S

MIDDLEWARE

RUNTIME

DATA

APPLICATIONS

● SOFTWARE AS A SERVICE

MANAGED BY VENDOR

YOU MANAGE

SERVERS

VISUALISATION

O/S

MIDDLEWARE

RUNTIME

DATA

APPLICATIONS

● PLATFORM AS A SERVICE

●●PLATFORM AS A SERVICE Application developers are able to design, develop, test, deploy and host applications on virtualised servers, with access to programming languages, platforms and tools. It naturally extends to running existing applications and services including versioning, testing and build tools. Solutions for PaaS designed for Internet of Things (IoT) and Machine to Machine (M2M) applications are being offered by various service providers today. In most cases the platforms provide end-end solutions for support security/authentication, networking, data communication, interoperability and device management. XML or JSON data from the IoT devices is acquired and collected through RESTful APIs to the cloud. The information thus obtained is then computed and applications developed to communicate/control the devices. Real-time messaging is supported with MQTT (Message Queued Telemetry Transport) and similar connectivity protocols. Data analytics, querying and reporting capabilities are well supported with data visualisation tools as well. Higher end complex machine learning algorithms are also being implemented in such models. There is a need for scalable systems that can support the storage and processing of these large amounts of data. At an enterprise level, Apache

PaaS Hadoop, an open source software framework allows distributed computing and processing of large amounts of data; a file system that has high throughput access to application data. It uses a simple programming model that allows the use of standard servers. Access to the embedded developers community (including DIYers) for such services has been facilitated by several providers. Xively’s public cloud and web-based tools, help design, build and debug connected products. It includes enablement libraries to interoperate with many languages, platforms, gateways and smart devices. These open source libraries allow for easy integration of the Xively APIs onto embedded products. For example, the Xively ARM mbed library allows you to develop on industry-standard ARM architectures to make your code easily portable to production-grade chips. Similarly Plot.ly also allows sensor data to be streamed directly from hardware platforms like Arduino, Raspberry Pi and also from MATLAB data acquisition systems. The data received can be plotted into interactive charts using Python, R, Excel and can be shared and edited in a web browser. Plotly charts can be exported to any image format through their Workspace or APIs, including pdf, png, eps, and jpg.

●●INFRASTRUCTURE AS A SERVICE

YOU MANAGE

● PACKAGED SOFTWARE

NETWORKING

STORAGE

SERVERS

VISUALISATION

O/S

MIDDLEWARE

RUNTIME

DATA

SaaS service providers, which would also imply all maintenance and support requirements to be handled by them. This is primarily a metered service. Typical examples would include email, CRM software etc.

MANAGED BY VENDOR

● INFRASTRUCTURE AS A SERVICE

APPLICATIONS

End Users have access to the database and ‘on-demand’ application software (front office and back office) with a thin client via a web browser. All the infrastructure for hardware/ software is provided by the cloud

Infrastructure as a service is a provision model for hardware components such as storage, servers and networking. System administrators install operatingsystem images and their application software on physical or virtual machines on the cloud. The cloud user patches and maintains the operating systems and the application software. The client typically pays on a per-use basis. The true success of the IoT revolution is going to be dependent on the storage, processing, interpretation and analytics of the data acquired, such that it can be applied effectively to improve the environment and society

IaaS

in general. Thinking about moving? Check the air quality and alleviate any asthma concerns. Planning a trip to the Caribbean? Get notifications on any shark movements…. Thingful a powerful search engine provides a geographical index for all the IP connected devices on the IoT network. It enables people find devices (eg, other Raspberry Pi users in the geographic proximity), datasets and real-time data sources by geo-location (like air quality, seismic activity, animals etc), and presents it using a proprietary ranking methodology. Users can keep track and monitor the real-time status of these devices and be alerted of any changes.

WINTER 2014 

ELEMENT14  23









L A M P

LINUX

APACHE

MYSQL

PHP

By AL FECZKO / VP OF SALES AND FIELD ENGINEERING, TIMESYS

Deploying a purpose-built LAMP Server into the IoT As reported in a recent WIRED magazine article by Cameron Graham, there are two major entry points into IoT across industries: servers and embedded processors. But with the increasing capabilities of modern SOCs, the line between these two entry points continues to blur. 24  ELEMENT14  WINTER 2014



N THIS ARTICLE, WE’LL ex p l o re w hy a b l e n d e d approach increasingly makes sense and also show how it’s become easier to implement and deploy a purpose-built embedded LAMP (Linux, Apache, MySQL, and PHP) server into the Internet of Your Things. Most of the attention in the IoT space these days seems to be around sensors and edge devices, the endpoints where ‘big data’ is being generated, gathered and then passed up to more intelligent parts of the system.  And in some ways that is understandable, because that's where the really big numbers are: as many as 25-50 billion units or more over the next few years, if you believe what some industry analysts and

I

semiconductor company executives are saying (or, perhaps hoping for?). But in reality, for the IoT to truly deliver on its promise, it needs to be thought of from a system perspective, not simply as a loose collection of autonomous, distributed devices that are smart and connected directly to the open Internet. In reality, most companies building embedded devices are also designing and managing a subnetwork to monitor and manage their devices. While it’s fine for cell phones and tablets to connect directly to the Apple App Store or Google Play store, most device manufacturers prefer to insert their own purpose-built servers into the device ecosystem. As such, powerful yet efficient low-cost LAMP servers can play this role, by collecting, storing, processing, and analysing the distributed device data, and also by controlling, managing, and maintaining the devices themselves.

Why deploy a purpose-built LAMP server into IoT? Whenever people talk about the challenges of the IoT, some common points that seemingly come up on a regular basis are connectivity, scalability, power management, and security/ software updates. Introducing a LAMP Server into the IoT architecture can play a key role in three of these four areas. LAMP servers are widely deployed and understood in IT circles. LAMP servers provide many benefits, including full control and configurability, straightforward upgrades for new features, modules or security fixes, high performance and scalability, and more.

Security and software updates Designing your devices to be secure is important, but as evidenced by the frequency of updates on your PC and mobile phones, it's equally or even more important to be able to update the devices when new threats emerge or existing ones evolve. This means that an important capability for your architecture is to have an ability to push security and software updates out to the edge devices.  Since many embedded devices being built and deployed today are not running iOS or Android, the App Store and Google Play aren’t relevant. With many low-cost edge devices being

deployed with microcontrollers (MCUs) and running either bare metal code or at most an RTOS with a TCP/ IP stack, a custom software update server is required. That’s where the purposebuilt LAMP server comes in. You benefit by having a small but powerful connected server that can query the edge devices to determine their current software level and then push security fixes and/ or code updates out to the devices when appropriate. Another benefit of building a custom purpose-built server is that LAMP really doesn’t have to be LAMP. Worried about security issues or complexity in Apache or MySQL? Then substitute lighttpd and SQLite in their place. Do your developers prefer Python over PHP? Not a problem, simply build and deploy Python instead. One of the lesser known benefits recently experienced in the world of embedded Linux is that the Shellshock vulnerabilities only applied to Bash — whereas many embedded Linux devices are deployed with BusyBox, whose built-in shell was not susceptible to the Shellshock vulnerability.

good start towards a full LAMP server. The microSD card also comes with a rich assortment of other useful software packages including Qt5 graphical toolkit, Xfce lightweight desktop, dropbear SSH server, OpenSSL, GStreamer multimedia framework and Firefox browser. While it provides a nice out-of-the-box demonstration and development environment, it’s not likely to include the right set of software for your par ticular application req uirements. However, you can effectively create your own purpose-built LAMP server and add in Apache or some other lightweight embedded web server such as lighttpd. Using the free Timesys LinuxLink Cloud Factory, it’s easy to reconfigure and rebuild the Gizmo 2 platform software to use a different package set.

WHILE THESE DAYS MOST OF THE ATTENTION IN THE IOT SPACE SEEMS TO BE AROUND SENSORS AND EDGE DEVICES, IT’S IMPORTANT TO CONSIDER THE ENTIRE ARCHITECTURE.

Scalability and intelligence Adding processing power into the IoT is also important, because edge devices are typically 8-bit MCUs, or increasingly lower end 32-bit MCUs with only KBs of memory. A purpose-built LAMP server — built for example with an AMD G-Series SOC containing quad or dual 64-bit x86 cores and gigabytes of DDR3 RAM — can really turbocharge the intelligence of the IoT by adding much more processing power per watt into the IoT architecture and enabling more advanced data fusion and processing, number crunching and analytics.

Example of a purposebuilt LAMP server For an inexpensive and compact, yet extremely powerful 64-bit x86 platform, consider the AMD G-Series SOC powered Gizmo 2 platform. It ships with a bootable microSD card that contains Linux, SQLite, and Python — a

Leveraging a GPU on a purpose-built LAMP server Increasingly, GPUs are being used to accelerate applications that have nothing to do with graphics. For example, SQL database operations and performance can be dramatically improved by implementing some parts of the SQL virtual machine directly on the GPU. Alternatively, the increasingly popular Open Computing Language (OpenCL) framework allows for any number of applications to programmatically access the GPU for non-graphical parallel computing.

Summary While these days most of the attention in the IoT space seems to be around sensors and edge devices, it’s important to consider the entire architecture. A purpose-built LAMP Server can play an important role in the IoT, by collecting, storing, processing and analysing the distributed device data as well as by controlling, managing and maintaining the devices themselves. n

WINTER 2014 

ELEMENT14  25

A HARDWARE OVERVIEW

LARK BOARD FPGA with Dual Core ARM Cortex-A9 @ 800MHz A fully featured Cyclone V SoC evaluation board integrated with a FPGA and ARM-based dual‑core Hard Processor System (HPS) in a single package and operates at speeds up to 800 MHz. The combined technologies help to reduce the overall system cost and power.

INTRODUCTION TO

FPGAs HAVE YOU WANTED TO START DESIGNING WITH FIELD PROGRAMMABLE GATE ARRAY BUT FOUND THE WHOLE TOPIC VERY DAUNTING? WELL YOU ARE NOT ALONE…

FPGAS ARE VERY VERSATILE DEVICES AND THAT THE ONLY LIMITATION IS THE CAPACITY OF THE DEVICE AND YOUR IMAGINATION.

By SIMON HOLT / STRATEGIC ALLIANCE MARKETING MANAGER, PREMIER FARNELL

HIS ARTICLE AIMS TO GIVE you a great starting point to enter into the world of programmable logic. Once you have started to understand this technology, it is surprisingly easy to use and will offer you an electronics design option different to anything else available on the market today. We will start by covering the basics of FPGAs, explaining the difference between the three most popular programming technologies currently available. This will be followed by an overview of the different building blocks that can be found within an FPGA. An FPGA is a programmable device that allows you to create your own digital chip. The basic building block of an FPGA is the humble transistor. Depending on the density of the FPGA device you decide to use, it can consist

T

26  ELEMENT14  WINTER 2014

of many thousands, even millions of transistors. These Transistors are grouped together to perform an array of functions, from a simple logic gate to a complex Clock circuitry block. The majority of these blocks are available to you to configure using the FPGA software tools.

Advantages of FPGA FPGAs are completely customisable and as long as there are enough building blocks in the FPGA you are using, they can be configured to perform any digital design. Due to the layout of an FPGA they lend themselves nicely to parallel processing designs, aided by the high I/O count normally found on them. Depending on the type of FPGA you use, they have the ability to be re-programmed. These devices are completely blank on power up

and require the user program their design onto it.

Disadvantages Probably one of the biggest reasons why people don’t want to use FPGAs is the steep learning curve in designing with them. It can take many hours to learn the design tools, coding language and debug software in order to get your design into the device and working as you want. In the past the price of FPGAs has often put designers off using them, but in recent years the prices have dropped to a level which is more attractive bearing in mind the flexibility they offer. The architecture of an FPGA means that it generally consumes quite a bit of power, although there are some design techniques available to combat this issue.

E

TYPES OF PROGRAMMABLE LOGIC DEVICES There are three main types of FPGA technology, which are SRAM, Antifuse and Flash‑based devices. These differ by the way in which their internal routing is programmed.

SRAM technology

Antifuse technology

Flash technology

Most FPGAs that are used for design today are based on SRAM configuration cells. The big advantage to using these devices is that they can be programmed and re-programmed multiple times. The two main manufacturers of FPGA devices, Altera and Xilinx, both produce SRAM based products and it is these devices that lead the industry in terms of product development and adopting new approaches to FPGA design. A downside to using SRAM based devices is that they require programming every time they are powered-up. This operation can be performed by the use of an external memory device or a microprocessor that provides the bitstream (configuration) code.

In contrast to SRAM based devices, Antifuse FPGAs are instant-on and keep their design code when switched off. The devices are configured by blowing fuses to create the interconnect circuitry. This is a one-time operation that is carried out before soldering them to your printed circuit board in a special programmer and cannot be reversed. The advantage of Antifuse devices is that they are very secure; it is nearly possible to clone an Antifuse FPGA. They are also ideal for harsh environments, particularly military, aerospace and space applications.

Flash based devices are basically a cross between the benefits of SRAM and Antifuse technologies. They store their configuration code in the device similar to an Antifuse device, but this can be changed like an SRAM based device. From a security point of view these devices come with a user-defined key and only the person with access to this key can read/ write data to and from the device. These devices tend to lag behind SRAM based devices in process node due to longer development times.

WINTER 2014 

ELEMENT14  27

IN SIMPLE TERMS AN FPGA IS A COLLECTION OF ELECTRONICS DESIGN BLOCKS CONNECTED TOGETHER BY MANY, MANY ROWS AND COLUMNS OF WIRES.

LOGIC BLOCK

INTERCONNECT

Over the past few decades they have developed from devices which contain just a few logic cells, to ones which now have dual ARM A9 processors, high speed interfaces and hundreds of thousands of logic cells like Altera’s Cyclone V SoC devices.

PROGRAMMABLE I/O

The make up of an FPGA Logic blocks Logic blocks (these have various names) differ slightly from one manufacturer to another, but generally they contain a number of combinatorial logic elements and one or more flip flops. Logic blocks make up the largest portion of an FPGA and often have other design blocks mixed in-between them to allow for a faster, better utilisation of the device. The diagram above shows a typical architecture of an FPGA.

Hard Intellectual Property (IP) Cores In recent years there has been an increase in the number of custom blocks being included in FPGAs. These are normally referred to as hard IP cores/blocks. These custom blocks allow for more efficient use of the FPGA. A very popular hard IP core being rolled out by FPGA manufacturers is hard processor systems.

28  ELEMENT14  WINTER 2014

Both Altera and Xilinx have brought out devices with Dual Cortex A9 processor blocks integrated in them.

Input/Output (I/O) Blocks The I/O Cells in an FPGA can be found around the outer edge of the device. They are used to connect the internal blocks to the physical pins on the outside of the chip. These blocks can be programmed to perform a huge number of different types of I/O standards. Some more complex devices have I/O cells that can process high-speed signals; these are referred to as Transceivers blocks.

RAM Blocks The Majority of FPGAs available today have dedicated RAM blocks distributed alongside the logic blocks. These blocks are really useful if your design uses RAM as implementing these RAM blocks in standard logic blocks is very inefficient and

heavily reduces the number of logic blocks left for nonRAM functions. Knowing the size of RAM blocks available on your chosen FPGA is very important as you can design with them in mind, making the most of the blocks available.

Interconnect/routing Each of the logic blocks on their own is not much good, as they need to be linked together to make larger design blocks. This is achieved by interconnecting routing between the blocks. There are many different types of routing within an FPGA. Some of the routing is short and goes from one block to its nearest neighbour whilst other interconnect lines go from the top to the bottom of the device. Special routing can also be found over the whole device, which is known as global routing. An example of this would be the clock circuitry.

These routing lines have low skew rates and go to every internal clock node on the device, enabling synchronised designs.

Programming A Configuration block is used to program all the different blank blocks inside a SRAM FPGA on power up. Boot up time needs to be considered and they are not instant on. SRAM have these configuration blocks whilst flash and Antifuse do not need this configuration block due to their design. n

READ MORE If reading this short introduction to FPGAs has made you keen to learn more, then head on over to element14’s Community pages. We have a dedicated group set up to just talk about FPGAs.

www.element14.com/ community/groups/fpga-group

Exclusively from

INTELLIGENT LAMP CONTROL with Infineon XMC1000 By ATTILA TOMASOVICS / SENIOR ENGINEER, INFINEON

INTELLIGENT LED LIGHTING IN OFFICES, RETAIL, HOSPITALITY AND HEALTHCARE, AMONG OTHERS, IS RAPIDLY GAINING POPULARITY. AN ESSENTIAL REQUIREMENT IS HIGH QUALITY COLOUR AND DIMMING CONTROL. FOR ALL THESE APPLICATIONS, THE BRIGHTNESS, COLOUR AND DYNAMIC BEHAVIOUR OF LEDS NEED TO BE CONTROLLED AS ACCURATELY, PRECISELY AND CHEAPLY AS POSSIBLE. HIS IS ACHIEVED BY modulating the current of LEDs. An additional, ver y challenging, requirement is flicker-free lighting. Modulated LEDs are prone to flickering but absolutely no flicker is allowed in these applications. Customers expect to see the colour they want to see at the desired dimming level and want to experience no flicker. Lighting applications are also becoming more complex which increases time to market. XMC1200 and XMC1300, members of the high-performance XMC1000 family of 32-bit microcontrollers, have a Brightness and Colour Control Unit (BCCU) which is a dedicated multi-channel lighting hardware module that enables fast development of high-quality lighting systems.

T

30  ELEMENT14  WINTER 2014

Modulation dimming

INTELLIGENT CONTROL GEAR

To control the brightness of an LED, its current needs to be controlled. The most accepted method to control the perceived brightness of LEDs is modulation dimming. The LED current level is fixed (e.g. at 100 mA) and perceived brightness is controlled by modulating this current. Modulation basically means switching the LED on and off very quickly. If the switching rate is high enough, then we see the lamp as a constant light source due to persistence of vision. Luminous intensity of the lamp is determined by the average time the LED is switched on, relative to the time it is switched off. e.g. an LED modulated by a square wave spends 50% of the time on. Its average luminous intensity will be half as high as when it is always on. The LED current is controlled by a driver. The desired brightness, represented by a digital value, is converted into an ON-OFF signal by a modulator. This ON-OFF signal, which is represented by a bit stream, enables/disables the driver. Many different modulation methods exist, such as Pulse-Density Modulation (PDM), PulseWidth Modulation (PWM), Pulse-Amplitude Modulation (PAM), etc. The BCCU module in Infineon microcontrollers generates pulsedensity modulated bit streams by randomised first-order sigma-delta modulators. The PDM signal contains ON and OFF pulses. Every pulse has the same fixed, user-configurable length called the bit-time. The resolution is 12 bits so all brightness information is contained in a frame of 4096 pulses. Due to randomisation for better EMI behaviour, the frames are not identical but contain the same number of ON and OFF pulses if the brightness value is constant. The ON and OFF bits are distributed in the frames as uniformly as possible to achieve the maximum number of ON-OFF and OFF-ON transitions and to minimise the stable time between transitions.

Driver stage with colour and dimming control LED driver LED driver

AC in

AC-DC LED driver LED driver XMC1000

Dali, DMX512

Sensors ●●INTELLIGENT LIGHTING

XMC1000 BCCU PDM

LED Driver

PDM

LED Driver

PDM

LED Driver

PDM

LED Driver

PDM PDM PDM PDM PDM

E ●●PULSE-DENSITY MODULATED BIT STREAMS● TO CONTROL LEDS ON UP TO 9 CHANNELS

ON time DC

PDM

OFF time

0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 ON pulses

●●LED MODULATED BY A SQUARE WAVE

OFF pulses

●●SMALL SECTION OF A PULSE-DENSITY MODULATED BIT STREAM

BIT STREAM

BRIGHTNESS VALUE

Modulator N

LED Driver 1

PERCEIVED BRIGHTNESS ●●LED BRIGHTNESS CONVERTED INTO A MODULATION SIGNAL

WINTER 2014 

ELEMENT14  31

Managing flicker If the bit time is too long or there are too many identical pulses next to each other, the eye may detect the switching and distinguish between ON and OFF levels instead of seeing the average value, which is experienced as flicker. The eye is particularly sensitive to flicker when it moves. To avoid flicker, the lighting system has to ensure that time between two transitions is always below a certain value. This value is commonly called the flicker fusion threshold. This threshold is not an exact value and it depends on the person watching the lamp, the colour, the environment, etc. To avoid any kind of perceptible flicker, the time between transitions has to be kept shorter than 333 µs. Furthermore, taking videos of LED lights with cameras may also cause flickering or banding in the recorded footage. The general recommendation is that the period should be maximum 20-100 μ s, depending on the camera, which is an even more challenging requirement. However, there is currently no official standard. For truly high quality lighting the ON and OFF times have to be kept really short. The OFF times are more critical because the eye is more sensitive to flicker at low illumination levels. Pulse-density modulation inherently supports flicker-free designs due to its high rate of switching, since the ON and OFF bits are distributed as uniformly as possible. The modulators in the BCCU module can generate pulses shorter than 100 ns. The bottleneck is the LED driver as it needs a minimum stable ON time to stabilise the LED current. With most LED driver solutions it is not possible to have pulses shorter than 1 µ s. This creates a potential flicker problem at very low brightness levels as the ON pulses are too few and far between. If the OFF time is too long between two ON pulses, the human eye may experience flicker and camera footage will look banded, not natural. The only solution is to disallow these very low brightness values. Every BCCU channel contains a flicker watchdog that ensures that the OFF time is never too long. If the OFF time reaches the user- definable threshold, an ON bit is inserted and the sigma-delta modulator is reset.

32  ELEMENT14  WINTER 2014

●●RECORDED LAMP REFLECTION WITH BANDING AND WITHOUT BANDING

Dimming and colour change

BCCU

For intelligent lighting it is also important to control the dynamic behaviour of the brightness value over time in a way that appears natural and is comfortable to the human eye.

● AMBER BRIGHTNESS

PDM

LED Driver

PDM

LED Driver

PDM

LED Driver

PDM

LED Driver

BLUE INTENSITY

DIMMING LEVEL

● BLUE BRIGHTNESS GREEN INTENSITY ● GREEN BRIGHTNESS RED INTENSITY ● RED BRIGHTNESS

●●DIMMING LEVEL AND CHANNEL INTENSITIES SEPARATED

BRIGHTNESS

N

T TIME

●●EXPONENTIAL DIMMING

N

N/2 CHANNEL INTENSITY

When the LEDs are organised into multiple channels, dynamic change can be divided into two distinct transitions. One is overall brightness change, also known as dimming. The other is colour change, a change in relative intensities. The internal structure in BCCU mimics multi-channel lamps with colour and dimming information clearly separated. BCCU can automatically change both the dimming level and the colour of multiple lamps in a natural way. During dimming, all channels change their brightness level but their relative intensities remain the same, to preserve the colour of the lamp. Due to logarithmic brightness perception, the human eye is more sensitive to low levels of illumination. If the brightness level changes linearly over time, it look non-linear. For natural-looking dimming, it needs to be exponential. The ability to dim along an exponential curve is also a requirement by DALI, one of the most popular lighting communication standards. BCCU contains dimming engines, hardware modules, which automatically perform exponential dimming without CPU load. The user only needs to select target brightness levels and fade rates, and the dimming engines automatically adjust the brightness levels along an exponential curve. Since the dimming engines do not rely on interrupts, they can follow the curve very closely without additional CPU load. The human eye is most sensitive to changes at the lower part of the exponential curve, where the brightness level is very low. At low fade rates, each individual step in brightness may be visible. BCCU adds dither to these steps to make the transition look smooth and gradual to the human eye. Multi-colour lamps combine a number of channels of different types of LEDs, each with a different dominant wavelength. What colour the human eye sees depends on the relative intensities of these channels. The colour can be changed smoothly and gradually by using the linear walk. The user only needs to set the target colour and the desired fade time. All affected channels change their intensity simultaneously until the new colour is reached.

AMBER INTENSITY

E

G

R

B

G

R

B TIME

Linear Walk

SPRING GREEN

ORANGE ●●LINEAR WALK EXAMPLE IN AN RGB SYSTEM

WINTER 2014 

ELEMENT14  33

Software development With so much hardware support, hardly any software development is needed for high quality LED control. Much of what little software is necessary can be generated by DAVE, Infineon’s free IDE which offers an easy-to-use graphical interface, automatic resource allocation and code generation to allow fast time to market.

●●LIGHTING PROJECT IN DAVE

Conclusion Infineon’s XMC1000 Cortex-M0 family is the ideal choice for intelligent LED lighting applications. It offers the resources required for a single microcontroller to automatically control multiple LED channels with high dimming and colour quality, communicate over DALI or DMX512, with more than enough bandwidth available for the end application. n

www.infineon.com/xmc

34  ELEMENT14  WINTER 2014

EAGLE Version 7.2 now available For more information, visit www.cadsoftusa.com

EFFICIENT & INTELLIGENT LIGHTING Using Infineon’s RGB LED Lighting Shield with XMC1202 for Arduino 36  ELEMENT14  WINTER 2014

■■ www.infineon.com/arduino ■■ www.infineon.com/xmc

■■ www.infineon.com/xmc-dev

LED lighting is gaining popularity due to government legislation and its overall benefits compared to traditional solutions. EDs are used for lamps and light engines in offices, retail, hospitality, street lighting, high bay lighting, healthcare, and more. LED lighting is efficient, allows maximum design freedom, and it can be intelligent as well as easy to use. Thanks to the latest RGB LED Lighting Shield with XMC1202 for Arduino developers can easily explore, evaluate and build their next LED powered product. The RGB LED Lighting Shield with XMC1202 for Arduino is built on the XMC1200 MCU series which has a Brightness and Colour Control Unit (BCCU). BCCU is dedicated for multichannel lighting engines by offering

L

full control of brightness, colour and dynamic behaviour of LEDs as accurately, precisely, efficiently and cheaply as possible. BCCU generates pulse-density modulated bit streams with randomisation for better EMI behaviour, and bit packing feature to be compatible with several LED driver designs. To offload the CPU automatic dimming is provided by adjusting the brightness levels along an exponential curve: the user only needs to select target brightness levels and fade rates, and the dimming engines take care of the rest. The ability to dim along an exponential curve is also a requirement by

Arduino™ Connector

Isolated DMX512 XMC1202 Control Interface (optional)

DALI, one of the most popular lighting communication standards. The little software required to control the BCCU can be created with DAVE™ IDE. DAVE supports automatic code generation, provides DAVE Apps with GUI programming, and example projects. Infineon’s XMC1200 MCU series as part of the XMC portfolio is the ideal choice for intelligent LED lighting solutions. XMC1200 microcontrollers provide all essentials for high quality colour, such as full dimming control, flicker-free light at all dimming levels with low energy consumption and ease-of-use thanks to the new RGB LED Lighting Shield with XMC1202 for Arduino. n

Debug Interfaces to XMC1202

I²C, GPIO

SWD XMC1202

LED String Connector DC Input Voltage DMX512 Power-on LED

LED Current Control with PDM DCDC LED Driver Stage

Arduino™ Connector

RGB LED LIGHTING SHIELD WITH XMC1202 FOR ARDUINO.

WINTER 2014 

ELEMENT14  37

THE BIRTH OF

By CABE ATWELL / COMMUNITY WRITER, ELEMENT14

38  ELEMENT14  WINTER 2014

CATHODE

ANODE

POST

ANVIL

WIRE BOND

ENERGY EFFICIENT WHITE LIGHT

HOLE P-LAYER

ACTIVE LAYER N-LAYER

ELECTRON SURE, THEY’RE BLUE, BUT WE CAN’T HAVE WHITE LIGHT WITHOUT THEM.

IT’S ALL IN THE GaN: GALLIUM NITRIDE REVOLUTIONISED BLUE LED LIGHTING PAVING THE WAY FOR WHITE.

Scientists win Nobel Prize in physics with their creation of blue LEDs ONS AGO (ROUGHLY 1907), scientists began messing with the idea of LEDs in the form of electroluminescence using a crystal of silicon carbide and a cat’swhisker detector. Apparently, Edison’s light bulb was no longer cutting the mustard and people wanted tiny little lights in their radios, which is probably why RCA was playing around with gallium arsenide-based semiconductors back in 1955. Regardless, LEDs have come a long way in the last hundred years and has become the dominant light source on the planet overtaking incandescent and fluorescent lighting. While the LEDs manufactured today are highly efficient, energy saving and environmentally friendly, they do have their drawbacks, in this case the ability to generate a broad spectrum of colours. More specifically, white light due

E

ANODE (p-electrode) p-GaN p-AIGaN Zinc-doped InGaN n-AIGaN n-GaN GaN Buffer Layer Sapphire Substrate CATHODE (n-electrode)

to the fact scientists couldn’t produce blue light in LED form. Confused yet? Okay, let’s break it down in simple terms- in order to create bright, efficient white light, green or red LEDs need to be combined with a blue LED. They could also be shown through a phosphor that emits red and green light. Sure there have been blue LEDs in existence since the 70s but the material they are made from made them pretty much useless in the broad spectrum (pun intended) of practical applications. By the late 80s, the people’s demand for bright, shiny things continued to grow and there still were not any devices (much less radios) with tiny LEDs that glowed bright white or blue. Noticing those demands, three material scientists decided the world could wait no longer for bright, efficient blue LEDs and began developing their own using gallium nitride.

In the early 90s, Professors Isamu Akasaki (Nagoya University), Hiroshi Amano (Nagoya University) and Shuji Nakamura (University of California) began working on a way to grow gallium crystals big enough to be used to emit blue light. They found that they could do so using a specially designed scaffold made in part with sapphire. That’s the key, different materials emit a different colored light when applied to LEDs and gallium was the ticket in emitting blue. Gallium isn’t without its troubles as it tends to become poisoned when exposed to hydrogen. The people would have to wait a few years more before they would get bright, shiny blue or white lights. To get around that issue, the scientists ‘doped’ up the gallium using aluminium or zinc but ultimately went with indium, which protects the gallium from the hydrogen used in manufacturing the semiconductor the LED resides on. The hard work that all three endeavoured over the years to get an efficient blue LED earned the trio a Nobel Prize this year in physics. Not only does their work provide bright and shiny LEDs in our mobile devices but also reduces the power draw on the grid when used for lighting our homes. Not only that, they are also better for the environment over compact florescent lighting (CFLs) due to the fact that the latter is filled with mercury. The trio received their prizes in December, where their breakthroughs could be seen lighting up the homes all over the city. n

WINTER 2014 

ELEMENT14  39

> >

rka>ge e v i Dr t Pac

/ or BBoSarPd Supp

6 8 X

AR

M

ARM vs x86

A CLASH OF ARCHITECTURES DECISIONS MADE DURING DESIGN PROCESSES SHAPE THE POSSIBILITIES OF SUCCESS AND FAILURE OF A COMPONENT, SUB‑SYSTEM OR END PRODUCT. By MURRAY SLOVICK / COMMUNITY WRITER, ELEMENT14

40  ELEMENT14  WINTER 2014



UCH OF THE TIME THESE choices are not clear cut and few reside in the proverbial ‘no brainer’ category. For the design engineer trying to decide whether to select an ARM or x86 architecture for his/her embedded project the decision, as Ringo Starr once put it, “you know it don’t come easy.” Indeed, with huge potential markets like the Internet

M

of Things (IoT) in the balance, both camps are going for the jugular, each (and their respective ecosystems ) hoping that their latest development will help them sell in the embedded market the way beer sells in a college town. In this article we will show how and why the decision to go with x86 or with ARM has become more complex and difficult than ever, as there are

clear benefits available for each architecture, depending on the task and design requirements.

The background

>

>

BSP Boa

/ Dr

rd S

upp

iver

ort

Pac > kag e

KEY DIFFERENCES OF X86 VS. ARM

VA BOARD SUPPORT PACKAGE, AN IMPLEMENTATION OF SPECIFIC SUPPORT CODE – SOFTWARE – FOR A GIVEN BOARD THAT CONFORMS TO A GIVEN OPERATING SYSTEM. IT IS COMMONLY BUILT WITH A BOOTLOADER. IN EMBEDDED SYSTEMS BSP IS SYSTEM AND DEVICE DRIVERS FOR ALL THE DEVICES ON THE BOARD. Source: Embedded Logic

But before we leap ahead of the story – and to be properly prepared to evaluate both contestants – a bit of background is in order. ARM and Intel (x86) chips have different processor architectures and instruction sets, so an application compiled for the Intel architecture will not run on an ARM device and similarly you can’t run code compiled for ARM on Intel devices. An ARM processor has a Reduced Instruction Set Computer (RISC) architecture while the X86 (for the purposes of this article x86 will refer to both 32-bit x86 and 64-bit x64, ARM will refer to all ARM derivatives) has a Complex Instruction Set Computer (CISC) architecture. CISC chips have an instruction set capable of doing complex things with a single instruction while a RISC processor has a smaller number of more general purpose instructions. It is important to note, however, that the simpler nature of a RISC instruction allows it to be processed in usually just one clock cycle (and often with fewer transistors, making the silicon less expensive and more power efficient). Generally speaking, a RISC-based ARM processor also requires more memory than a CISC-based processor. Traditionally ARM’s low power has enabled battery life that would be better than an x86 equivalent and with its built-in multimedia decoding capabilities it also enables 1080p HD video playback in a small package relative to the real estate an x86 system would require. Typically, too, for complex tasks such as would be needed to process and analyse millions of pieces of data, the raw performance from x86 often outstrips that of an ARM equivalent. If we want highend devices to perform telemetry and data transmission over the Internet for critical applications, for instance, x86 would still likely

be the choice, On the other hand, if high-end functionality involves only video and audio capabilities, ARM would be the nominee. Other important traditional (and I have been using the term traditional deliberately because as we will shortly see, things are fast changing on both sides of the playing field) factors are, for ARM: ■■ No BIOS (ARM uses a bootloader) and, therefore, no BIOS-related issues ■■ Power consumption in the range of about 2 to 20 watt Similarly, traditional advantages of x86 processors include: ■■ Well established Linux support ■■ Very high computing power and very short realtime response. As for run-time stability (uptime without crashes), which can be a key deciding factor, no clear cut winner here: Both ARM and x86 processors are relatively well suited to be used in industrial and other embedded systems that require stable, reliable and deterministic run-time behaviour. Now to the changes I alluded to. ARM and Intel chips are growing closer to each other and the traditional lines distinguishing them are starting to blur. Here are a few for instances. Intel is positioning Quark, its smallest processor, in the IoT device space supported by a new VxWorks 7 version of the widely used real time operating system (RTOS), developed by the Intel subsidiary Wind River, As a counter-measure ARM is launching a new, and free low power operating system to manage webconnected devices that use microcontrollers based on the company’s 32-bit Cortex-M architecture. ARM’s OS for this is called mbed, Although technically not a true RTOS (as a strict definition would require a predictable response time to an interrupt), ARM’s mbed takes what the company calls an ‘event based’ approach; the processor wakes up only if events need to be managed. ARM says that predictable response is not always needed and allowing the

WINTER 2014 

ELEMENT14  41

E

E

processor to complete one task before switching to another allows power savings over traditional RTOS requirements. Intel’s x86 chips have been improving in power consumption. Intel started with a more expensive, high performance architecture and has been lowering its power consumption and making its lower-end chips more price competitive. In particular designs based on processors such as the Intel Atom permit small, fanless and relatively efficient power solutions. Atom microprocessors have been used in a variety of embedded applications ranging from health care to advanced robotics

and mobile Internet devices. At the same time upper range ARM processors such as Cortex A9 have been introduced with high-speed interfaces and multi-core technology to increase performance. Processors such as Freescale i.MX 6 Cortex A9 now are competing with x86 platforms such as Intel’s Bay Trail-based Atom chips as well as AMD’s Embedded G-Series. All of these processors intended for embedded applications are one-chip platforms with one, two or four CPU cores. All also feature clock frequencies around 1GHz, DDR3 memory and high speed interfaces like PCI Express and HDMI.

SUPPORTS ‘‘QSEVEN ARM, INTEL AND AMD PROCESSORS ’’

BOARD & MODULE FORM FACTORS Boards and modules incorporating ARM processors typically run Linux, Windows CE (Compact) or Android. Boards and modules based on Intel and AMD x86 processors run full Windows, or the embedded versions such as Windows Embedded Standard. You can also run Linux on these platforms. Recent trends in processor technology also are affecting the newer lightweight COM class modules such as Qseven, and Smart Mobility ARChitecture (SMARC). The new Qseven specification update 2.0 allows using x86 and ARM processors on Qseven modules and can accommodate the new Intel E38xx Atom processors as well as such ARM processors as the Freescale ARM i.MX6 (both supporting a wide variety of I/O features). The new USB 3.0 and UART additions are widening the scope of this module family even further. The devices’ strong graphics performance can be used to drive HDMI, DVI, DisplayPort and LVDS displays. For example, the Qseven module with Intel Atom E38xx enables dual independent display while the Q7-IMX6 even supports triple independent display, a feature formerly limited to high-end computer boards. The majority of customers are either

42  ELEMENT14  WINTER 2014

using Qseven for x86 or Qseven for ARM exclusively; however, there some that are moving in both directions. With regard to Smart Mobility A rch i t e c t u re ( S M A RC ) , t h e SMARC pinout is optimised to support specific I/O functionality that is more commonly identified with ARM in mobile and handheld devices. For example, Advantech’s ROM-5420 is a SMARC form factor module only 82mm x 50mm in size, (with an overall assembly height of under 8mm) based on the Freescale ARM Cortex-A9 i.MX6 dual core processor. ROM5420 supports triple independent displays and a 1 x MIPI (Mobile Industry Processor Interface) camera input. Moreover, ROM5420 also supports lithium-ion batteries that have +3 ~ 5.25V power input design with suspend mode under 0.3W, which makes them an excellent choice for portable applications.

®

AMD HAS ANNOUNCED IT WILL DEVELOP PROCESSORS, CODE NAMED MULLINS AND BEEMA, WHICH WILL CONSIST OF AMD’S NEXT GENERATION X86‑BASED CORE, WITH AN ARM‑BASED CORE FOR HANDLING SECURITY FUNCTIONS ON THE SAME SOC

Source: AMD

But SMARC is not exclusively for ARM processors and board/module suppliers have announced x86-based SMARC modules as well. Consider Kontron’s latest SMARC computer-on-modules (COMs) featuring Intel’s Atom E3800 series processor. According to Kontron, it’s the first x86 SoC to become available on this low-profile COM form factor, measuring 82mm by 50 mm. The SMARC s-XBTi COMs, compliant with the Standard Group for Embedded Technologies (SGeT) specification, incorporate up to 8 Gbytes of RAM and can accommodate up to 64-Gbytes, on-board solidstate disk to store OS and application data. The pin-out includes three UARTs with complete GPS function and support for the MIPI-compliant serial camera interface. Intel Gen 7 Graphics are carried out via HDMI 1.4 and LVDS with up to 2500 by 1600 pixels and 60 Hz to the display. Other interfaces include one Gigabit Ethernet LAN via Intel’s Ethernet Controller I210, one USB 3.0 and two USB 2.0. Extensions can be implemented via two SDIO and three PCIe x1 lanes with 5 Gtransfers/sec. Operating temperature ranges from −40 to +85°C, while power consumption ranges from 5 to 10 W. Adding to what is already a recipe for brain freeze AMD has announced it will develop processors, code named Mullins and Beema, which will consist of AMD’s next generation x86-based core, with an ARM-based core for handling security functions on the same SoC. At the same time in parallel with the company’s next-generation of x86 processors, AMD plans to develop its own 64-bit ARM-based CPUs, code named ‘Project SkyBridge.’ Targeting embedded applications. SkyBridge’s ARM-based unit will use low-power 64-bit ARM Cortex-57 cores, while the x86-based chips will feature AMD’s next-gen Puma+ central processor cores. The clever bit is that the chips will be ‘pin-compatible,’ meaning they can both use the same circuit board, simplifying things (somewhat) for device makers. SkyBridge chips will be manufactured on a next-generation 20nm process and ship sometime in 2015. AMD’s roadmap reminds one of the 1968 film ‘Yours, Mine and Ours’ starring Lucille Ball and Henry Fonda, in which a widower with ten children marries a widow with eight, and the twenty of them try to come together as one big happy family. In summary, ARM is challenging x86 in the embedded space and x86 is counterpunching. As a result the decision whether to go with x86 or with ARM has become more complex and more difficult than ever. Two things we do know: 1) Among the factors that you will have to take into account are performance, price, power consumption, MIPS/W, hardware and software support, the volume you have in mind and more, and 2) as always the best place to go for parts and design help is to your friends at element14.com. n

AMD’S MULLINS PROCESSOR

WINTER 2014 

ELEMENT14  43

ARM Technology Part 2

System IP By ASHOK RAO / SENIOR SUPPORT ENGINEER, FARNELL ELEMENT14

Following up from our last article on classes of ARM processors, their advantages, applications, we now take a look into the other peripherals and technologies surrounding an ARM based core. This article focuses on a few key components of the System IP from ARM, with a focus around the hardware blocks inside an SoC.

44  ELEMENT14  WINTER 2014

YSTEM IP IS THAT PART OF an embedded system comprising of the various modules working in the background in order for the foreground peripherals to function as required. This could include the inter-module communication networks, debug and trace IP, cache/DMA/ interrupt/memory controllers etc. In other words, these are the nuts and bolts that connect the bigger blocks together. Let us look at them to try and understand in layman’s terms what these are, how they benefit the larger ecosystem and where all this fits.

S

CoreLink 500 series CoreLink system IP and design tools can conveniently be used for designing and building SoCs based on the AMBA specifications. The AMBA specifications maximise the efficiency of data movement and storage without compromising on performance. In other words, the latency involved in data transfer is considerably reduced using the AMBA specifications. The CoreLink 500 series comprises the CCN-504

(CCN: Cache Coherent Network) and CCN-508. These provide up to 1.6 Tbps throughput. This enables full cache coherency between up to 16 CPUs for CCN-504 and up to 32 CPUs for CCN-508. What do these numbers mean? It means, these can be paired with CoreLink DMC-520 (Dynamic memory controller) for DDR3 DRAM interfaces at up to 3200Mbps. What this means for you and me? Answer: Very fast RAM. The CCN-508 is more likely

to be used in enterprise solutions such as storage, servers and network infrastructure. The CCN-504 is the little brother of the CCN-508. The performance is slightly lower with scaling up to 16 CPUs and up to 1Tbps of system bandwidth.

CoreLink 400 series The CoreLink 400 series provides similar functionality as the CoreLink 500 series except that

it can support up to 8 CPUs and is optimised for mobile applications including big.LITTLE technology, automotive infotainment and enterprise networking. The 400 series comprises of CCI-400 (Cache Coherent Interconnect) and NIC-400 (Network Interconnect). The NIC-400 provides a fully configurable, hierarchical, low latency, low power connectivity for devices implementing the AMBA specifications.

CoreLink™ CoreLink technology is a part of the system IP that enables low latency, lower power consumption, multi channel memory controllers on the high performance Cortex and Mali processors. It can be safely visualised as the interconnection between the core and the peripherals. The CoreLink technology is further subdivided into interconnects, memory controllers, security features such as TrustZone and AMBA® (Advanced Microcontroller Bus Architecture). This family provides on-chip AMBA connectivity for the different components implementing the AMBA specifications. Let us now discuss the various interconnects such as CoreLink 500 and CoreLink 400 series and memory controllers.

Memory controllers Shared off-chip memory access plays a crucial part in influencing system performance, power and cost. CoreLink DMC (Dynamic Memory Controllers) deliver the best-in-class performance and power for AMBA based SoCs. The DMCs are further subdivided into the smaller 400 series and the beefier 500 series. The 400 series significantly enhances memory bus utilisation and pro-

cessor performance through QoS mechanisms. These are usually coupled with the CoreLink 400 series of interconnects as discussed above. The CoreLink 500 series of DMCs implements similar features as the 400 series but is optimised for enterprise level solutions providing additional features such as TrustZone and end to end QoS. The CoreLink DMC 520 is ARM’s 5th genera-

tion of memory controllers. For any enterprise level SoC, as the number of components increases, so does the demand for data. To satisfy this need for fast data, efficient access to the DRAM is required and is critical to the performance of the SoC. The CoreLink 520 has advanced QoS based scheduling and arbitration algorithms that handle read/write access to the memory. A multi level parallelism is also adopted

to increase performance. CoreLink 400 is the little brother of CoreLink 520 that can be used in conjunction with the 400 series of interconnects as discussed previously. There is also an older generation of DMCs, the 32x series that was optimised for DDR, DDR2, SDR and other such older generation of memory technologies. These are still in use but their popularity has considerably reduced over the years.

WINTER 2014 

ELEMENT14  45

E

Debug and Trace IP ARM offers one of the best on-chip debug and real-time trace solutions for the entire SoC. These make ARM based SoCs some of the easiest to debug. Technologies such as CoreSight™ and Trace Macrocells work in parallel to help developers design, debug and optimise code in the fastest and easiest ways possible.

CoreSight CoreSight as the name suggests is something that looks inside the core. CoreSight technology enables developers to develop and optimise software for ARM based devices with fewer pins on the SoC itself. For the Cortex-A series of processors the debug can be performed with only two pins using the Serial wire technology or alternatively using JTAG. Some of the other advantages of using CoreSight are listed below: ■■ Using the CoreSight DAP and embedded cross triggering, it is possible to perform multicore debug and run time control while also collecting time stamped CPU or system trace to analyse, optimise and debug software and hardware interaction. ■■ CoreSight trace macrocells enable developers to examine how the software behaves on the target platform. ■■ CoreSight also provides provisions for secure debug and trace. It also allows designers to implement a debug and trace solution with very low power consumption. ■■ CoreSight is highly re-usable enabling SoC developers reduce design and development time. Some of the real world examples where CoreSight proves advantageous are listed below: ■■ For embedded software/middleware developers, device driver development can be faster by observing the CPU trace while executing software in real time.

46  ELEMENT14  WINTER 2014

For application engineers, applications can be optimised even at assembly level using system trace and performance counters. It can also prove beneficial for power and performance analysis on the SoC. ■■ For product engineers, it can be useful in failure analysis. The CoreSight technology has also been applied not only to the Cortex-A series but also the Cortex-R and Cortex-M series of processors as well. On the Cortex-R series, CoreSight provides nonintrusive trace that helps in understanding and optimising how real time software operates on the target. This is achieved using a set of Trace macrocells that are discussed in the later part of this article. On the Cortex-M series, CoreSight provides a low cost debug and trace functionality using a whole gamut of macrocells, breakpoints and watchpoints. ■■

CoreSight components The CoreSight components along with the trace macrocells provide the necessary infrastructure required for effective development and debugging. Two key components comprise the CoreSight: the trace memory controller and the debug access port (SWD/JTAG). The TMC (Trace Memory Controller) provides low cost real time trace all along the development cycle (including production) for third party software developers giving them

real time visibility of their code execution. An advantage of using the TMC is that traditional designs tend to generate dynamic bandwidth of trace. This usually varies with time, the type of application and occasionally causes peaks leading to loss of trace data. Whereas the TMC uses a FIFO model enabling trace over a longer period of time thus reducing risk of overflows. This in turn also allows for a smaller trace port reducing the cost of implementation of a trace port on the SoC. The Serial Wire Debug is a widely known debug technology used mostly as an alternate to JTAG. It needs just two pins and is available as part of the CoreSight DAP (Debug Access Port).

Trace macrocells Trace macrocells provide non-intrusive visibility of the components in the SoC. These are individual blocks that help capture trace data based on their particular function. There are four different types of trace macrocells viz. Embedded Trace Macrocell (ETM), Program Trace Macrocell (PTM), Instrumentation trace Macrocell (ITM) and AHB Trace Macrocell (HTM) (AHB: Advanced Hardware Bus). The usage of each of these is briefly outlined below: ■■ ETM: used for non-intrusive, cycle accurate program and data trace for ARM processors. This occurs at the assembly instruction level.

PTM: is used for program flow trace specifically with the Cortex-A9. ■■ ITM: used for high level software view (the C/C++ layer). ■■ HTM: is used for performance and functional debug at the hardware level. What is the advantage of having all of these macro cells? Well, conventional debugging requires breakpoints/watch points to halt the processor and use a debug connection from there to read, examine and modify register contents. This method is intrusive, requires the processor to stop, is non real-time and does not give an indication of true performance. Whereas, using trace capture, developers can capture real-time data including instruction level data, compress it and deliver it either on-chip or off-chip. This leads to real-time data analysis, is non-intrusive and does not halt the processor and is much more accurate for performance analysis. The various trace macrocells mentioned above are all essential components of the entire debug and trace ecosystem for a SoC. A latest development in the series of macro cells is the STM (System Trace Macrocell) that offers developers printf (the well-known C language output statement) style debugging giving visibility of the core from the application layer itself. ■■

System controllers System controllers are the peripherals that work in conjunction with all the other controllers discussed above. These involve the cache controller, DMA controller, Interrupt controller, TrustZone™ and the system MMU (Memory Management Unit).

Cache controllers Cache controllers play a critical part in CPU to on-chip data access. They reduce the latency of off-chip data access by about 10-25%. This reduction in CPU demands for off-chip data means it can now be used for other tasks. Lower demand for off-chip data also reduces power consumption. Thus cache controllers contribute to power efficiency and performance.

DMA controllers DMA control plays an important part in reducing the data transfer load on the CPU. It takes the task of moving in and out large blocks of data from peripherals to memory and/or from memory to memory. This data movement activity by a separate unit greatly reduces the load on the CPU. ARM provides two DMA controllers: DMA-330 and DMA-230. The DMA330 is a highly flexible, configurable DMAC and is mainly targeted at higher end SoCs. The DMA-230 is a simpler version of the DMA-330 and is ideal for use with Cortex-M series designs. Both of these support trans-

fer modes such as Scatter-Gather, Ping-Pong and Primary-Alternate.

cious software attacks? Answer: Very important. ARM provides TrustZone technology to prevent access to selected memory regions Interrupt controllers and peripherals such as screens As the complexity increases with multicore CPUs and their handling an and keypads. TrustZone extends the security to both on-chip and off-chip ever increasing number of interrupts from peripherals, so does the require- memories. The technology works by partitioning the available memory ment for interrupt controllers. ARM provides many GICs (Generic Interrupt into ‘N’ number of secure regions, Controllers) to suit various needs. The access to which is restricted. For on-chip security, the TrustZone Boot GIC-500 is the latest addition and ROM provides 8-16KB for signature supports the ARMv8 architecture. It can handle up to 128 CPUs and 480 code check. It also provides on-chip shared peripheral interrupts. The GIC- memory for secure data and on-chip RAM for secure code and data. For 400 is the younger sibling that can off-chip security, it provides options handle up to 8 CPUs and 480 interrupts. The GIC-390 is based on vector to partition the available RAM into addressing and stores the CPUs vec- up to 16 secure regions making tor addresses in memory. The PL-190 it immune to software attacks. All can handle up to 32 interrupt sources this is controlled by the TrustZone and 16 vectored addresses while the Address Space Controllers TZC-380 and TZC-400. PL-192 supports up to 32 vectored interrupts with programmable priority levels and masking. CoreLink peripherals A number of APB (Advanced Peripheral Bus) are provided from TrustZone controllers ARM to ease building complex SoCs. Question: How important is security Some of these are the UART, SPI for your code and stopping mali-

CONCLUSION The performance of an ARM based processor is not the sole responsibility of only the core. There are a number of peripherals acting around the core that influence the performance and efficiency of any ARM based processor. There will also be a number of factors affecting the communication speed between the core and peripherals which need to be optimised. All this processing power and speed also needs to be

controller, PS/2 interface, GPIO controllers to name a few. Detailed discussion of these is beyond the scope of this article.

Where does all this fit? SoC design is a very complex task and various factors need to be considered to achieve the required performance. This even applies to the extent of using the optimum length of the metal for interconnections on the chip though micro/nano meters long. At this level of required accuracy, every single block matters to achieve maximum performance. Nobody likes to wait forever for software to load or a video to start playing. DMA controllers, cache controllers, interrupt controllers etc, all play a vital part in bringing everything together to help SoC designers build the ultimate chip for any dedicated task. Software and application engineers then use these chips to generate software that efficiently utilises all the available resources on the chip to create immersive and useful applications.

channelled properly to the outside world for developers to optimise their designs and software. All the peripherals discussed in this article are the skeletal connecting blocks, in other words the threads that hold the fabric of the processor together and provide the required throughput. In the next part of this series, we will discuss some of the other technologies from ARM such as security on ARM based devices and a few other software tools required for an effective design and development of an ARM based embedded system. Until the next edition of element14 Tech Journal... n

WINTER 2014 

ELEMENT14  47

Designing with Cortex-M MCUs?

Get the same power and spend less, with

KEIL DEVELOPMENT TOOLS Discover the same functionality found in the Standard Edition – yet supporting only Cortex-M devices. It’s a complete software development environment for Cortex™-M, processor-based devices, specifically designed for microcontroller applications. It’s also easy to learn and use, yet powerful enough for the most demanding embedded applications.

THE NEW KEIL-MDK CORTEX-M EDITION OFFERS THE SAME FUNCTIONALITY AS THE KEIL-MDK STANDARD AT A FRACTION OF THE COST!

NOW WITH ARM CORTEX-M7 SUPPORT

Interested in ARM/Keil development tools? Speak to our ARM certified FAEs: [email protected]

Developing on an ARM-based processor?

SAVE A BUNDLE! DSTREAM + DS-5 BUNDLES We’ve combined DSTREAM hardware and DS-5 software tools into a complementary solutionpackage to save you money. Check out both the node locked and floating license versions. Our ARM Bundles include:

DSTREAM

STREAMLINE

The ARM DSTREAM high performance, debug and trace unit enables powerful software debug and optimization on any ARM processor-based hardware target.

The ARM StreamlineTM Performance Analyzer is the Linux and Android performance analysis tool in DS-5.

ARM C/C++ COMPILER

DS-5 DEBUGGER

The ARM Compiler in DS-5 Professional Edition is the only commercial compiler co-developed with the ARM processors and specifically designed to optimally support the ARM architecture.

The DS-5 Debugger uses the most advanced ARM technologies to equip developers with a complete debug solution for software development projects, from hardware bring-up to application development and tuning.

Get yours today! For more information on ARM embedded products and resources please visit

www.element14.com/ARMPromo