RabbitCore RCM3900
User's Manual
PREV INDEX NEXT


3. Running Sample Programs

To develop and debug programs for the RCM3900 (and for all other Rabbit hardware), you must install and use Dynamic C.

3.1 Introduction

To help familiarize you with the RCM3900 modules, Dynamic C includes several sample programs. Loading, executing and studying these programs will give you a solid hands-on overview of the RCM3900's capabilities, as well as a quick start with Dynamic C as an application development tool.

NOTE The sample programs assume that you have at least an elementary grasp of the C programming language. If you do not, see the introductory pages of the Dynamic C User's Manual for a suggested reading list.

In order to run the sample programs discussed in this chapter and elsewhere in this manual,

  1. Your RCM3900 must be plugged in to the Prototyping Board as described in Chapter 2, "Getting Started."

  2. Dynamic C must be installed and running on your PC.

  3. The programming cable must connect the programming header (J1) on the RCM3900 to your PC.

  4. Power must be applied to the RCM3900 through the Prototyping Board.

Refer to Chapter 2, "Getting Started," if you need further information on these steps.

Since the RCM3900 runs at 44.2 MHz and is equipped with a fast program execution SRAM, remember to allow the compiler to run the application in the fast program execution SRAM by selecting Code and BIOS in Flash, Run in RAM from the Dynamic C Options > Project Options > Compiler menu.

To run a sample program, open it with the File menu, then compile and run it by pressing F9.

Complete information on Dynamic C is provided in the Dynamic C User's Manual.

3.2 Sample Programs

Of the many sample programs included with Dynamic C, several are specific to the RCM3900. Sample programs illustrating the general operation of the RCM3900, serial communication, and the NAND flash are provided in the SAMPLES\RCM3900 folder. Each sample program has comments that describe the purpose and function of the program. Follow the instructions at the beginning of the sample program.

TCP/IP sample programs are described in Chapter 6, "Using the TCP/IP Features." Sample programs for the optional LCD/keypad module that is used on the RCM3900 Prototyping Board are described in Appendix C.


Press "3" or "4" or "5"or "6" or "7"on your keyboard to select LED DS3 or DS4 or DS5 or DS6 on the Prototyping Board or the USR LED on the RCM3900. Then follow the prompt in the Dynamic C STDIO window to turn the LED on or off.

Once you have loaded and executed these four programs and have an understanding of how Dynamic C and the RCM3900 modules interact, you can move on and try the other sample programs, or begin building your own.

3.2.1 Use of NAND Flash (RCM3900 only)

The following sample programs can be found in the SAMPLES\RCM3900\NANDFlash folder.

NOTE These sample programs cannot be run on the RCM3910, which does not have NAND flash installed.

Follow these instructions to set up your PC or notebook. Check with your administrator if you are unable to change the settings as described here since you may need administrator privileges. The instructions are specifically for Windows 2000, but the interface is similar for other versions of Windows.

TIP If you are using a PC that is already on a network, you will disconnect the PC from that network to run these sample programs. Write down the existing settings before changing them to facilitate restoring them when you are finished with the sample programs and reconnect your PC to the network.

  1. Go to the control panel (Start > Settings > Control Panel), and then double-click the Network icon.

  2. Select the network interface card used for the Ethernet interface you intend to use (e.g., TCP/IP Xircom Credit Card Network Adapter) and click on the "Properties" button. Depending on which version of Windows your PC is running, you may have to select the "Local Area Connection" first, and then click on the "Properties" button to bring up the Ethernet interface dialog. Then "Configure" your interface card for a "10Base-T Half-Duplex" or an "Auto-Negotiation" connection on the "Advanced" tab.

NOTE Your network interface card will likely have a different name.

  1. Now select the IP Address tab, and check Specify an IP Address, or select TCP/IP and click on "Properties" to assign an IP address to your computer (this will disable "obtain an IP address automatically"):

    IP Address : 10.10.6.101

    Netmask : 255.255.255.0

    Default gateway : 10.10.6.1

  2. Click <OK> or <Close> to exit the various dialog boxes.


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 LIB\TCPIP\TCP_CONFIG.LIB library.

3.2.2 Use of miniSD™ Cards

The following sample program can be found in the SAMPLES\RCM3900\SD_Flash folder.

3.2.3 Serial Communication

The following sample programs can be found in the SAMPLES\RCM3900\SERIAL folder.

Two sample programs, SIMPLE485MASTER.C and SIMPLE485SLAVE.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—the second system may be another RCM3900, or it may be any Rabbit single-board computer or RabbitCore module that supports RS-485 serial communication as long as you use the master or slave sample program associated with that board.

Before running either of these sample programs on the RCM3900 assembly, make sure pins 1–2 and pins 5–6 are jumpered together on header JP5 to use the RS-485 bias and termination resistors. The sample programs use Serial Port C as the RS-485 serial port, and they use PD7 to enable/disable the RS-485 transmitter.

The RS-485 connections between the slave and master devices are as follows.

· RS485+ to RS485+
· RS485– to RS485–
· GND to GND

3.2.4 Real-Time Clock

If you plan to use the real-time clock functionality in your application, you will need to set the real-time clock. Set the real-time clock using the Dynamic C SAMPLES\RTCLOCK\SETRTCKB.C sample program by following the onscreen prompts. The Dynamic C SAMPLES\RTCLOCK\RTC_TEST.C sample program provides additional examples of how to read and set the real-time clock.

3.2.5 Other Sample Programs

Section 6.6 describes the TCP/IP sample programs, and Appendix C.7 provides sample programs for the optional LCD/keypad module that can be installed on the Prototyping Board.


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