RabbitCore RCM2100 C-Programmable Module with Ethernet Getting Started Manual 019–0093 • 030731–D
RabbitCore RCM2100 Getting Started Manual Part Number 019-0093 • 030731–D • Printed in U.S.A. ©2001–2003 Z-World Inc. • All rights reserved. Z-World reserves the right to make changes and improvements to its products without providing notice. Trademarks Rabbit and Rabbit 2000 are registered trademarks of Rabbit Semiconductor. RabbitCore is a trademark of Rabbit Semiconductor. Dynamic C is a registered trademark of Z-World Inc. Z-World, Inc.
TABLE OF CONTENTS Chapter 1: Introduction & Overview 1 RCM2100 Series Description .................................................................................................................... 1 Standard Ethernet Versions ................................................................................................................... 2 Standard Non-Ethernet Versions ...........................................................................................................
Chapter 3: Software Installation & Overview 17 An Overview of Dynamic C..................................................................................................................... 17 System Requirements............................................................................................................................... 18 Hardware Requirements ...................................................................................................................... 18 Installing Dynamic C ...
1. INTRODUCTION & OVERVIEW The RCM2100 series is an advanced line of modules that incorporates the powerful Rabbit 2000 microprocessor, flash memory, static RAM and an RJ-45 Ethernet port, all on a PCB the size of a business card. The RCM2100 series modules are designed for use on a motherboard that supplies power and interface to real-world I/O devices. Up to 40 pins of I/O and four serial ports are available for system interfacing.
1.1.1 Standard Ethernet Versions There are two RCM2100 series modules that incorporate an Ethernet port: RCM2100. The RCM2100 is the most fully-equipped module in the family, with the Ethernet port, 512k flash memory and 512k static RAM. The Ethernet port uses portions of two of the Rabbit 2000 microprocessor’s parallel ports, reducing the available number of I/O pins to 34. This is the version included in the Development Kit. RCM2110.
The RCM2100 modules have two 40-pin headers to which cables can be connected, or which can be plugged into matching sockets on a production device. The pinouts for these connectors are shown in Figure 1 below.
1.2 Development Software The RCM2100 series of modules uses the Dynamic C development environment for rapid creation and debugging of runtime applications. Dynamic C provides a complete development environment with integrated editor, compiler and source-level debugger. It interfaces directly with the target system, eliminating the need for complex and unreliable in-circuit emulators.
1.3 How to Use This Manual This Getting Started manual is intended to give users a quick but solid start with the RCM2100 series modules. It does not contain detailed information on the module hardware capabilities, the Dynamic C development environment, or the TCP/IP software support for the integrated Ethernet port. Most users will want more detailed information on some or all of these topics in order to put the RCM2100 module to effective use. 1.3.
Providing this documentation in electronic form saves an enormous amount of paper by not printing copies of manuals that users don’t need. It reduces the number of outdated manuals we have to discard from stock as well, and it makes providing a complete library of manuals an almost cost-free option.
2. HARDWARE SETUP This chapter describes the RCM2100 series hardware in more detail, and explains how to set up and use the accompanying prototyping and development board. NOTE: This chapter (and this manual) assume that you have the RabbitCore RCM2100 Development Kit. If you purchased an RCM2100 series module by itself, you will have to adapt the information in this chapter and elsewhere to your test and development setup. 2.
2.2 Overview of the Prototyping Board The Prototyping Board included in the Development Kit makes it easy to connect an RCM2100 module to a power supply and a PC workstation for development. It also provides an array of basic I/O peripherals (switches and LEDs), as well as a prototyping area for more advanced hardware development. For the most basic level of evaluation and development, the Prototyping Board can be used without modification.
2.2.1 Prototyping Board Features Power Connection. A 3-pin header is provided for connection of a power supply. Note that it is symmetrical, with both outer pins connected to ground and the center pin connected to the raw V+ input. The cable of the wall transformer provided with the North American version of the Development Kit ends in a connector that is correctly connected in either orientation. Users providing their own power supply should ensure that it delivers 9–24 V DC at not less than 500 mA.
2.2.2 Prototyping Board Expansion The Prototyping Board comes with several unpopulated areas, which may be filled with components to suit the user’s development needs. After you have experimented with the sample programs in Chapter 4, you may wish to expand the board’s capabilities for further experimentation and development. Refer to the Prototyping Board schematic (090–0116) for details as necessary. Module Extension Headers The complete pin set of the RCM2100 module is duplicated at these two headers.
2.3 Development Hardware Connections There are four steps to connecting the prototyping board for use with Dynamic C and the sample programs: 1. Attach the RCM2100 module to the Prototyping Board. 2. Connect the programming cable between the RCM2100 module and the workstation PC. 3. Connect the module’s Ethernet port to a PC’s Ethernet port, or to an Ethernet network. 4. Connect the power supply to the Prototyping Board.
2.3.1 Attach Module to Prototyping Board Turn the RCM2100 module so that the Ethernet connector is on the left, as shown in Figure 4 below. Align the module headers J1 and J2 into sockets J1 and J3 on the Prototyping Board. Figure 4. Installing the RCM2100 Module on the Prototyping Board. Note the orientation of the module. NOTE: It is important that you line up the RCM2100 pins on headers J1 and J2 exactly with the corresponding pins of headers J1 and J3 on the Prototyping Board.
2.3.2 Connect Programming Cable The programming cable connects the RCM2100 module to the PC running Dynamic C, to download programs and to monitor the RCM2100 for debugging. Connect the 10-pin connector of the programming cable labeled PROG to header J3 on the RCM2100 module as shown in Figure 6 below. Be sure to orient the red edge of the cable towards pin 1 of the connector. (Do not use the DIAG connector, which is used for a normal serial connection.) Note Pin 1 Indicator Figure 6.
2.3.3 Connect Ethernet Network Cable Programming and development can be done with the RCM2100 without connecting the Ethernet port to a network. However, if you will be running the sample programs that use the Ethernet capability or will be doing Ethernet-enabled development, you should connect the RCM2100’s Ethernet port at this time. There are four options for connecting the RCM2100 module to a network for development and runtime purposes.
2.3.4 Connect Power When all other connections have been made, you can connect power to the RCM2100 Prototyping Board. Hook the connector from the wall transformer to header J5 on the Prototyping Board as shown in Figure 7 below. The connector may be attached either way as long as it is not offset to one side. Figure 7. Power Supply Connections to Prototyping Board Plug in the wall transformer. The power LED on the Prototyping Board should light up.
2.4 Where Do I Go From Here? We recommend that you proceed to the next chapter and install Dynamic C (if you do not already have it installed), then run the first sample program to verify that the RabbitCore module and prototyping board are set up and functioning correctly. If everything appears to be working, we recommend the following sequence of action: 1. Run all of the sample programs described in Chapter 4 to get a basic familiarity with Dynamic C and the RabbitCore module’s capabilities. 2.
3. SOFTWARE INSTALLATION & OVERVIEW To develop and debug programs for the RCM2100 series (and for all other Z-World and Rabbit Semiconductor hardware), you must install and use Dynamic C. This chapter takes you through the installation of Dynamic C, and then provides a tour of its major features with respect to the RCM2100 series. 3.
• Dynamic C provides extensions to the C language (such as shared and protected variables, costatements and cofunctions) that support real-world embedded system development. Interrupt service routines may be written in C. Dynamic C supports cooperative and preemptive multi-tasking. • Dynamic C comes with many function libraries, all in source code. These libraries support real-time programming, machine level I/O, and provide standard string and math functions. • Dynamic C compiles directly to memory.
3.3 Installing Dynamic C Insert the Dynamic C CD-ROM in the drive on your PC. If autorun is enabled, the CD installation will begin automatically. If autorun is disabled or the installation otherwise does not start, use the Windows Start | Run menu or Windows Disk Explorer to launch SETUP.EXE from the root folder of the CD-ROM. The installation program will guide you through the installation process. Most steps of the process are self-explanatory and not covered in this section.
3.3.2 Installation Type Dynamic C has two components that can be installed together or separately. One component is Dynamic C itself, with the development environment, support files and libraries. The other component is the documentation library in HTML and PDF formats, which may be left uninstalled to save hard drive space or installed elsewhere (on a separate or network drive, for example). The installation type is selected in the installation menu shown above.
3.3.3 Select COM Port Dynamic C uses a COM (serial) port to communicate with the target development system. The installation allows you to choose the COM port that will be used. The default selection, as shown in the example above, is COM1. You may select any available port for Dynamic C’s use. If you are not certain which port is available, select COM1. This selection can be changed later within Dynamic C. NOTE: The installation utility does not check the selected COM port in any way.
3.4 Starting Dynamic C Once the RabbitCore module is set up and connected as described in Chapter 2 and Dynamic C has been installed, start Dynamic C by double-clicking on the Dynamic C icon. Dynamic C should start, then look for the target system on the COM port you specified during installation (by default, COM1). Once detected, Dynamic C should go through a sequence of steps to cold-boot the module and compile the BIOS.
If you are using Dynamic C version 7.04 or earlier, modify the BIOS source code as follows. Skip these three steps if your version of Dynamic C is 7.05 or later. 1. Open the BIOS source code file named RABBITBIOS.C, which can be found in the BIOS directory. 2. Change the line #define USE115KBAUD 1 // set to 0 to use 57600 baud to read as follows. #define USE115KBAUD 0 // set to 0 to use 57600 baud 3. Save the changes using File > Save. Now press .
24 RabbitCore RCM2100
4. SAMPLE PROGRAMS To help familiarize you with the RabbitCore RCM2100 modules, several sample Dynamic C programs have been included. Loading, executing and studying these programs will give you a solid hands-on overview of the RabbitCore’s capabilities, as well as a quick start with Dynamic C as an application development tool. 4.1 Sample Program Overview Dynamic C comes with a large number of sample programs that illustrate many of its features.
4.2 Loading and Compiling Programs in Dynamic C This section gives you a short summary of how to connect the target system, start Dynamic C, and load a sample program. For more details on these topics, refer to Sections 2 and 3 of this manual, and the Dynamic C User’s Manual. 4.2.1 Connect Prototyping Board Section 2.3 provides detailed instructions for setting up the RCM2100 Prototyping Board and making its hardware connections.
4.3 Sample Program: FlashLED.c If you did not load and compile FlashLED.c in the prior section, refer to Sections 4.2.3 and 4.2.4. Program Description This program is about as simple as a Dynamic C application can get—the equivalent of the traditional “Hello, world!” program found in most basic programming tutorials. If you are familiar with ANSI C, you should have no trouble reading through the source code and understanding it.
4.4 Sample Program: ToggleLED.c One of Dynamic C’s unique and powerful aspects is its ability to efficiently multitask using cofunctions and costatements. This simple application demonstrates how these program elements work. Compile & Run Program Open the source file ToggleLED.c, located in the Samples\RCM2100 folder. Press F9 to compile and run the program. The LED DS3 on the Prototyping Board will begin blinking. Press switch S2 to toggle LED DS2 on and off.
More Information See the entries for the DelayMs() function, as well as Section 5, “Multitasking with Dynamic C,” in the Dynamic C User’s Manual.
4.5 Sample Program: FlashLEDs.c In addition to Dynamic C’s implementation of C-language programming for embedded systems, it supports assembly-language programming for very efficient processor-level control of the module hardware and program flow. This application is similar to FlashLED.c and ToggleLEDs.c, but uses assembly language for the low-level port control within cofunctions, another powerful multitasking tool. Compile & Run Program Open the source file FlashLEDs.
2. Sets up a costatement which calls two instances of the flashled() function, one for each LED. Note that one LED is flashed one second on, one-half second (500 ms) off, while the other is flashed in the reverse pattern. Note also the wfd keyword in the costatement. This keyword (an abbreviation for waitfordone, which can also be used) must be used when calling cofunctions. For a complete explanation, see Section 5 and 6 in the Dynamic C User’s Manual.
4.6 Sample Program: PingLED.c One of the RCM2100 series’s most important features is the availability of the built-in Ethernet port. This program makes the simplest possible use of the network port by “pinging” a remote system and using LEDs to report the status of the ping attempt and its return. Compile & Run Program Open the source file PingLED.c, located in the Samples\RCM2100 folder. Edit the six #define values near the beginning of the file to represent valid network addresses for your setup.
The program then resolves the address to be pinged into a numeric value. using the library function resolve(). If the defined address is numeric, it converts the define string into truly numeric form. If the address is a domain name, the function queries the indicated DNS server to obtain the numeric address.
4.7 Sample Program: EthCore1.c The RCM2100 modules with Ethernet ports can act as micro Web page servers, with dynamic interaction between the controller and the web pages. This sample program demonstrates how a web page can be used to both monitor and control an RCM2100 module. Compile & Run Program Open the source file EthCore1.c, located in the Samples\RCM2100 folder. Edit the three #define values near the beginning of the file to represent valid network addresses for your setup.
Program Description This program begins to show the range of applications for an Ethernet-enabled embedded system controller, so let’s look closely at its operation. As with PingLED.c, several network addresses must be defined before this application can work. The most important is again MY_IP_ADDRESS, which defines the RCM2100 system’s IP address. The netmask value should be set if the default of 255.255.255.0 is not correct.
4.8 Where Do I Go From Here? The Dynamic C Samples folders contain dozens of sample programs. Some of them are intended for other hardware with somewhat different characteristics, but most can be run on the RabbitCore RCM2100 series modules, either as-is or with some modification. (All programs in the Samples\RCM2100 folder will run without changes on the RCM2100 series.
NOTICE TO USERS Z-WORLD PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFESUPPORT DEVICES OR SYSTEMS UNLESS A SPECIFIC WRITTEN AGREEMENT REGARDING SUCH INTENDED USE IS ENTERED INTO BETWEEN THE CUSTOMER AND Z-WORLD PRIOR TO USE.
38 RabbitCore RCM2100
INDEX A I additional information online documentation .......... 5 references ............................ 5 interrupt service routines ...... 18 C models factory versions ............... 1, 2 C language ............................ 18 D description ............................... 1 Development Kit ..................... 7 Dynamic C .................. 4, 17, 18 assembly language ............ 17 debugger ............................ 17 debugging .......................... 17 editor ....................
User’s Manual 40
SCHEMATICS 090-0114 RCM2100 Schematic www.rabbitsemiconductor.com/documentation/schemat/090-0114.pdf 090-0116 RCM2100 Prototyping Board Schematic www.rabbitsemiconductor.com/documentation/schemat/090-0116.pdf 090-0128 Programming Cable Schematic www.rabbitsemiconductor.com/documentation/schemat/090-0128.pdf The schematics included with the printed manual were the latest revisions available at the time the manual was last revised.