Current Issue
|
Texas Instruments Technical Resources
FREE Vicor PowerTechtorials CD
Snow job 4/1/2010
MORE BLOG POSTS
If you’re one of the many people who remain unconvinced that the recent changes in global temperature are the product of human activity, a new study by scientists Mike Lockwood and Claus Fröhlich from the UK’s Rutherford Appleton Laboratory/University of Southampton and the World Radiation Centre in Switzerland might just change your mind (Reference 1). In their conclusion, the authors state “our results show that the observed rapid rise in global mean temperatures seen after 1985 cannot be ascribed to solar variability, whichever of the mechanisms is invoked and no matter how much the solar variation is amplified.” According to commentators from the carbon lobby, this study is crucially significant because it’s the first time anyone has proved that solar activity cannot account for the degree of global warming we are experiencing—so it must be our carbon-heavy human habits thatare to blame.
As engineers, it’s obvious that adopting a conservationist policy is common sense—a view that the wider population seems increasingly willing to embrace. One result is that there’s a growing community of engineers that directs its efforts towards minimising the environmental impact of our industry’s activities. The majority of these initiatives involve large-scale developments, from designing more efficient power-conversion silicon to installing multi-megawatt wind turbines. But there’s also a huge amount of much smaller-scale activity that’s often driven as much by cost and practical considerations as by environmental concerns, offering interesting opportunities to small-to-medium-sizeenterprises.
| AT A GLANCE |
|
One example is the need to power equipment in remote locations, from water-quality-monitoring stations to cellular base-stations. Such installations require considerable system management to maximise power-supply availability to critical services, intelligently routing energy from sources as diverse as traditional diesel generators, contemporary solar cells, mini wind turbines, and storage-battery arrays. In every case, telemetry is a key component of the overall SCADA (supervisory control and data-acquisition) system, enabling central control systems to monitor andmanage remote services.
WIRELESS ON A BUDGET?
So, how do you develop a remote wireless link on the limited budget that typically accompanies pilot projects? This was the question that faced Steve Robinson, principal engineer at softwaredesign consultancy 2Step Limited, who quickly realised that the best method was far from obvious—especially as the design brief not only included requirements for higher availability and efficiency than a competitive system, but also demanded low manufacturing, deployment, and operating costs. To keep the wirelessconnectivity options as open as possible, Robinson chose underlying hardware using a microprocessor family that offers CAN (controller-area-network), Ethernet, RS-232, and USB communications. In this case, the processor was a C166- family device from Infineon Technologies, which Robinson selected primarily because he was already familiar with the development toolchain. The hardware also re-uses elements of 2Step’s dataacquisition designs that form the heart of several professional motorsport products, giving confidence that the system can withstand challenging environmentalconditions.
The requirements list for the wireless link is relatively short. For ease-of-use, the link must seamlessly integrate with not only the renewable energy system but also with common back-office systems at the customer’s central control location. For the software writer’s convenience,the link technology will preferably take advantage of Internet protocols thatenjoy widespread software-bridge support.Communications must be secureover widely available wireless channels,with the possibility for deploying robustencryption techniques in response touser demand. The technology must bealways-on, consume little power, offerhigh availability, and be scaleable tosupport multiple independent nodesand/or link redundancy.
Because production volumes are unlikely to amortise the cost of developing custom communications hardware, Robinson’s strategy involves outsourcing the wireless-communications technology. For instance, experience from a previous 802.11 wireless Ethernet project shows that the minimum annual build that makes custom hardware possible is around 20,000 units, with most chip makers being unwilling to enter into a dialogue with anyone whose predicted volumes fall below this threshold. This leaves fully assembled and—far more importantly, even for competent RF engineers—pre-qualified modules as the only route that’s financially viable for low-volume users. Furthermore, being able to regard the RF link as a black box that simply requires system integration offers obvious attractions in reducingdevelopment costs and time-to-market.
Within the current project’s context of long-haul RF links, Robinson examined several alternative solutions. For example, the UK-based Airmax Group designs and builds GSM and satellitebased telematics systems. Its product portfolio primarily targets the automotive industry, using intelligent vehicle tracking as the core technology—even going so far as to interrogate a vehicle’s ECU (electronic control unit) to extract information that can profile the driver’s operation of the vehicle. The interest from Robinson’s perspective is that Airmax has also developed in-vehicle and workshop hardware to support garage and remote vehicle diagnostics. The communications hardware necessarily includes CAN interfaces, which particularly suit his target application. Important additional services that Airmax offers include the ability to customise the CAN interface, as well as to design the server-side data-collectionand control functions.
More promisingly from the viewpoint of minimising start-up costs, Robinson established that several hand-held consumer devices appeared able to meet the system’s functional requirements. Key candidates comprise products from the BlackBerry and Xda ranges, which in the UK link into the GSM (global system for mobiles) infrastructure via portals that service providers Vodafone and O2 operate, respectively. The phones are only available through cell-phone carriers, each of whom has its own models. However, these devices enjoy widespread support in most countries and connect to networks with the potential for international coverage. Because they are consumer-level devices, these phones are relatively cheap to buy and run—and incorporate build quality that resists most abuses that consumers subject their mobiles to.The phones’ general capabilities include always-on communications formaking voice calls, exchanging emailand text messages, and Web browsing.In considering alternative applicationsfor the handsets, Robinson questioned,“While clearly a very practical tool forthe business user, we wonder if thistechnology provides a low-cost monitoringand control gateway for remoteindustrial processes?”
SOFTWARE IS KEY
The BlackBerry’s manufacturer is Canadian-based RIM (Research In Motion), while O2 sources its Xda from what the independent developer’s Web site describes as “a secretive firm called HTC in Taiwan”. Although HTC (High Tech Computer) is one of the world’s largest manufacturers of mobiles and is reportedly Taiwan’s most profitable listed firm this year-to-date, it’s clear from the developer’s website that the company has no interest in sharing information that assists developers. By contrast, RIM supplies the BlackBerry’s native email system but actively supports external application-software development. For instance, the company has cooperated with Microsoft, IBM, and Novell to provide full two-way email integration with these companies’ Outlook, Notes, and GroupWise software products, making it straightforward to interface the device with back-officesystems.
Crucially, you can download application- development software tools for free from the BlackBerry Web site, offering the potential for developers to create custom functionality. The website also lists a third-party alliance programme of ISVs (independent software vendors) with a substantial range of third-party software, much of which targets business- infrastructure uses such as fieldservice help and sales-force automation. Tyler Lessard, the company’s director of ISV alliances, says: “Having the BlackBerry as a platform for other applications is an important part of the product’s success. It was for this reason that we made the developers’ tools free of charge.” Lessard reports that RIM is constantly hearing of new applications for the product and actively encourages that initiative: “Applications span anenormous breadth from games and enterprise support tools to niche industryapplications, such as the one you areworking on.”
Unable to resist free software tools but keenly aware that free doesn’t always mean good, Robinson decided to evaluate this option. You can choose from three development environments, each of which requires a Windows host. The first is the BlackBerry JDE (Java Development Environment) v4.2.1, an IDE (integrated-development-environment) and simulation tool for building applications for Java-based BlackBerry devices. The Java version is the Micro Edition, a collection of Java APIs (application-programming interfaces) that suit resource-constrained consumer mobiles. This environment is MIDP (Mobile-Information-Device Profile)- compliant, letting you write downloadable applications for the BlackBerry that are portable between other wireless- application-development environments. This is a very comprehensive package with an over-300-page userguide, more than 30 example projects, and a complete API presentation inHTML format.
Your second option is BlackBerry MDS Studio (v4.1 SP3), which is an application builder for developers who need to get a BlackBerry application upand- running as quickly as possible. The toolset includes pick-and-place controls for items such as labels, images, option pop-downs, and command buttons. You also get a menu builder and the means to directly access data sources from Webservices.
The last option is the BlackBerry plug-in for Microsoft Visual Studio 2005, which was only available for download in the US and Canada at the time of writing (Figure 1). The publicity material promotes the advantages of being able to write BlackBerry code using Microsoft’s .NET environment. But there is no mention of which Visual Studio development languages the toolset supports (Basic, C++, C#, or J#) and no indication that Visual Studio’s debug tools will integrate with RIM’s Device Simulator, a utility that allows you to test applications before uploadingthem to a BlackBerry device.
Regardless of the development environment, the interface that Robinson chose to bridge the remote system’s hardware and the BlackBerry uses the phone’s USB-on-the-Go port. As for the transport mechanism, he decided to evaluate the BlackBerry’s messaging service for creating emails to report the remote system’s datalogging results, and use the same method to deliver command information from a centralsystem.
BLACKBERRY MDS STUDIO
Promising ease-of-use, the BlackBerry MDS (Mobile Data System) Studio’s drag-&-drop approach initially proved difficult to access. You have three choices for creating a new project— the quick-start approach wizard, the top-down approach wizard, and the bottom-up approach wizard. The first two methods involve selecting a datasource- service definition (such as a WSDL) without explaining what these terms mean (WSDL most commonly translates to Web-services description language, a format for describing networkservices in extended mark-up language, or XML). If you select eitherof these wizards, you then have tochoose between a Web service connectorplug-in, an Oracle database connectorplug-in, or an SQL (standard-querylanguage)server database plug-in.As Robinson was unfamiliar with theother terms but had Microsoft SQLServer 2005 Express on his test PC, hechose the SQL option. He notes, “Thetool then prompts you for informationabout the connector, but in the absenceof any knowledge of JDBC—a standardfor Java database connections—thisapproach proved fruitless!”
The pragmatic approach is to follow the Web-service connector plug-in route and browse for a “Sample Web Service” at the BlackBerry website. It’s also worth noting that although the user manual does not help, the “BlackBerry MDS Applications fundamentals” section within the MDS help service makes it easier to understand why you need to identify a data source as soon as you start development. From then on, the experience becomes less frustrating and you can quickly construct an application by dragging controls onto the screen. In use, the environment shares some similarities with Microsoft’s embedded VisualBasic for WinCE/Pocket PC. For instance, an accurate representation of the device appears on the host PC’s screen and it’s easy to place simple buttons and controls (Figure 2). Assigning events to the controls functions more like the form builder within Microsoft Access. Robinson summarises, “MDS provides a powerful, quick method for creating applications that connect to theBlackBerry’s messaging model.”
But he observes that his project is not a mainstream BlackBerry application and that the MDS help system contained no reference to USB: “It is possible to add JavaScript to the controls that MDS creates, and it may be possible to create a USB-based application in this way—but with all references to USB support pointing to the BlackBerry JDE, this route was thenatural choice.”
JAVA ON A BLACKBERRY
This is a more serious approach to development that first requires you to install Sun Microsystems’s freely downloadable Java 2 Platform, Standard Edition, v1.4.2 software-development kit (the J2SE SDK). When you then load the BlackBerry JDE, the design approach is radically different from that of the MDS. The manual helpfully explains how to construct Java projects. A student might start from the basics of the environment and create a linked series of BlackBerry screens, assigning controls to each of the screens and code to those controls. Because the IDE includes well-developed sample programs for all aspects of BlackBerry programming including USB connectivity, a more pragmatic approach is to use an existing project as a template forfurther development.
Robinson says, “Then came the surprise—the IDE is no dry workplace. Build your code and select Debug to launch the BlackBerry Simulator (Figure 3). Run your application in the most realistic simulation you could imagine. Anyone with a BlackBerry in his or her pocket will immediately be able to use the on-screen device, even down to the pearl tracker-ball that replaces the thumbwheel of earliermodels.”
The JDE includes a sample application for communicating locally via USB together with a Visual C++ projectthat allows you to test communications between the phone and a PC. Clearly,testing USB connections requires runningthe code in the BlackBerry ratherthan the simulator. The ApplicationLoader program that downloads codeis the same tool that comes with thephone and enables end users to installthird-party applications. To test the USBlink, compile the USB demo code, makeit uploadable by generating an ALX file,run the Desktop Manager utility, andtransfer your application to the Black-Berry. A few seconds later, the USBdemo application resides on the phone.
The host PC’s C++ demo code invokes an MS-DOS session that immediately sends a message to the BlackBerry and closes when the application replies. This routine checks that communications are running correctly. However, the C++ project depends on compiled code from RIM as an “external dependency”. To successfully port the PC code to a microcontroller requires replicating this code’s functionality on the embedded system. One way of minimising the development implications takes advantage of the BlackBerry’s Bluetooth connection that behaves similarly to an RS-232 port (see sidebar“Bluetooth module slashes code development”).
There are two approaches for receiving and interpreting instructions: polling an Internet site or waiting for command messages. When you use the BlackBerry Enterprise Server application as a gateway to the Internet, the server’s software automatically encrypts all traffic between your application and the server using AES (advanced encryption standard) or triple-DES (data encryption standard) algorithms. If you choose to send command information autonomously, BlackBerry’s Java applications can use the standard HTTP, HTTPS, and TCP socket protocols to establish connections over the wireless network. The JDE includes a sample program to retrieve a file and display its contents. For the purposes of Robinson’s evaluation, this test is sufficient—by modifying the contents of the sample.txt file, it’s possible to change the behaviour of his target system. The code for sending messages does nothing more than invoke the BlackBerry’s Messages application, select the message type—text or e-mail—and construct the message’scontent.
CONTACT DETAILS
You can reach Contributing Technical EditorDavid Marsh at forncett@btinternet.com.
| REFERENCES |
|