RabbitCore RCM2100 C-Programmable Module with Ethernet Getting Started Manual 019–0093 • 050505–F
RabbitCore RCM2100 Getting Started Manual Part Number 019-0093 • 050505–F • Printed in U.S.A. ©2001–2005 Z-World Inc. • All rights reserved. Z-World reserves the right to make changes and improvements to its products without providing notice. Trademarks Rabbit is a registered trademark of Rabbit Semiconductor. Rabbit 2000 and RabbitCore are trademarks of Rabbit Semiconductor. Z-World is a registered trademark of Z-World Inc. Dynamic C is a registered trademark of Z-World Inc. Z-World, Inc.
TABLE OF CONTENTS Chapter 1. Introduction & Overview 1 1.1 RCM2100 Description .................................................................................................... 1 1.1.1 Standard Ethernet Versions ......................................................................................................... 2 1.1.2 Standard Non-Ethernet Versions ................................................................................................. 2 1.1.3 Physical & Electrical Specifications ......
Chapter 3. Software Installation & Overview 17 3.1 An Overview of Dynamic C ............................................................................................17 3.2 Installing Dynamic C .....................................................................................................19 3.2.1 Early Versions of Dynamic C .................................................................................................... 19 3.3 Sample Programs ....................................................
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. Throughout this manual, the term RCM2100 refers to the complete series of RCM2100 RabbitCore modules unless other production models are referred to specifically. The RCM2100 modules are designed for use on a motherboard that supplies power and interface to real-world I/O devices.
1.1.1 Standard Ethernet Versions There are two RCM2100 models that incorporate an RJ-45 Ethernet port: RCM2100. The RCM2100 is the most fully equipped module in the family, with an Ethernet port, 512K flash memory, and 512K static RAM. The Ethernet port uses some of the Rabbit 2000 microprocessor’s parallel ports, reducing the available number of I/O pins to 34. This is the model 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 modules use 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. Dynamic C must be installed on a Windows workstation with at least one free serial (COM) port for communication with the target system.
1.3 How to Use This Manual This Getting Started manual is intended to give users a quick but solid start with the RCM2100 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. GETTING STARTED This chapter describes the RCM2100 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 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 Connections There are three 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 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 on the bottom side of the RCM2100 into header sockets J1 and J3 on the Prototyping Board. Figure 4. Installing the RCM2100 Module on the Prototyping Board. Note the orientation of the module.
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 J5 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 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 Run a Sample Program If you already have Dynamic C installed, you are now ready to test your programming connections by running a sample program. If you are using a USB port to connect your computer to the RCM2100 module, choose Options > Project Options and select “Use USB to Serial Converter” under the Communications tab. Find the file PONG.C, which is in the Dynamic C SAMPLES folder.
2.5 Where Do I Go From Here? If everything appears to be working, we recommend the following sequence of action: 1. Run all of the sample programs described in Chapter 3 to get a basic familiarity with Dynamic C and the RabbitCore module’s capabilities. 2. For further development, refer to the RabbitCore RCM2100 User’s Manual for details of the module’s hardware and software components.
3. SOFTWARE INSTALLATION & OVERVIEW To develop and debug programs for the RCM2100 (and for all other Z-World and Rabbit Semiconductor hardware), you must install and use Dynamic C. Dynamic C is an integrated development system for writing embedded software. It runs on an IBM-compatible PC and is designed for use with Z-World single-board computers and other single-board computers based on the Rabbit microprocessor.
Dynamic C has a number of standard features. • Full-feature source and/or assembly-level debugger, no in-circuit emulator required. • Royalty-free TCP/IP stack with source code and most common protocols. • Hundreds of functions in source-code libraries and sample programs: X Exceptionally fast support for floating-point arithmetic and transcendental functions. X RS-232 and RS-485 serial communication. X Analog and digital I/O drivers. X I2C, SPI, GPS, file system. X LCD display and keypad drivers.
3.2 Installing Dynamic C Insert the Dynamic C CD from the Development Kit in your PC’s CD-ROM drive. If the installation does not auto-start, run the setup.exe program in the root directory of the Dynamic C CD. Install any Dynamic C modules after you install Dynamic C. 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.
3.3 Sample Programs To help familiarize you with the 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 RCM2100’s capabilities, as well as a quick start with Dynamic C as an application development tool. These programs are intended to serve as tutorials, but then can also be used as starting points or building blocks for your own applications.
3.3.1 Getting to Know the RCM2100 The following sample programs can be found in the SAMPLES\RCM2100 folder. • EXTSRAM.C—demonstrates the setup and simple addressing to an external SRAM. This program first maps the external SRAM to the I/O Bank 7 register with a maximum of 15 wait states, chip select strobe (PE7), and allows writes. The first 256 bytes of SRAM are cleared and read back. Values are then written to the same area and are read back.
• FLASHLEDS.C—demonstrates the use of coding with assembly instructions, cofunctions, and costatements to flash LEDs DS2 and DS3 on the Prototyping Board on and off. LEDs DS2 and DS3 are controlled by Parallel Port A bit 0 (PA0) and Parallel Port A bit 1 (PA1).Once you have compile this program and it is running, LEDs DS2 and DS3 will flash on/off at different rates. • FLASHLEDS2.C—demonstrates the use of cofunctions and costatements to flash LEDs DS2 and DS3 on the Prototyping Board on and off.
• LCD_DEMO.C—demonstrates a simple setup for an LCD that uses the HD44780 controller or an equivalent. Connect the LCD to the RCM2100 address and data lines on the Prototyping Board.
3.3.2 Serial Communication The following sample programs can be found in the SAMPLES\RCM2100 folder. Two sample programs, CORE_FLOWCONTROL.C and CORE_PARITY.C, are available to illustrate RS-232 communication. To run these sample programs, you will have to add an RS-232 transceiver such as the MAX232 at location U2 and four 100 nF capacitors at C3–C6 on the Prototyping Board. Also install the 2 × 5 IDC header included with the Prototyping Board accessory parts at J6 to interface the RS-232 signals.
Two sample programs, MASTER2.C and SLAVE2.C, are available to illustrate RS-485 master/slave communication. To run these sample programs, you will need a second Rabbit-based system with RS-485, and you will also have to add an RS-485 transceiver such as the SP483E and bias resistors to the Prototyping Board. PC0 PC1 PD0 47 kW Vcc 485+ Vcc bias 681 W RO termination 220 W /RE bias 681 W DI A RS-485 DE CHIP B 485 The diagram shows the connections.
3.3.4 Sample Program Descriptions 3.3.4.1 FLASHLED.C 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. The only new element in this sample application should be Dynamic C’s handling of the Rabbit microprocessor’s parallel ports. The program: 4.
3.3.4.2 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. Dynamic C permits the use of assembly language statements within C code.
tion of how Dynamic C handles multitasking with costatements and cofunctions, see Chapter 5, “Multitasking with Dynamic C,” and Chapter 6, “The Virtual Driver,” in the Dynamic C User’s Manual. 3.3.4.3 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. This sample program uses two costatements to set up and manage the two tasks.
3.4 Upgrading Dynamic C Dynamic C patches that focus on bug fixes are available from time to time. Check the Web sites • www.zworld.com/support/ or • www.rabbitsemiconductor.com/support/ for the latest patches, workarounds, and bug fixes. 3.4.1 Add-On Modules Dynamic C installations are designed for use with the board they are included with, and are included at no charge as part of our low-cost kits.
30 RabbitCore RCM2100
4. USING THE TCP/IP FEATURES 4.1 TCP/IP Connections Programming and development can be done with the RCM2100 RabbitCore modules 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 module’s Ethernet port at this time. Before proceeding you will need to have the following items.
The following options require more care in address selection and testing actions, as conflicts with other users, servers and systems can occur: • LAN — Connect the RCM2100’s Ethernet port to an existing LAN, preferably one to which the development PC is already connected. You will need to obtain IP addressing information from your network administrator.
4.2 TCP/IP Primer on IP Addresses Obtaining IP addresses to interact over an existing, operating, network can involve a number of complications, and must usually be done with cooperation from your ISP and/or network systems administrator. For this reason, it is suggested that the user begin instead by using a direct connection between a PC and the RCM2100 board using an Ethernet crossover cable or a simple arrangement with a hub.
Hub(s) Internet Adapter Ethernet Firewall Proxy Server Network of Workstations Ethernet Typical Corporate Network RCM2100 Board If your system administrator can give you an Ethernet cable along with its IP address, the netmask and the gateway address, then you may be able to run the sample programs without having to set up a direct connection between your computer and the RCM2100 board.
4.3 IP Addresses Explained IP (Internet Protocol) addresses are expressed as 4 decimal numbers separated by periods, for example: 216.103.126.155 10.1.1.6 Each decimal number must be between 0 and 255. The total IP address is a 32-bit number consisting of the 4 bytes expressed as shown above. A local network uses a group of adjacent IP addresses. There are always 2N IP addresses in a local network. The netmask (also called subnet mask) determines how many IP addresses belong to the local network.
4.4 How IP Addresses are Used The actual hardware connection via an Ethernet uses Ethernet adapter addresses (also called MAC addresses). These are 48-bit addresses and are unique for every Ethernet adapter manufactured. In order to send a packet to another computer, given the IP address of the other computer, it is first determined if the packet needs to be sent directly to the other computer or to the gateway. In either case, there is an IP address on the local network to which the packet must be sent.
4.5 Dynamically Assigned Internet Addresses In many instances, there are no fixed IP addresses. This is the case when, for example, you are assigned an IP address dynamically by your dial-up Internet service provider (ISP) or when you have a device that provides your IP addresses using the Dynamic Host Configuration Protocol (DHCP).
4.6 Placing Your Device on the Network In many corporate settings, users are isolated from the Internet by a firewall and/or a proxy server. These devices attempt to secure the company from unauthorized network traffic, and usually work by disallowing traffic that did not originate from inside the network. If you want users on the Internet to communicate with your RCM2100, you have several options.
4.7 Running 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 you to connect your PC and the RCM2100 board 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.
4.8 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. Instead of the MY_IP_ADDRESS and other macros, 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.
4.9 How to Set Up your Computer’s IP Address for Direct Connect When your computer is connected directly to the RCM2100 board 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.
4.10 Run the PINGME.C Sample Program Connect the crossover cable from your computer’s Ethernet port to the RCM2100 board’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 RCM2100 board should be on to indicate an Ethernet connection is made.
Program Description For operation, network addresses must be correctly defined at the start of this program. The TCPCONFIG 1 macro in the sample program provides default settings for MY_IP_ADDRESS, which is the address of the RCM2100 module, MY_NETMASK, and MY_GATEWAY (which needs to be defined if you wish to ping systems outside the local network). If you wish to ping systems using domain names instead of IP addresses, a valid DNS server address must be defined for MY_NAMESERVER.
4.11.2 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 sample program ETHCORE1.C. Press F9 to compile and run the program. TIP: This program will be more interesting to observe if LEDs DS4 and DS5 are installed on the Prototyping Board.
Generally, the other defined values may be left at their default settings. If you are operating the system behind a firewall or proxy and need to specify a host port for redirection, you should comment out the line reading: #define REDIRECTHOST MY_IP_ADDRESS Then uncomment the next line, which defines a specific redirection host and port: #define REDIRECTHOST "my host.com:8080" Be sure to enter the host port where indicated by "my host.com:8080". This application creates dynamic HTML web pages on the fly.
4.12 Where Do I Go From Here? NOTE: If you purchased your RCM2100 through a distributor or through a Z-World or Rabbit Semiconductor partner, contact the distributor or Z-World partner first for technical support. If there are any problems at this point: • Use the Dynamic C Help menu to get further assistance with Dynamic C. • Check the Z-World/Rabbit Semiconductor Technical Bulletin Board at www.zworld.com/support/bb/. • Use the Technical Support e-mail form at www.zworld.com/support/questionSubmit.shtml.
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.
48 RabbitCore RCM2100
INDEX A H S additional information online documentation .......... 5 references ............................ 5 hardware connections ........... 11 install RCM2100 on Prototyping Board ...................... 12 power supply ..................... 14 programming cable ........... 13 hardware reset ....................... 14 sample programs getting to know the RCM2100 EXTSRAM.C ................ 21 FLASHLED.C ........ 21, 26 FLASHLED2.C ............ 21 FLASHLEDS.C ...... 22, 27 FLASHLEDS2.C ..........
User’s Manual 50
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.