AN2700 Freescale Semiconductor / Motorola, AN2700 Datasheet

no-image

AN2700

Manufacturer Part Number
AN2700
Description
Basic Web Server Development with MC9S12NE64 and CMX-MicroNet TCP/IP Stack
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Freescale Semiconductor
Application Note
Basic Web Server Development with
MC9S12NE64 and CMX-MicroNet
TCP/IP Stack
By: Steven Torres
Introduction
Ethernet connectivity of embedded devices is a growing trend in industrial and consumer applications.
Ethernet is a medium of choice because of its competitive performance, relatively low price of
implementation, established infrastructure, and inter-operability. Ethernet is also easy to use, widely
available, and scalable. Ethernet is described by IEEE Standard 802.3
With Ethernet and TCP/IP data transmission, embedded devices can be connected to the Internet, which
allows access to the embedded device from across the world.
an embedded device that is connected to a remote host via the Internet.
embedded device and remote host can operate on different networks, but the connection between the
devices is transparent.
This product incorporates SuperFlash technology licensed from SST.
© Freescale Semiconductor, Inc., 2004. All rights reserved.
8/16 Bit System Engineering
Austin, Texas
MOTOR
EMBEDDED DEVICE
CONTROL
Figure 1. Embedded Device on Internet
BOARD
INTERNET
Figure 1
shows a simplified illustration of
.
Figure 1
REMOTE HOST
shows that the
Rev. 0.3, 9/2004
AN2700

Related parts for AN2700

AN2700 Summary of contents

Page 1

... EMBEDDED DEVICE MOTOR This product incorporates SuperFlash technology licensed from SST. © Freescale Semiconductor, Inc., 2004. All rights reserved. CONTROL INTERNET BOARD Figure 1. Embedded Device on Internet Rev. 0.3, 9/2004 ™ . Figure 1 shows a simplified illustration of Figure 1 shows that the REMOTE HOST AN2700 ...

Page 2

Introduction Acronym/ Description Term ARP Address resolution protocol AN Auto-negotiate BIOS Basic input/output system BOOTP Bootstrap protocol DHCP Dynamic host configuration protocol DNS Domain name server FTP File transfer protocol HTML Hyper text mark-up language HTTP Hyper text transfer protocol ...

Page 3

Scope of This Application Note This application note details the creation of a basic web server for an embedded device. The application note is a follow-up to AN2624/D: Basic Web Server Development with the CMX-MicroNet TCP/IP Stack . CMX-MicroNet development ...

Page 4

Scope of This Application Note Connectivity Example Applications Connectivity systems that use the TCP/IP stack model (see TCP/IP Stack Model Refresher ), such as the example in Figure 1, can be implemented for a wide range of applications, including: • ...

Page 5

MC9S12NE64 MCU with Integrated Ethernet Controller This section introduces the MC9S12NE64 MCU and provides a brief overview of the MC9S12NE64 Ethernet controller. MC9S12NE64 The MC9S12NE64 is a 16-bit MCU based on Freescale Semiconductor’s HCS12 CPU platform. It includes 8K of ...

Page 6

Axiom Ethernet Development Board for the MC9S12NE64, EVB9S12NE64 HCS12 CPU WITH DEBUG MODULE 2 X SCI SPI IIC V REG 3 2.5 V CONVERTER 18 KEY WAKEUP IRQ PORTS EPHY EMAC Figure 4. Block Diagram of the MC9S12NE64 ...

Page 7

See the Axiom Manufacturing website, http://www.axman.com, for more information. Because the MC9S12NE64 connects directly to an Ethernet connector and high-speed LAN magnetic isolation module, the MC9S12NE64 is a true single-chip Ethernet system solution. Figure 5. EVB9S12NE64 Evaluation Board from Axiom ...

Page 8

Axiom Ethernet Development Board for the MC9S12NE64, EVB9S12NE64 Figure 6. EVB9S12NE64 Top Layer and Silkscreen EVB9S12NE64 OSC_SEL, select Y1 crystal oscillator circuit CONFIG switch 1–4 CONFIG switch 5 CONFIG switch 6 COMM_SW 1–8 PWR_SW USER_EN switch, RVI_EN MODA, MODB, MOBC, ...

Page 9

... CMX-MicroNet TCP/IP stack API CMX Introduction CMX-MicroNet is a TCP/IP stack implementation that is tailored for 8-bit and 16-bit embedded processors. Other CMX features include: • Compatible with CodeWarrior tools • Works with MCUs with low RAM/ROM resources • Written entirely in standard C code • ...

Page 10

CMX Stack Overview Freescale Semiconductor Low-Level Ethernet Drivers Powering the CMX-MicroNet TCP/IP stack is a low-level Ethernet driver for the MC9S12NE64 integrated Ethernet controller. This driver is integrated within the CMX-MicroNet TCP/IP stack source code. However, a Freescale Semiconductor stand-alone ...

Page 11

Table 3. CMX-MicroNet Project Sub-Directory Descriptions Sub-Directory {Project Directory}\NE64_MICRONET\Manual {Project Directory}\NE64_MICRONET\netlib {Project Directory}\NE64_MICRONET\Util {Project Directory}\NE64_MICRONET\Webpage {Project Directory}\NE64_MICRONET\Mw_hc12 More information on examplee_ne64.mcp and netlibe_ne64.mcp and their individual files is provided in the following sections. Figure 8 development environment). Basic Web Server ...

Page 12

CMX Stack Overview Figure 8. CodeWarrior IDE with CMX-MicroNet Projects Open CMX-MicroNet CodeWarrior Projects The netlibe_ne64.mcp project creates a library (object) file of the CMX-MicroNet API, and the examplee_ne64.mcp project contains the specific user application. This section covers these projects ...

Page 13

Examplee Project (examplee_ne64.mcp) — Contains the source code of the specific user application. The source code in this project includes main() for the TCP/IP stack solution. • example.c — Contains the user application including main(). callback.c — Among other things, ...

Page 14

CMX Stack Overview Table 4. Selected CMX-MicroNet API Functions Function mn_init() mn_ether_init() ne64_init() mn_vf_set_entry(arguments) mn_pf_set_entry(arguments) mn_gf_set_entry(arguments) mn_http_find_value(arguments) mn_http_set_file(arguments) mn_http_set_message(arguments) mn_ustoa(arguments) mn_server() Basic Web Server with MC9S12NE64 and CMX-MicroNet TCP/IP Stack, Rev. 0.3 14 Description Generally sets up the CMX-MicroNet TCP/IP ...

Page 15

... Configuring TCP/IP protocol in Microsoft Windows operating system Development Environment and Tools The CMX-MicroNet TCP/IP stack software can be modified and compiled with the CodeWarrior environment. Below are specific details about the development environment and tools required to develop the web server described in this application note. • ...

Page 16

Preparing for CMX-MicroNet TCP/IP Stack Development PC Figure 9. Connecting the Evaluation Board This development setup should be used until the CMX-MicroNet application is completed. This provides an easier interface for debugging the application than connecting directly ...

Page 17

When setting up IP addresses preferable to configure or use the development target and development host manually with non-routable IP addresses (i.e., 10.x.x.x, 90.0.0.x, 172.16.x.x through 172.32.x.x, or 192.168.x.x). IP address settings for this demo: • All devices ...

Page 18

Preparing for CMX-MicroNet TCP/IP Stack Development The network settings window shows all devices that can be used to form network connections. shows two network devices defined for the PC. Network devices can also include modems. The network settings window also ...

Page 19

Debugging Networks Issues Issues with network connectivity are typically due to an error in the network setup and configuration of either the network or the remote devices. Three main network connectivity issues and their possible solutions are described in this ...

Page 20

... This issue may require assistance from a system administrator to resolve. Network Protocol Analyzer Tools A network protocol analyzer is a powerful and useful tool for network debugging. The network protocol analyzer enables more visibility of packet traffic on the network connection. A network protocol analyzer is used to monitor the connectivity of the Internet or a local area network (LAN) ...

Page 21

Overview of a Web Server Developed Using CMX-MicroNet TCP/IP Stack This section provides an overview of a web server developed with CMX-MicroNet software. This simple web server was developed for distribution with the EVB9S12NE64 as an S-record file. the web ...

Page 22

Overview of a Web Server Developed Using CMX-MicroNet TCP/IP Stack When these web components are completed and tested, the next step is to convert them to the equivalent CMX-MicroNet C files using CMX’s html2C utility. Web Server index.htm HTML Source ...

Page 23

In main() , the MC9S12NE64 MCU and its integrated Ethernet controller are configured and enabled. main() also initializes the CMX-MicroNet TCP/IP stack then waits and serves a web page on request. Note ...

Page 24

Overview of a Web Server Developed Using CMX-MicroNet TCP/IP Stack mn_vf_set_entry((byte *)"JavaCl.class", JAVACL_SIZE, javacl_class,VF_PTYPE_STATIC); mn_vf_set_entry((byte *)"AnalogCl.class", ANALOGCL_SIZE, analogcl_class,VF_PTYPE_STATIC); /* add post functions to be used with forms */ mn_pf_set_entry((byte *)"set_demo_var", set_demo_var_func); /* add any get functions (server-side-includes) here */ mn_gf_set_entry((byte ...

Page 25

An excerpt of the source code for callback.c is provided. This section of callback.c is important because it includes the MAC hardware and IP address settings. This file must be configured correctly. Review Configuring the MAC Hardware and IP ...

Page 26

Overview of a Web Server Developed Using CMX-MicroNet TCP/IP Stack If ARP is used the array below is used as a temporary holder for the destination hardware address. It does not have to be changed. If ARP is not being ...

Page 27

SMTP FTP APPLICATION TCP TRANSPORT ARP NETWORK TCP/UDP/IP NETWORK INTERFACE Figure 14. Popular Network Protocols and Their Dependence Excerpt from mnconfig.h /********************************************************* Copyright (c) CMX Systems, Inc. 2004. All rights reserved *********************************************************/ #ifndef MNCONFIG_H_INC #define MNCONFIG_H_INC 1 /* Protocols */ ...

Page 28

Overview of a Web Server Developed Using CMX-MicroNet TCP/IP Stack #define TIME_TO_LIVE 64 #define TCP_WINDOW 512 #define TCP_RESEND_TICKS 600 #define TCP_RESEND_TRYS 12 #define PING_GLEANING 0 #define PING_BUFF_SIZE 32 #define ALLOW_BROADCAST 0 #define ALLOW_MULTICAST 0 #define MULTICAST_TTL 1 #define IGMP_LIST_SIZE 4 ...

Page 29

FTP */ #define FTP 0 #define FTP_SERVER 1 #define FTP_MAX_PARAM 24 #define FTP_BUFFER_LEN 512 #define FTP_USER_LEN 10 #define FTP_PASSWORD_LEN 10 #define FTP_NUM_USERS 1 #define NEED_MEM_POOL 0 #define MEM_POOL_SIZE 4096 /* TFTP */ #define TFTP 0 #define TFTP_RESEND_TRYS 3 #define ...

Page 30

Overview of a Web Server Developed Using CMX-MicroNet TCP/IP Stack Excerpt from Ether_Init.h: /* LINK SPEED/DUPLEX CONTROL */ /* ===================== */ /* Configure for manual or auto_neg configuration */ #define AUTO_NEG 1 #if AUTO_NEG /* what I advertise */ #define ...

Page 31

An excerpt of the source code for emac_fifo_cfg.h is provided. The code shows configurations for the EMAC Ethernet buffer allocation. For the MC9S12NE64 RAM is available and shared between user RAM and the EMAC Ethernet buffer space. ...

Page 32

Overview of a Web Server Developed Using CMX-MicroNet TCP/IP Stack Excerpt from emac_fifo_cfg.h: /****************************************************************************** * * Freescale Semiconductor, Inc. 2003 All rights reserved * ******************************************************************************* * * $File Name : emac_fifo_cfg.h$ * Description : definition of EMAC Ethernet buffer allocation ...

Page 33

An excerpt of the source code for _MC9S12NE64_BANKED.prm is provided. The code shows configurations for the EMAC Ethernet buffer allocation. The RAM segments definition should match the corresponding configurations of BUFMAP in emac_fifo_cfg.h . Excerpt from _ MC9S12NE64_BANKED.prm: SEGMENTS ...

Page 34

CMX-MicroNet Project Configuration to Optimize the Stack Solution Figure 15 illustrates a simplified or partial TCP/IP stack implementation. This stack uses only the UDP protocol and the user applications. Figure 15. Partial Stack TCP/IP Stack Implementation The major disadvantage of ...

Page 35

... Although specific methods and tools are used to develop and debug this demo, Freescale Semiconductor does not recommend or endorse any particular methodology, tool, or vendor. These methods and tools are provided only to describe the generic principles and features that may be required for development of a networked device ...

Page 36

... Learn More: For more information about Freescale Semiconductor products, please visit http://www.freescale.com AN2700 Rev. 0.3, 9/2004 Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document ...

Related keywords