MiniCom (OP6800)
User's Manual
PREV NEXT INDEX



5. Using the TCP/IP Features

Chapter 5 discusses using the TCP/IP features on the OP6800 boards. The TCP/IP feature is not available on OP6810 versions.

5.1 TCP/IP Connections

Before proceeding you will need to have the following items.

The Ethernet cables and Ethernet hub are available from Z-World in a TCP/IP tool kit. More information is available at www.zworld.com.

1. Connect the AC adapter and the programming cable as shown in Chapter 2, "Getting Started."

2. Ethernet Connections


Figure 18. Ethernet Connections

3. Apply Power

Plug in the AC adapter. The OP6800 is now ready to be used.

NOTE A hardware RESET is accomplished by unplugging the AC adapter, then plugging it back in, or by momentarily grounding the board reset input at pin 9 on screw terminal header J2.

The green LNK light on the OP6800 Rabbitcore module is on when the OP6800 is properly connected either to an Ethernet hub or to an active Ethernet card. The orange ACT light flashes each time a packet is received.

5.2 TCP/IP Sample Programs

We have provided a number of sample programs demonstrating various uses of TCP/IP for networking embedded systems. These programs require that you connect your PC and the OP6800 together on the same network. This network can be a local private network (preferred for initial experimentation and debugging), or a connection via the Internet.

5.2.1 How to Set IP Addresses in the Sample Programs

Most of the sample programs use macros to define the IP address assigned to the board and the IP address of the gateway, if there is a gateway.


#define MY_IP_ADDRESS "216.112.116.155"

#define MY_NETMASK "255.255.255.248"

#define MY_GATEWAY "216.112.116.153"

In order to do a direct connection, the following IP addresses can be used for the OP6800:


#define MY_IP_ADDRESS "10.1.1.2"

#define MY_NETMASK "255.255.255.248"

// #define MY_GATEWAY "216.112.116.153"

In this case, the gateway is not used and is commented out. The IP address of the board is defined to be 10.1.1.2. The IP address of your PC can be defined as 10.1.1.1.

5.2.2 How to Set Up your Computer's IP Address for a Direct Connection

When your computer is connected directly to the OP6800 via an Ethernet connection, you need to assign an IP address to your computer. To assign the PC the address 10.1.1.1 with the subnetmask 255.255.255.248 under Windows 98, do the following.


Click on Start > Settings > Control Panel to bring up the Control Panel, and then double-click the Network icon. In the window find the line of the form TCP/IP > Ethernet adapter name. Double-click on this line to bring up the TCP/IP properties dialog box. You can edit the IP address directly and the subnet mask. (Disable "obtain an IP address automatically.") You may want to write down the existing values in case you have to restore them later. It is not necessary to edit the gateway address since the gateway is not used with direct connect.

The method of setting the IP address may differ for different versions of Windows, such as 95, NT or 2000.

5.2.3 Run the PINGME.C Demo

In order to run this program, edit the IP address and netmask in the PINGME.C program (SAMPLES\TCPIP\ICMP) to the values given above (10.1.1.2 and 255.255.255.248). Compile the program and start it running under Dynamic C. The crossover cable is connected from your computer's Ethernet adapter to the OP6800's RJ-45 Ethernet connector. When the program starts running, the green LNK light on the OP6800 should be on to indicate an Ethernet connection is made. (Note: If the LNK light does not light, you may not have a crossover cable, or if you are using a hub perhaps the power is off on the hub.)

The next step is to ping the board from your PC. This can be done by bringing up the MS-DOS window and running the ping program:


ping 10.1.1.2

or by Start > Run

and typing the command


ping 10.1.1.2

Notice that the orange ACT light flashes on the OP6800 while the ping is taking place, and indicates the transfer of data. The ping routine will ping the board four times and write a summary message on the screen describing the operation.

5.2.4 Running More Demo Programs With a Direct Connection

The program SSI.C (SAMPLES\OP6800\TCPIP\) demonstrates how to make the OP6800 a Web server. This program allows you to turn the LEDs on an attached Demonstration Board from the Tool Kit on and off from a remote Web browser. In order to run these sample programs, edit the IP address as for the pingme program, compile the program and start it executing. Then bring up your Web browser and enter the following server address: http://10.1.1.2.

This should bring up the Web page served by the sample program.

The sample program TELNET.C (SAMPLES\OP6800\TCPIP\) allows you to communicate with the OP6800 using the Telnet protocol. To run this program, edit the IP address, compile the program, and start it running. Run the Telnet program on your PC (Start > Run telnet 10.1.1.2). Each character you type will be printed in Dynamic C's STDIO window, indicating that the board is receiving the characters typed via TCP/IP.

5.2.5 LCD/Keypad Sample Programs Showing TCP/IP Features

The following sample programs, found in the TCPIP subdirectory in SAMPLES/LCD_Keypad/122x32_1x7, are targeted at the Ethernet-enabled versions of the OP6800. Remember to configure the IP address, netmask, and gateway as indicated in the sample programs.

When using TCPSEND.C and TCP_RESPOND.C, connect the OP6800 and the other single-board computer to an Ethernet. If you connect the them directly, be sure to use a crossover Ethernet cable; straight-through Ethernet cables and a hub may be used instead.

5.3 Where Do I Go From Here?

NOTE If you purchased your OP6800 through a distributor or Z-World partner, contact the distributor or Z-World partner first for technical support.

If there are any problems at this point:

If the sample programs ran fine, you are now ready to go on.

Additional sample programs are described in the Dynamic C TCP/IP User's Manual.

Refer to the Dynamic C TCP/IP User's Manual to develop your own applications. An Introduction to TCP/IP provides background information on TCP/IP, and is available on Z-World's Web site.


Z-World
http://www.zworld.com
Voice: (530) 757-3737
FAX: (530) 757-3792
sales@zworld.com
PREV NEXT INDEX