RabbitNet Peripheral Cards
User's Manual
PREV INDEX NEXT


1. The RabbitNet Protocol

1.1 General RabbitNet Description

RabbitNet is a high-speed synchronous protocol developed by Rabbit Semiconductor to connect peripheral cards to a master and to allow them to communicate with each other.

1.1.1 RabbitNet Connections

All RabbitNet connections are made point to point. A RabbitNet master port can only be connected directly to a peripheral card, and the number of peripheral cards is limited by the number of available RabbitNet ports on the master.


Figure 1. Connecting Peripheral Cards to a Master

A typical RabbitNet™ system consists of a master single-board computer and one or two peripheral cards. A high-performance Rabbit 3000® or Rabbit 2000® microprocessor on the master provides fast data processing, and a BL2500 or a BL2600 master also provides the DCIN and +5 V power for the peripheral cards. Use a straight-through CAT 5/6 Ethernet cable to connect the master to slave peripheral cards, unless you are using a device such as the OP7200 that could be used either as a master or a slave. In this case you would use a crossover CAT 5/6 Ethernet cable to connect an OP7200 that is being used as a slave.

NOTE Even though CAT 5/6 Ethernet cables are used for the RabbitNet connections, never connect a RabbitNet port to an Ethernet network. Doing so could destroy the RabbitNet SPI driver.

Distances between a master unit and peripheral cards can be up to 10 m or 33 ft.

Table 1 lists Rabbit Semiconductor's single-board computers and other devices that can be used as the master in a RabbitNet system.

Table 1. RabbitNet Master Capabilities
RabbitNet Masters Master Supplies Power to Peripheral Cards Number of
RabbitNet Ports
BL2500
Yes
2
BL2600
Yes
2
OP7200
No
1
RCM3300/RCM3360
Prototyping Board
No
1
PowerCore FLEX
Prototyping Board
No
1

1.1.2 RabbitNet Peripheral Cards

The OP7200 operator interface may serve as a RabbitNet peripheral card "display" in a RabbitNet system.

Visit our Web site for up-to-date information about additional cards and features as they become available. The Web site also has the latest revision of this user's manual.

1.1.3 Connectivity Tools

Rabbit Semiconductor also has available additional tools and parts to allow you to make your own wiring assemblies to interface with the friction-lock connectors on the RabbitNet peripheral cards.

Contact your authorized Rabbit Semiconductor distributor or your Rabbit Semiconductor Sales Representative for more information.

1.1.4 DIN Rail Mounting

RabbitNet peripheral cards and the BL2500 master may be mounted in 100 mm DIN rail trays as shown in Figure 2.


Figure 2. Mounting RabbitNet Peripheral Card in DIN Rail Trays

DIN rail trays are typically mounted on DIN rails with "feet." Table 2 lists Phoenix Contact part numbers for the DIN rail trays, rails, and feet. The tray side elements are used to keep the RabbitNet peripheral card in place once it is inserted in a DIN rail tray, and the feet are used to mount the plastic tray on a DIN rail.

Table 2. Phoenix Contact DIN Rail Mounting Components
DIN Rail Mounting Component Phoenix Contact
Part Description
Phoenix Contact
Part Number
Trays
UM 100-PROFIL cm1
19 59 87 4
Tray Side Elements
UM 108-SE
29 59 47 6
Foot Elements
UM 108-FE
29 59 46 3
1 Length of DIN rail tray in cm


NOTE Other major suppliers besides Phoenix Contact also offer DIN rail mounting hardware. Note that the width of the plastic tray should be 100 mm (3.95") since that is the width of a RabbitNet peripheral card. 108 mm plastic trays may be used with spacers.

1.2 Physical Implementation

There are four signaling functions associated with a RabbitNet connection. From the master's point of view, the transmit function carries information and commands to the peripheral card. The receive function is used to read back information sent to the master by the peripheral card. A clock is used to synchronize data going between the two devices at high speed. The master is the source of this clock. A slave select (SS) function originates at the master, and when detected by a peripheral card causes it to become selected and respond to commands received from the master.

The signals themselves are differential RS-422, which are series-terminated at the source. With this type of termination, the maximum frequency is limited by the round-trip delay time of the cable. Although a peripheral card could theoretically be up to 45 m (150 ft) from the master for a data rate of 1 MHz, Rabbit Semiconductor recommends a practical limit of 10 m (33 ft).

Connections between peripheral cards and masters are done using standard 8-conductor CAT 5/6 Ethernet cables. Masters and peripheral cards are equipped with RJ-45 8-pin female connectors. The cables may be swapped end for end without affecting functionality.

1.2.1 Control and Routing

Control starts at the master when the master asserts the slave select signal (SS). Then it simultaneously sends a serial command and clock. The first byte of a command contains the address of the peripheral card if more than one peripheral card is connected.

A peripheral card assumes it is selected as soon as it receives the select signal. For direct master-to-peripheral-card connections, this is as soon as the master asserts the select signal. The connection is established once the select signal reaches the addressed slave. At this point communication between the master and the selected peripheral card is established, and data can flow in both directions simultaneously. The connection is maintained so long as the master asserts the select signal.

1.3 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 Rabbit Semiconductor single-board computers and other devices based on the Rabbit microprocessor.

1.3.1 Dynamic C Libraries

In addition to the library associated with the master single-board computer such as the BL2500 or OP7200, several other libraries are needed to provide function calls for RabbitNet peripheral cards.

Function calls specific to individual RabbitNet peripheral cards are described in the chapters specific to the individual RabbitNet peripheral card. Other functions applicable to all devices based on Rabbit microprocessors are described in the Dynamic C Function Reference User's Manual. More complete information on Dynamic C is provided in the Dynamic C User's Manual.

1.3.1.1 Accessing and Downloading Dynamic C Libraries

The libraries needed to run the RabbitNet peripheral cards are available on the CD included with the Development Kit for the master single-board computer, or they may be downloaded from http://www.rabbit.com/support/downloads/ on Rabbit Semiconductor's Web site.

When downloading the libraries from the Web site, click on the product-specific links until you reach the links for the RabbitNet peripheral cards download. Once you have downloaded the file, double-click on the file name to begin the installation. InstallShield will install the files for you at a location you designate, and a pop-up readme file will explain the available options to add the files to your existing Dynamic C installation or to modify the relevant files in your existing Dynamic C installation.

You will be able to use the revamped Dynamic C installation with the RabbitNet peripheral card and you will continue to be able to use this installation with all the other Rabbit Semiconductor products you used before.

1.3.2 Sample Programs

Sample programs are provided in the Dynamic C SAMPLES folder.

The various folders contain specific sample programs that illustrate the use of the corresponding Dynamic C libraries. For example, the sample program PONG.C demonstrates the output to the STDIO window.

The RABBITNET folder provides sample programs specific to the RabbitNet peripheral cards. Each sample program has comments that describe the purpose and function of the program. Follow the instructions at the beginning of the sample program.

To run a sample program, open it with the File menu (if it is not still open), then compile and run it by pressing F9 or by selecting Run in the Run menu. The RabbitNet peripheral card must be connected to a master such as the BL2500 with its Demonstration Board connected as explained in the Coyote (BL2500) User's Manual or other user's manual. The BL2500 or other master must be in Program Mode, and must be connected via the programming cable to a PC.

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

1.3.3 General RabbitNet Operation

The SAMPLES\RABBITNET\ subdirectory contains the following sample programs. When running these sample programs, the RabbitNet peripheral card may be connected to either RabbitNet port on a master such as the BL2500 that has two RabbitNet ports. The sample program will use rn_device() to first look for peripheral cards connected to the master. The last peripheral card found will run the sample program. The sample program will also display the serial number(s) of the peripheral cards connected to which RabbitNet port on the master using the STDIO window, or that no card is connected to a particular port.

1.3.4 General RabbitNet Function Calls

The function calls described in this section are used with all RabbitNet peripheral cards, and are available in the RNET.LIB library in the Dynamic C RABBITNET folder.

int rn_init(char portflag, char servicetype);


Resets, initializes, or disables a specified RabbitNet port on the master single-board computer. During initialization, the network is enumerated and relevant tables are filled in. If the port is already initialized, calling this function forces a re-enumeration of all devices on that port.
Call this function first before using other RabbitNet functions.
Parameters
portflag is a bit that represents a RabbitNet port on the master single-board computer (from 0 to the maximum number of ports). A set bit requires a service. If portflag = 0x03, both RabbitNet ports 0 and 1 will need to be serviced.
servicetype enables or disables each RabbitNet port as set by the port flags.
0 = disable port
1 = enable port
Return Value
0

int rn_device(char pna);


Returns an address index to device information from a given physical node address. This function will check device information to determine that the peripheral card is connected to a master.
Parameter
pna is the physical node address, indicated as a byte.
7,6--2-bit binary representation of the port number on the master
5,4,3--Level 1 router downstream port
2,1,0--Level 2 router downstream port
Return Value
Pointer to device information. -1 indicates that the peripheral card either cannot be identified or is not connected to the master.
See Also

int rn_find(rn_search *srch);


Locates the first active device that matches the search criteria.
Parameter
srch is the search criteria structure rn_search:
Use a maximum of 3 macros for the search criteria:
For example:
Return Value
Returns the handle of the first device matching the criteria. 0 indicates no such devices were found.
See Also

int rn_echo(int handle, char sendecho, char *recdata);


The peripheral card sends back the character the master sent. This function will check device information to determine that the peripheral card is connected to a master.
Parameters
handle is an address index to device information. Use rn_device() or rn_find() to establish the handle.
sendecho is the character to echo back.
recdata is a pointer to the return address of the character from the device.
Return Value
The status byte from the previous command. -1 means that device information indicates the peripheral card is not connected to the master.

int rn_write(int handle, int regno, char *data, int datalen);


Writes a string to the specified device and register. Waits for results. This function will check device information to determine that the peripheral card is connected to a master.
Parameters
handle is an address index to device information. Use rn_device() or rn_find() to establish the handle.
regno is the command register number as designated by each device.
data is a pointer to the address of the string to write to the device.
datalen is the number of bytes to write (0-15).

NOTE A data length of 0 will transmit the one-byte command register number.

Return Value
The status byte from the previous command. -1 means that device information indicates the peripheral card is not connected to the master, and -2 means that the data length was greater than 15.
See Also

int rn_read(int handle, int regno, char *recdata, int datalen);


Reads a string from the specified device and register. Waits for results. This function will check device information to determine that the peripheral card is connected to a master.
Parameters
handle is an address index to device information. Use rn_device() or rn_find() to establish the handle.
regno is the command register number as designated by each device.
recdata is a pointer to the address of the string to read from the device.
datalen is the number of bytes to read (0-15).

NOTE A data length of 0 will transmit the one-byte command register number.

Return Value
The status byte from the previous command. -1 means that device information indicates the peripheral card is not connected to the master, and -2 means that the data length was greater than 15.
See Also

int rn_reset(int handle, int resettype);


Sends a reset sequence to the specified peripheral card. The reset takes approximately 25 ms before the peripheral card will once again execute the application. Allow 1.5 seconds after the reset has completed before accessing the peripheral card. This function will check peripheral card information to determine that the peripheral card is connected to a master.
Parameters
handle is an address index to device information. Use rn_device() or rn_find() to establish the handle.
resettype describes the type of reset.
0 = hard reset--equivalent to power-up. All logic is reset.
1 = soft reset--only the microprocessor logic is reset.
Return Value
The status byte from the previous command. -1 means that device information indicates the peripheral card is not connected to the master.

int rn_sw_wdt(int handle, float timeout);


Sets software watchdog timeout period. Call this function prior to enabling the software watchdog timer. This function will check device information to determine that the peripheral card is connected to a master.
Parameters
handle is an address index to device information. Use rn_device() or rn_find() to establish the handle.
timeout is a timeout period from 0.025 to 6.375 seconds in increments of 0.025 seconds. Entering a zero value will disable the software watchdog timer.
Return Value
The status byte from the previous command. -1 means that device information indicates the peripheral card is not connected to the master.

int rn_enable_wdt(int handle, int wdttype);


Enables the hardware and/or software watchdog timers on a peripheral card. The software on the peripheral card will keep the hardware watchdog timer updated, but will hard reset if the time expires. The hardware watchdog cannot be disabled except by a hard reset on the peripheral card. The software watchdog timer must be updated by software on the master. The peripheral card will soft reset if the timeout set by rn_sw_wdt() expires. This function will check device information to determine that the peripheral card is connected to a master.
Parameters
handle is an address index to device information. Use rn_device() or rn_find() to establish the handle.
wdttype
0 enables both hardware and software watchdog timers
1 enables hardware watchdog timer
2 enables software watchdog timer
Return Value
The status byte from the previous command. -1 means that device information indicates the peripheral card is not connected to the master.
See Also

int rn_hitwd(int handle, char *count);


Hits software watchdog. Set the timeout period and enable the software watchdog prior to using this function. This function will check device information to determine that the peripheral card is connected to a master.
Parameters
handle is an address index to device information. Use rn_device() or rn_find() to establish the handle.
count is a pointer to return the present count of the software watchdog timer. The equivalent time left in seconds can be determined from count × 0.025 seconds.
Return Value
The status byte from the previous command. -1 means that device information indicates the peripheral card is not connected to the master.
See Also

int rn_rst_status(int handle, char *retdata);


Reads the status of which reset occurred and whether any watchdogs are enabled.
Parameters
handle is an address index to device information. Use rn_device() or rn_find() to establish the handle.
retdata is a pointer to the return address of the communication byte. A set bit indicates which error occurred. This register is cleared when read.
7--HW reset has occurred
6--SW reset has occurred
5--HW watchdog enabled
4--SW watchdog enabled
3,2,1,0--Reserved
Return Value
The status byte from the previous command.

int rn_comm_status(int handle, char *retdata);


Parameters
handle is an address index to device information. Use rn_device() or rn_find() to establish the handle.
retdata is a pointer to the return address of the communication byte. A set bit indicates which error occurred. This register is cleared when read.
7--Data available and waiting to be processed MOSI (master out, slave in)
6--Write collision MISO (master in, slave out)
5--Overrun MOSI (master out, slave in)
4--Mode fault, device detected hardware fault
3--Data compare error detected by device
2,1,0--Reserved
Return Value
The status byte from the previous command.

1.3.5 Status Byte

Unless otherwise specified, functions returning a status byte will have the following format for each designated bit.

7 6 5 4 3 2 1 0
×
×
00 = Reserved
01 = Ready
10 = Busy
11 = Device not connected
×
0 = Device
1 = Router
×
0 = No error
1 = Communication error1
×
Reserved for individual peripheral cards
×
Reserved for individual peripheral cards
×
0 = Last command accepted
1 = Last command unexecuted
×
0 = Not expired
1 = HW or SW watchdog timer expired2
1 Use the function rn_comm_status() to determine which error occurred.

2 Use the function rn_rst_status() to determine which timer expired.



Rabbit Semiconductor
www.rabbit.com
PREV INDEX NEXT