Coyote (BL2500)
User's Manual
PREV INDEX NEXT


5. Using the TCP/IP Features

Chapter 5 discusses using the TCP/IP features on the Coyote boards.

5.1 TCP/IP Connections

Before proceeding you will need to have the following items.

The Ethernet cables and Ethernet hub are available from Rabbit in a TCP/IP tool kit. More information is available at www.rabbit.com.

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

  2. Ethernet Connections

  3. If you do not have access to an Ethernet network, use a crossover Ethernet cable to connect the Coyote to a PC that at least has a 10Base-T Ethernet card.

  4. If you have an Ethernet connection, use a straight-through Ethernet cable to establish an Ethernet connection to the Coyote from an Ethernet hub. These connections are shown in Figure 20.



Figure 20. Ethernet Connections

  1. Apply Power

Plug in the AC adapter. The Coyote 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 reset pins on the back of the Coyote.

When the PROG connector of the programming cable connects the Coyote to your PC, and Dynamic C is running, a RESET occurs when you press <Ctrl-Y>.

The green LNK light on the Coyote's RabbitCore module is on when the Coyote 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 Coyote 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

With the introduction of Dynamic C 7.30 we have taken steps to make it easier to run many of our sample programs. You will see a TCPCONFIG macro. This macro tells Dynamic C to select your configuration from a list of default configurations. You will have three choices when you encounter a sample program with the TCPCONFIG macro.

  1. You can replace the TCPCONFIG macro with individual MY_IP_ADDRESS, MY_NETMASK, MY_GATEWAY, and MY_NAMESERVER macros in each program.

  2. You can leave TCPCONFIG at the usual default of 1, which will set the IP configurations to 10.10.6.100, the netmask to 255.255.255.0, and the nameserver and gateway to 10.10.6.1. If you would like to change the default values, for example, to use an IP address of 10.1.1.2 for the Coyote board, and 10.1.1.1 for your PC, you can edit the values in the section that directly follows the "General Configuration" comment in the TCP_CONFIG.LIB library. You will find this library in the LIB\TCPIP directory.

  3. You can create a CUSTOM_CONFIG.LIB library and use a TCPCONFIG value greater than 100. Instructions for doing this are at the beginning of the TCP_CONFIG.LIB library in the LIB\TCPIP directory.

There are some other "standard" configurations for TCPCONFIG that let you select different features such as DHCP. Their values are documented at the top of the TCP_CONFIG.LIB library in the LIB\TCPIP directory. More information is available in the Dynamic C TCP/IP User's Manual.

IP Addresses Before Dynamic C 7.30

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. Instead of the TCPCONFIG macro, you will see a MY_IP_ADDRESS macro and other macros.

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

In this case, the gateway and nameserver are not used, and are commented out. The IP address of the board is defined to be 10.1.1.2. The IP address of you 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 Coyote via an Ethernet connection, you need to assign an IP address to your computer. To assign the PC the address 10.10.6.101 with the netmask 255.255.255.0, do the following.

Click on Start > Settings > Control Panel to bring up the Control Panel, and then double-click the Network icon. Depending on which version of Windows you are using, look for the TCP/IP Protocol/Network > Dial-Up Connections/Network line or tab. Double-click on this line or select Properties or Local Area Connection > Properties to bring up the TCP/IP properties dialog box. You can edit the IP address and the subnet mask directly. (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.


5.2.3 Run the PINGME.C Demo

Connect the crossover cable from your computer's Ethernet port to the Coyote's RJ-45 Ethernet connector. Open this sample program from the SAMPLES\TCPIP\ICMP folder, compile the program, and start it running under Dynamic C. When the program starts running, the green LNK light on the Coyote 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:

or by Start > Run

and typing the command

Notice that the orange ACT light flashes on the Coyote 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 sample programs discussed in this section use the Demonstration Board from the BL2500/OEM2500 Development Kit to illustrate their operation. Appendix C, "Demonstration Board Connections," contains diagrams of typical connections between the Coyote and the Demonstration Board used to run these sample programs.

The program SMPTP.C (SAMPLES\BL2500\TCPIP\) uses the SMTP library to send an e-mail when a switch on the Demonstration Board is pressed.

The program BROWSELED.C (SAMPLES\BL2500\TCPIP\) demonstrates a basic controller running a Web page. Two "LEDs" are created on the Web page, and two buttons on the Demonstration Board then toggle them. Users can change the status of the lights from the Web browser. The LEDs on the Demonstration Board match the ones on the Web page. As long as you have not modified the TCPCONFIG 1 macro in the sample program, enter the following server address in your Web browser to bring up the Web page served by the sample program.

http://10.10.6.100

Otherwise use the TCP/IP settings you entered in the TCP_CONFIG.LIB library.

The program PINGLED.C (SAMPLES\BL2500\TCPIP\) demonstrates ICMP by pinging a remote host. It will flash LEDs DS1 and DS2 on the Demonstration Board when a ping is sent and received.

5.3 Where Do I Go From Here?

NOTE If you purchased your Coyote through a distributor or Rabbit partner, contact the distributor or 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.

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 the Web site.


Rabbit—A Digi International Brand
www.rabbit.com
PREV INDEX NEXT