![]() |
|
| << Previous | Index | Next >> | |
| | |
The information in this chapter will get you up and running. Follow the instructions given here to install, connect and verify the software and hardware components.
2.1 Hardware Preparation
This section physically prepares the RabbitFLEX board for use in developing and debugging applications. As a way to place the board in a more convenient position for development, the first thing to do is screw on the hex standoffs that came in the RabbitFLEX as shown in Figure 2.1.
2.1.1 Hardware Connections
There are two steps to readying the RabbitFLEX BL300F for use with Dynamic C:
Connect the programming cable between the RabbitFLEX BL300F and the host PC where you will install Dynamic C.
The core module comes attached to the RabbitFLEX BL300F from the factory. The core module and the board it is attached to are a matched set. They must be used together. Do not remove the core module and attach a different core module to the RabbitFLEX board.
2.1.1.1 Connect Programming Cable
The programming cable completes the communications channel for downloading programs to the core module. Once a program has been downloaded and is running, you can debug it over the programming cable.
Connect the 10-pin connector labeled PROG on the programming cable to header J2 on the PowerCore module as shown in Figure 2.2.
Attach the other end (the DB9 connector) of the programming cable to a COM port on the host PC. Some PCs now come equipped with a USB port and no COM port. In this case, you can connect the programming cable's DB9 connector to a RS-232/USB converter (Rabbit Part No. 540-0070), and then plug the other end of the converter into the USB port of the host PC.
2.1.1.2 Connect Power
Connect the locking plug of the AC adapter to connector J3 on the PowerCore module as shown in Figure 2.2. When the other end of the AC adapter is plugged into a power source, a small red LED labeled DS1 on the RabbitFLEX board (located in the corner by connector J5) will come on.
You can cycle power to the board by unplugging and then plugging in the AC adapter. There is a reset button located on the top-right corner on your board that can be used restart the microcontroller.
2.2 Software Preparation
Dynamic C version 9.41 or later must be installed on the host PC before you can download any programs to the RabbitFLEX BL300F.
2.2.1 Installing Dynamic C
Insert the installation disk or CD in the appropriate disk drive on your PC. The installation should begin automatically. If it doesn't, issue the Windows "Run..." command and type the following command:
<disk>:\SETUPThe installation program will begin and guide you through the installation process. Your IBM-compatible PC should have at least one free COM port and be running Windows 95 or later.
Now you must make your board-specific library available to Dynamic C. The board-specific library is the one that was generated when you ordered your board. If you have not already downloaded this file, follow these steps.
Log in to your RabbitFLEX Configurator account at:
www.rabbit.com/products/RabbitFLEXSelect your RabbitFLEX board(s) from your list of boards to get the corresponding library or libraries, which are named FAxxxxxxx.LIB.
Do not change the library name(s). You will be prompted during the download process for the location to save the library or libraries. It is recommended that you use the
LIB\RabbitFlex_SBC40folder that was created during the Dynamic C installation process.
2.2.2 Starting Dynamic C
Once Dynamic C has been installed, you will have up to three related icons on your PC desktop. One icon is for running Dynamic C, one opens the documentation menu and the last one is for the Rabbit Field Utility, a tool used to download compiled software (.bin files) to a target board.
Start Dynamic C by clicking on its desktop icon or by clicking on
dcrabXXXX.exein the Dynamic C root directory, where XXXX is the Dynamic C version number.Dynamic C uses the serial port on the host PC that you specified during installation. If you are using a USB port, you must select "Use USB to Serial Converter" from the Communications tab of the Options | Project Options menu before downloading a program to the RabbitFLEX BL300F.
2.3 Verify Serial Connections
Run the sample program
pong.cto verify that everything is installed and connected properly. There are three ways to open a program from within Dynamic C: the File menu, the File icon or the keyboard shortcut Ctrl+O. They all open the same dialog box that allows you to browse for the file or type in its pathname. The sample programpong.cis in the Samples folder where you installed Dynamic C.
Press function key F9 to compile and run the sample program. Dynamic C will display a status message during compilation and download. If Dynamic C reports no errors and the Stdio window then opens and displays a small square bouncing around in a box you have verified that the serial connection is functioning.
If the program did not compile or run correctly, please see Section 2.5 for some troubleshooting tips that may help diagnose and fix the problem.
2.4 Ethernet Communication
This section describes the additional hardware connections needed to use the RabbitFLEX BL300F Ethernet port. An Ethernet port is available on the PowerCore 3800, but not on the PowerCore 3810. You must have a core module with an Ethernet port and your host computer will need one as well. You may create a direct or an indirect network connection from the target board to the host computer. The core module uses traditional 10Base-T Ethernet, with an RJ-45 jack which is shown in Figure 2.4.
To communicate on a network, the RabbitFLEX board must be connected to the network with the appropriate cable and the board must be assigned an appropriate IP address. Other addresses may be necessary, depending on whether the network is isolated or is addressable on the Internet. For development, it is better (read easier) to use an isolated network as opposed to one connected to the Internet. Either is possible, and both will be discussed here.
Before proceeding you will need to have two straight through Ethernet cables and a hub, or a crossover Ethernet cable. The Ethernet cables and a 10Base-T Ethernet hub are available from Rabbit in the TCP/IP 10Base-T Accessory Kit. More information is available at: www.rabbit.com
2.4.1 Direct Connection
A direct connection means that a crossover cable connects the target board to the host computer running Dynamic C. Plug one end of the crossover cable into the RJ-45 jack on the core module and the other end to the network interface card in your host PC.
2.4.2 Indirect Connection
An indirect connection means that a straight-through cable connects the target board to an Ethernet network via a hub.
2.4.3 Setting IP Addresses
IP addressing is necessary to communicate on networks. IP addresses are like street addresses or phone numbers in that they associate a unique number with an entity. Just as no two devices can have the same phone number, no two devices on a network can have the same IP address.
The Dynamic C implementation of TCP/IP makes network configuration very easy. In most cases an application only needs to define the configuration macro TCPCONFIG. This configuration macro is used to define other configuration macros. In the sample programs you will see TCPCONFIG defined as 1. This is the default network configuration, which will bring up the Ethernet interface and assign default IP addresses for the system, as well as a netmask.
You only need to set the network configuration in
Lib/tcpip/tcp_config.libfor most sample programs to work. The following line of code was taken fromtcp_config.lib:#define _PRIMARY_STATIC_IP "10.10.6.100"The IP address is a 32-bit number that is expressed in the dotted decimal format shown in the above #define statement. Unless there is a need to set a specific IP address to your Rabbit-based device, you may proceed with the default address of 10.10.6.100. Otherwise, open tcp_config.lib and replace "10.10.6.100" with the IP address for your Rabbit-based device. If your device is on a local network, this change may be sufficient; however, if your device is addressable over the Internet, you must also set the macro
MY_GATEWAYto the IP address of the default gateway (router) used by your network.The Dynamic C implementation of TCP/IP supports subnetting. Subnetting is done with a logical bitwise AND of a netmask and the IP address. The following line of code was taken from
tcp_config.lib:#define _PRIMARY_NETMASK "255.255.255.0"If you do not know the correct values for your IP address and netmask, ask your network administrator.
If you have created an isolated network of just the PC running Dynamic C and the RabbitFLEX BL300F, you can use any IP address and netmask that you like as long as they are in dotted decimal format and are on the same network. For example, if using the default netmask, the first three octets of each IP address must match.
2.4.4 Verify the Ethernet Connection
Run the sample program
ping.cto verify that everything is connected properly. The sample programping.cis in the\Samples\tcpipfolder where you installed Dynamic C.Press function key F9 to compile and run the program. Dynamic C will display a status message during compilation and download. If Dynamic C reports no errors and the Stdio window then opens and reports that ping responses were received from the remote host, as shown in the screenshot in Figure 2.5, you have verified that the network connection is functioning.
2.5 Troubleshooting Tips
This section discusses troubleshooting tips to try when the above instructions did not result in the error-free running of the pong and/or ping program. There are various conditions to double-check.
If you see the message
"No Rabbit Processor Detected"
Be sure the programming cable is attached securely and that it is not misaligned or backwards.
If your PC is busy running concurrent tasks, try lowering both the Debug and Download baud rates. Or exit the concurrent tasks.
If you have something like Palm Desktop running, it may monopolize a serial port. Disable this program, or others like it (that is, any program that uses the serial port and stays open in the background).
Use the power supply that came in the Tool Kit. Make sure it is attached securely.
If you need to use a USB to serial converter, use the one sold at:
www.rabbit.com/products/rs232_usb_cable/index.shtmlDo some basic debugging. For example, see if there is power at the core module and check the 3.45 regulator. Figure 2.6 shows the points to probe with a multimeter. They are located in the lower righthand side of the module and are labeled "A" through "F." Table 2-6 describes the labeled test points and the voltages you should expect to see.
Table 2-6. Description for Test Points in Figure 2.6 A, B, C: These pins are the center-tapped power supply input. "B" is ground. Both "A" and "C" measure the voltage coming from the external power supply From B to A, 12 V AC or higher From B to C, 12 V AC or higher D: This capacitor terminal is an easy place to access the board-level ground. E, F: These pins are the output and input, respectively, of the 3.45 V regulator. From D to E, approx. 3.45 V DC From D to F, approx. 5 V DC
If you see the message
"Could not open serial port"
Another program (for example, a terminal emulator) is already using the COM port you chose for Dynamic C or the programming cable is not attached to the correct COM port on the PC. To change the COM port Dynamic C will use, choose Options > Project Options and click the Communications tab. Select another COM port from the Serial Port pull-down menu.
If you see the message
"Timeout while waiting for response from target"
You might have a baud rate mismatch problem. Choose Options > Project Options and click the Communications tab. Select a different value in the Debug Baud Rate dropdown menu.
If you have a very slow PC or are doing other CPU-intensive tasks at the same time Dynamic C is trying to download, you might get other timeout error messages. Dynamic C needs a lot of CPU time during a download. Try stopping the other tasks to see if it helps.
Problems During and/or at the End of Compilation
A few computers have trouble handling the default 115,200 baud rate. Change the stop bits from 1 to 2 in the Communications tab of Project Options. If that does not work, slow the baud rate to 57,600 and try the compilation again.
2.7 Contact Information
If there are any questions at this point:
If you purchased your RabbitFLEX BL300F through a distributor or through a Rabbit partner, contact the distributor or partner first for technical support.
Check the Rabbit Technical Bulletin Board at: www.rabbit.com/support/bb/.
Use the Technical Support e-mail form at: www.rabbit.com/support/.
| RabbitFLEX | << Previous | Index | Next>> | www.rabbit.com |