The Web browser has had a profound positive effect at raising consumer expectations in terms of how quickly and easily information can be made available from virtually anywhere in the world. While Web browser technology and usage models have literally saturated the consumer market segments, the fundamental values of what caused worldwide adoption of Web browsers, such as simple user interface, accessibility to remote content, and speed, are actively advancing applications far from consumer segments, such as factory automation, building control, data transaction and the medical field.
The idea of a Web browser to monitor and control embedded applications is not a new concept, but the high cost of overhauling a legacy system with capable technology has stunted embedded adoption. Fortunately, as Moore's Law yields yet again, lithography generation and transistor realty has finally reached a point where a given technology is affordable. Now, with a fundamental understanding of how a Web server is expected to perform in a given application, along with knowledge of integral hardware and software pieces required to complete a cost- and feature-effective Web server system, high-performance Web server capability is easily within reach for embedded designers.
Implementation
A Web server consists of three components: hardware, software and content. The hardware component of a Web server can be implemented with a solution as simple as an Ethernet-enabled microcontroller and an RJ45 connector with integrated magnetics. The microcontroller provides a glueless interface to the most popular implementation - twisted pair wiring. The processor integrated into the microcontroller provides the necessary processing performance to provide Web services while also processing the application and interfaced devices.
The necessary software to implement a Web server is available from many sources. Two popular solutions are the freely available open source lwIP and uIP TCP/IP stacks. Fitting into small memory footprints, these stacks enable network connectivity for the embedded world. Available embedded Web server applications sit on top of these stacks and are used to send and receive the appropriate data.
The simplest Web server stores the Web page content in local memory as static pages. In this case, any request from a client will always result in the client receiving the page as it is stored at the server. To make the Web server less static in terms of what the server provides the client, an enhancement called common gateway interface (CGI) is often used. CGI adds the capability of dynamic Web page content, which allows alteration of information provided by the Web server, inserting new timely information before being sent to the remote client. Dynamic Web page creation can be implemented by the addition of a function call to a compiled program or script running on the server. This called program or script generates an image of any current data and passes that information into the stream of HTML data to be assembled as a Web page by the client.
Design considerations for a hardwired network interface
In order to connect to the Internet, a Web server design requires four main pieces of hardware: the media access controller (MAC), the network physical interface device (PHY), isolating magnetics, and the physical jack that connects to the network system (RJ45) over copper or fibre media. A solution such as Luminary Micro's Stellaris microcontroller integrates both MAC and PHY as shown in Figure 1, which also displays the high-level hardware diagram of a hardwired Ethernet interface. The MAC layer provides transmit and receive processing for Ethernet frames. The MAC layer also provides the interface to the PHY module via an internal media independent interface (MII). The PHY is the interface to the network, including the ability to scramble/descramble incoming and outgoing Ethernet packets. For an effective Ethernet-connected embedded system, the PHY should ideally interface to Category-5 unshielded twisted pair (Cat-5 UTP) cabling for 100BASE-TX applications and Category-3 unshielded twisted pair (Cat-3 UTP) for 10BASE-T applications.
Consideration 1: Find a microcontroller that integrates both MAC and PHY on-chip
Although there are numerous microcontroller options that offer an on-chip Ethernet MAC, there are few that offer the combination of both MAC and PHY on a single device. However, the integration of both MAC and PHY works to the advantage of the embedded platform designer, since the on-chip combination has the potential to save significant BOM cost through consolidation of functionality and reduction in footprint, not to mention manufacturing savings in reduced stocking charges and reduced waste from multichip losses. In addition, microcontrollers that integrate both MAC and PHY ensure a reliable Ethernet system. For instance, designers may encounter difficulty with an implementation of a standalone PHY, where the lack of adequate design guidance by the supplier of the PHY can result in a non-functional or impaired design. Tested and qualified components that are known to interoperate with the PHY are critical. Therefore, using a microcontroller with integrated MAC and PHY already accounts for these concerns.
Consideration 2: Find a microcontroller with ample on-chip memory
There are many documented instances of Web server technology downsized for use on platforms with tiny memory complements. Single-chip microcontrollers typically provide only minimal non-volatile storage for use by communication programming. Designs using microcontrollers tend to implement serial interface memories, making available additional bulk memory needed for storage of the static data making up a Web page (HTML). Besides increasing system cost with the serial memory, the delays caused by serial transfer of data from the serial memory make delivery of any Web page lethargic. The overhead of serial memory transfers introduces processing delays into the platform's main application program, thus slowing overall system performance. Solutions using serial memories tend to be static Web page displays or pages that present extremely limited dynamic information. Therefore, a microcontroller should be identified that features enough fast on-chip Flash memory to store and serve the Web content.
Consideration 3: Find a microcontroller with sufficient performance
Many embedded Ethernet-enabled systems need to not only handle network communication, but also be able to run a complex primary application at the same time. The microcontroller needs to have the necessary overall performance to handle interleaving the network communication and application. Choosing a 32-bit microcontroller is critical to achieving the performance needed to handle these applications. Other performance considerations include fast memory and interrupt processing. On-chip single-cycle Flash and SRAM increase performance by minimising the processor overhead due to memory accesses. Microcontrollers with a low latency interrupt controller reduce the overhead incurred each time an interrupt is received, which is critical for a system that will be multitasking.
Consideration 4: Find a microcontroller vendor that offers a complete Web server solution
To quickly get a final product to market, embedded engineers need to work with a microcontroller vendor that offers a complete example Web server solution, including all the hardware and software necessary to begin development. A complete example Web server solution should include cost-effective hardware, a Web server demonstration that runs out-of-the-box, necessary software tools, documentation, a quickstart guide, a working driver library and example source code. In addition, the vendor should offer application notes and excellent applications support. This way, embedded engineers can begin designs with the confidence of knowing that they are starting from a robust Web server example.
A highly integrated Web server solution
Luminary Micro's Ethernet-enabled Stellaris microcontrollers integrate peripherals that are designed for meticulous motion control, meaning that a Stellaris microcontroller is concurrently capable of serving a Web browser while driving a mission-critical motor. To simplify Web server implementation on these microcontrollers, Luminary offers three versions of an Ethernet evaluation kit, each including complete Web server demonstrations using both the uIP and lwIP TCP/IP open source Ethernet protocol stacks, as well as all the hardware, software, peripheral drivers, development tools and documentation needed. Utilising the benefits of this evaluation kit and realising the unique advantages that Stellaris technology offers to a Web server application enables embedded designers to provide effective Web server products with fast time-to-market.
Tel: | +27 11 608 0144 |
Email: | [email protected] |
www: | www.nuvisionelec.com |
Articles: | More information and articles about NuVision Electronics |
© Technews Publishing (Pty) Ltd | All Rights Reserved