The MCU Application – Tools

Project March 2nd, 2009


For this part of the project all tools were made available by Freescale Semiconductor. A Development Kit was made available with 2 Demonstration Boards, Metrowerks CodeWarrior Special Edition software and all the necessary cables and connectors.

Demonstration Boards
The two boards provided are exactly the same. The layout of the board is shown below.

board

Figure: The Demonstration Board Layout

In addition to the MCU this board has an XY accelerometer chip and a Z-accelerometer chip. These chips were not used for this project. The Maxim 3318E is a 2.5V powered RS-232 compatible transceiver. This chip is required as it allows communication between the board and a PC application.

LEDs on both boards were used but only the switches on the coordinator were utilised.

Antenna

The figure below(Freescale, 2005) shows the dimensions of the antenna on the demonstration boards. If only all antennas (or antennae?) were so simple as to be wireless internet providers.

pcbantenna

Figure: Printed Circuit Board (PCB) antenna dimensions

Background Debug Mode (BDM)
While there is a BDM port on the board, I was unable to obtain a BDM programmer. This meant that I had to use the serial port to flash the MCU. This was accomplished with the aid of Test Tool, described in section 3.5.7. Embedded Bootloader and Test Tool.

MC9S08 GT60CFB
The MC9S08 GT60CFB, also referred to as the HCS08 microcontroller, is an 8-bit microcontroller from Freescale Semiconductor. According to the official press release in June of 2003 (freegeeks, 2004), the HCS08 MCU family was developed ‘for applications that sit idle for long periods of time yet must be able to power up quickly and operate at high performance levels upon demand’.

HCS08 Features:

  • Multiple power management modes, including a 20 nanoamp (nA) power-down mode
  • A zero-component auto-wakeup from “stop” to help reduce costs and reduce power to 0.7 microamp (uA) – Up to 40 MHz CPU/20 MHz bus at 2.1 V and 16 MHz CPU/8 MHz bus at 1.8 V
  • A programmable internal clock generator with temperature and voltage compensation (typical drift < 2%) designed for reliable communications, fast start up and reduced system cost
  • In-application reprogramming and data storage via third-generation 0.25-micron flash technology
  • High integration including four serial communication ports, up to 8 timer/ Pulse Width Modulators (PWM), and an 8-channel 10-bit analog-to-digital converter specified down to 1.8 V.

From the above features it is possible to see that the HCS08 is an ideal MCU for any ZigBee or IEEE 802.15.4 application.

MC13192 from Freescale Semiconductor
The MC13192 operates in the 2.4GHz frequency band and includes a complete packet modem that is compliant with the IEEE 802.15.4 standard. The device interfaces to the HCS08 MCU through a four-wire serial peripheral interface (SPI).
A system level block diagram of this is shown in the figure below.

systemlvlblock

Figure: System Level block diagram

Demonstration Code
Eight demonstration programs are provided on the Freescale website and these are suitable for both the coordinator and device. They focus on showing how to develop an IEEE 802.15.4 compliant application. Example 1 is a very basic program and each subsequent example builds upon the previous one. Example 8 provides an application that implements security and beaconing as well as communication with the UART.

Other example code was provided by Freescale, using a Simple MAC (SMAC). Although it has come of the IEEE 802.15.4 MAC features, it is not compliant IEEE 802.15.4.

Header files were provided in addition to the demonstration code. The code supports many Freescale kits and is often updated by the developers at Freescale. For the duration of this project I had to compare all of the 27 header files each time an update was provided. Some errors in the code were discovered by myself and corrected. As soon as I had a working application I no longer updated my code when there was an update to the source/header code.

There was no online support from Freescale for the demonstration boards or for the code. Any difficulties encountered were solved either by myself or, if I was lucky, on a discussion board where someone else had already encountered the same problem. There is no version control in the code they provide and so there was no way to tell what part of which files they update.

Libraries
Two libraries are provided by Freescale – the PHY library and the MAC library representing the PHY and MAC layers of the IEEE 802.15.4 standard. These libraries are constantly changing as the developers make additions and corrections to the code. I started the project with version 1.051 and finished with version 1.056.

Source code of the PHY library is provided for flexibility in using the different demonstration and evaluation kits from Freescale.

No source code is provided for the MAC library. This means that the only development environment that I was able to use was Metrowerks CodeWarrior. The table below shows the size of the different MAC libraries, depending on the node type.

table
Table: MAC libraries for different node types

In this project the FFDNBNS library was used for the coordinator node and the RFD library was used for the device node.

Metrowerks CodeWarrior Development Studio

The version of CodeWarrior provided is the Special Edition, and is specifically for the HCS08. I used both Rev 3.0 and Rev 3.1 and found no difference between features I used.

By registering the copies of CodeWarrior that I had I was able to obtain a free license. This license allowed 16K of code to be compiled. However, there is a restriction of 32 files per project. Initially this was a problem as the demonstration programs contain more than this. I was able to reduce the number of files by deleting those that I did not need for this project and by combining some of the smaller header files.

I was still unable to compile the demonstration code but was successful in compiling some of the SMAC examples. This is not what I needed and using MAC libraries with a size of 21k and 29k, a 16k license was useless. I began looking towards other development environments like the Imagecraft ICC08 and the Cosmic Software HCS08 tools before discovering that I could only use the provided MAC libraries with CodeWarrior.

Eventually I was able to attain two 30-day full-version evaluation licenses for CodeWarrior, allowing me 6 weeks to complete this part of the project.

The programming language used was C.

Embedded Bootloader and Test Tool
Embedded Bootloader is located in a protected 4kB flash block in the highest memory area (0xF000-0xFFFF) of the HCS08. A BDM debugger is required to erase the Embedded Bootloader – this helps to prevent accidental erasure.

The Embedded Bootloader provides a way to flash the MCU and was especially helpful since I did not have any BDM tools. Test Tool is a program that utilises the Embedded Bootloader, allowing programming of the MCU via the serial port. This is provided on the Freescale website and also comes in a command prompt version.

The only requirement is a PC with a serial port, running Windows 2000 or XP.

Arch Rock claims to have found a way to run ZigBee signals over a wired network

Press Release February 23rd, 2009

Arch Rock claims to have found a way to run ZigBee signals over a wired network.  Traditionally, ZigBee has been used to transmit information efficiently across wireless networks.  Arch Rock’s new method could effectively integrate smart meters with data centres.

Arch Rock says the new technology will make it much easier to manage and control power consumption without having to rely on gateway hardware that connects ZigBee devices to IP-based networks.  “Every [ZigBee] node becomes IP-enabled,” said Malay Thacker, director of customer solutions at Arch Rock.  He spoke February 19 at the Teladata Technology Convergence Conference in Santa Clara, California.

ZigBee is quickly emerging as a standard protocol for smart metering.  Arch Rock’s discovery could boost the company’s stance in the industry by providing ZigBee support to a wider range of networks.

Thacker cautioned that his company’s Compact Application Protocol (CAP) is “still very much in development,” and isn’t featured in any of the pilot projects or deployments that Arch Rock is currently involved in.

CAP allows multiple vendors of ZigBee devices to co-exist on the same network without the need of a gateway.  Arch Rock demonstrated its technology at last year’s Sensors Expo and has submitted the technical specifications of the CAP protocol to the Internet Engineering Task Force (IETF).

Even though Arch Rock has targeted industrial and commercial customers, half of its deployments have been in data centres, according to Thacker.  Other companies like Cassatt, Power Assure, Sentilla, and SynapSense have specifically targeted the data centre power efficiency market.

Data centres are very power hungry.  As these top-of-the-line computers have become more sophisticated and complex their power needs have also increased.  The amount of power needed by servers and data centres could double to 100 billion kilowatt-hours within 3 years if they do not become more energy efficient, according to the U.S. Environmental Protection Agency.  Energy costs would top $7.4 billion annually.

Another company called Agilewaves has developed an Internet-based system that links a building’s water, electric, and gas monitoring systems together through an integration panel.  Arch Rock is also testing its own home power monitoring technology with a pilot project involving three homes in San Francisco.

Arch Rock, as a member of the IPSO Alliance, actively promotes the Internet Protocol (IP) as the best way to connect smart technology and share the information that they provide.  “We’ve seen strong cross-industry participation from semiconductor makers, software companies and systems integrators,” said Geoff Mulligan, chairman of the alliance.

“Most significantly, more and more utilities and OEMs are viewing embedded IP as the long-term solution – and proprietary approaches and ad-hoc alliances as merely an interim step.  They are recognizing that only IP can support a wide variety of networking technologies with the needed scalability and interoperability that organizations require.”