![]() |
| RabbitNet Peripheral Cards User's Manual |
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.
![]()
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
1.1.2 RabbitNet Peripheral Cards
- Digital I/O Card
- 24 inputs, 16 push/pull outputs, 4 channels of 10-bit A/D conversion with ranges of 0 to 10 V, 0 to 1 V, and -0.25 to +0.25 V. The following connectors are used:
- A/D Converter Card
- 8 channels of programmable-gain 12-bit A/D conversion, configurable as current measurement and differential-input pairs. 2.5 V reference voltage is available on the connector. The following connectors are used:
- D/A Converter Card
- Display/Keypad interface
- Allows you to connect your own keypad with up to 64 keys and one character liquid crystal display from 1 × 8 to 4 × 20 characters with or without backlight using standard 1 × 16 or 2 × 8 connectors. The following connectors are used:
- Relay Card
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.
- Connectivity Kit (Part No. 101-0581)--Six 1 × 10 friction-lock connectors (0.1" pitch) with sixty 0.1" crimp terminals; and two 1 × 4 friction-lock connectors (0.156" pitch) and two 1 × 2 friction-lock connectors (0.156" pitch) with fifteen 0.156" crimp terminals. Each kit contains sufficient parts to interface with one or more RabbitNet peripheral cards.
- Crimp tool (Part No. 998-0013) to secure wire in crimp terminals.
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.
![]()
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 DescriptionPhoenix Contact
Part Number
1 Length of DIN rail tray in cm
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.
RN_CFG_BL25.LIB--used to configure the BL2500 for use with RabbitNet peripheral cards. Function calls for this library are discussed in the Coyote (BL2500) User's Manual.
RN_CFG_BL26.LIB--used to configure the BL2600 for use with RabbitNet peripheral cards. Function calls for this library are discussed in the Wolf (BL2600) User's Manual.
RN_CFG_OP72.LIB--used to configure the OP7200 for use with RabbitNet peripheral cards. Function calls for this library are discussed in the eDisplay (OP7200) User's Manual.
RN_CFG_PowerCoreFLEX.LIB--used to configure the PowerCore FLEX modules for use with RabbitNet peripheral boards on the PowerCore FLEX Prototyping Board. Function calls for this library are discussed in the PowerCore FLEX User's Manual.
RN_CFG_RCM33.LIB--used to configure the RCM3300, RCM3310, RCM3360, and RCM3370 for use with RabbitNet peripheral boards on the RCM3300 Prototyping Board. Function calls for this library are discussed in the RCM3300/RCM3310 User's Manual and in the RCM3360/RCM3370 User's Manual.
RNET.LIB--provides functions unique to the RabbitNet protocol. Function calls for this library are presented below.
RNET_DRIVER.LIB--provides background functions unique to the RabbitNet data transmission protocol.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
readmefile 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
SAMPLESfolder.The various folders contain specific sample programs that illustrate the use of the corresponding Dynamic C libraries. For example, the sample program
PONG.Cdemonstrates the output to the STDIO window.The
RABBITNETfolder 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 usern_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.
ECHOCHAR.C--Demonstrates a simple character echo to any RabbitNet peripheral card. A character is sent to the RabbitNet peripheral card connected at a physical node address of 0x00 or 0000 octal. If a peripheral card is connected, the character will be returned back along with the status of the peripheral card. Otherwise, the status byte will indicate there is no connection.
ECHOTERM.C--Demonstrates a simple character echo to any RabbitNet peripheral card through a serial terminal on the master. A character is sent to the RabbitNet peripheral card connected at a physical-node address of 0x00 or 0000 octal. If a card is connected, the character will be returned back along with the status of the peripheral card. Otherwise, the status byte will indicate there is no connection.
HWATCHDOG.C--Demonstrates setting the hardware watchdog on a RabbitNet peripheral card. This sample program will first look for a peripheral card that matches the search criteria. The hardware watchdog will be set and a hardware reset should occur in approximately 1.5 seconds. The hardware watchdog will be disabled after the reset is done.
SWATCHDOG.C--Demonstrates setting and hitting the software watchdog on a RabbitNet peripheral card using costatements. This program will first look for a peripheral card matching the search criteria. The software watchdog will be set for 2.5 seconds. The watchdog will be hit at every increasing timeout until the timeout is past 2.5 seconds. A software reset will occur and the software watchdog will be disabled.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.LIBlibrary in the Dynamic CRABBITNETfolder.
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
portflagis 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. Ifportflag= 0x03, both RabbitNet ports 0 and 1 will need to be serviced.
servicetypeenables 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
pnais 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
rn_find
int rn_find(rn_search *srch);
- Locates the first active device that matches the search criteria.
Parameter
srchis the search criteria structurern_search:
unsigned int flags; // status flags see MATCH macros below
unsigned int ports; // port bitmask
char productid; // product id
char productrev; // product rev
char coderev; // code rev
long serialnum; // serial number
- Use a maximum of 3 macros for the search criteria:
RN_MATCH_PORT // match port bitmask
RN_MATCH_PNA // match physical node address
RN_MATCH_HANDLE // match instance (reg 3)
RN_MATCH_PRDID // match id/version (reg 1)
RN_MATCH_PRDREV // match product revision
RN_MATCH_CODEREV // match code revision
RN_MATCH_SN // match serial number
- For example:
rn_search newdev;
newdev.flags = RN_MATCH_PORT|RN_MATCH_SN;
newdev.ports = 0x03; //search ports 0 and 1
newdev.serialnum = E3446C01L;
handle = rn_find(&newdev);Return Value
- Returns the handle of the first device matching the criteria. 0 indicates no such devices were found.
See Also
rn_device
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
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
sendechois the character to echo back.
recdatais 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
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
regnois the command register number as designated by each device.
datais a pointer to the address of the string to write to the device.
datalenis 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
rn_read
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
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
regnois the command register number as designated by each device.
recdatais a pointer to the address of the string to read from the device.
datalenis 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
rn_write
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
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
resettypedescribes 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
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
timeoutis 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
handleis an address index to device information. Usern_device()orrn_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
rn_hitwd, rn_sw_wdt
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
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
countis a pointer to return the present count of the software watchdog timer. The equivalent time left in seconds can be determined fromcount× 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
rn_enable_wdt, rn_sw_wdt
int rn_rst_status(int handle, char *retdata);
- Reads the status of which reset occurred and whether any watchdogs are enabled.
Parameters
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
retdatais 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
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
retdatais 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 functionrn_rst_status()to determine which timer expired.
| Rabbit Semiconductor www.rabbit.com |