RabbitNet Peripheral Cards
RabbitNet LAN Cards
User’s Manual
019–0146 •
070629–D
RabbitNet Peripheral Cards User’s Manual
Part Number 019-0146 • 07029–D • Printed in U.S.A.
©2005–2007 Rabbit Semiconductor Inc. • All rights reserved.
No part of the contents of this manual may be reproduced or transmitted in any form or by any means
without the express written permission of Rabbit Semiconductor.
Permission is granted to make one or more copies as long as the copyright page contained therein is
included. These copies of the manuals may not be let or sold for any reason without the express written
permission of Rabbit Semiconductor.
Rabbit Semiconductor reserves the right to make changes and
improvements to its products without providing notice.
Trademarks
Rabbit and Dynamic C are registered trademarks of Rabbit Semiconductor Inc.
RabbitNet is a trademark of Rabbit Semiconductor Inc.
The latest revision of this manual is available on the Rabbit Semiconductor Web site,
www.rabbit.com, for free, unregistered download.
Rabbit Semiconductor Inc.
www.rabbit.com
RabbitNet Peripheral Cards
TABLE OF CONTENTS
Chapter 1. The RabbitNet Protocol
1
1.1 General RabbitNet Description.............................................................................................................1
1.1.1 RabbitNet Connections .................................................................................................................1
1.1.2 RabbitNet Peripheral Cards ..........................................................................................................2
1.1.3 Connectivity Tools........................................................................................................................3
1.1.4 DIN Rail Mounting .......................................................................................................................4
1.2 Physical Implementation.......................................................................................................................5
1.2.1 Control and Routing......................................................................................................................5
1.3 Dynamic C ............................................................................................................................................6
1.3.1 Dynamic C Libraries.....................................................................................................................6
1.3.1.1 Accessing and Downloading Dynamic C Libraries ............................................................. 7
1.3.2 Sample Programs ..........................................................................................................................8
1.3.3 General RabbitNet Operation........................................................................................................8
1.3.4 General RabbitNet Function Calls ................................................................................................9
1.3.5 Status Byte ..................................................................................................................................15
Chapter 2. Digital I/O Card
17
2.1 Features ...............................................................................................................................................18
2.1.1 Software ......................................................................................................................................18
2.2 Connections ........................................................................................................................................19
2.2.1 Power Supply ..............................................................................................................................20
2.3 Pinout ..................................................................................................................................................22
2.3.1 Headers........................................................................................................................................22
2.3.2 Indicator LED .............................................................................................................................22
2.4 Digital I/O ...........................................................................................................................................23
2.4.1 Digital Inputs...............................................................................................................................23
2.4.2 Digital Outputs............................................................................................................................24
2.5 Analog Inputs......................................................................................................................................26
2.5.1 Single-Ended Inputs....................................................................................................................27
2.5.2 Differential Inputs .......................................................................................................................27
2.5.3 Calibrating the Analog Inputs .....................................................................................................27
2.5.3.1 Calibration Constants ......................................................................................................... 28
2.5.3.2 Calibration Recommendations ........................................................................................... 28
2.5.3.3 Factory Calibration............................................................................................................. 29
2.6 Software ..............................................................................................................................................30
2.6.1 Dynamic C Libraries...................................................................................................................30
2.6.2 Sample Programs ........................................................................................................................30
2.6.2.1 Digital I/O .......................................................................................................................... 30
2.6.2.2 Analog Inputs ..................................................................................................................... 32
2.6.3 Digital I/O Card Function Calls ..................................................................................................34
2.6.3.1 Digital Input Function Calls............................................................................................... 34
2.6.3.2 Digital Output Function Calls ............................................................................................ 35
2.6.3.3 Analog Input Function Calls .............................................................................................. 37
2.6.4 Status Byte ..................................................................................................................................44
2.7 Specifications......................................................................................................................................45
2.7.1 Electrical and Mechanical Specifications ...................................................................................45
2.7.1.1 Physical Mounting.............................................................................................................. 47
2.7.2 Jumper Configurations ................................................................................................................48
User’s Manual
Chapter 3. A/D Converter Card
51
3.1 Features .............................................................................................................................................. 52
3.1.1 Software...................................................................................................................................... 52
3.2 Connections ........................................................................................................................................ 53
3.2.1 Power Supply.............................................................................................................................. 54
3.3 Pinout ................................................................................................................................................. 55
3.3.1 Headers ....................................................................................................................................... 55
3.3.2 Indicator LED............................................................................................................................. 55
3.4 Analog Inputs ..................................................................................................................................... 56
3.4.1 Analog Current Measurements................................................................................................... 58
3.4.2 Calibrating the A/D Converter Chip........................................................................................... 59
3.4.2.1 Modes ................................................................................................................................ 59
3.4.2.2 Calibration Constants ........................................................................................................ 59
3.4.2.3 Calibration Recommendations........................................................................................... 60
3.4.2.4 Factory Calibration ............................................................................................................ 61
3.5 Software ............................................................................................................................................. 62
3.5.1 Dynamic C Libraries .................................................................................................................. 62
3.5.2 Sample Programs........................................................................................................................ 62
3.5.3 A/D Converter Card Function Calls ........................................................................................... 65
3.5.4 Status Byte.................................................................................................................................. 77
3.6 Specifications ..................................................................................................................................... 78
3.6.1 Electrical and Mechanical Specifications................................................................................... 78
3.6.2 Physical Mounting...................................................................................................................... 80
3.7 Jumper Configurations ....................................................................................................................... 81
Chapter 4. D/A Converter Card
83
4.1 Features .............................................................................................................................................. 84
4.1.1 Software...................................................................................................................................... 84
4.2 Connections ........................................................................................................................................ 85
4.2.1 Power Supply.............................................................................................................................. 86
4.3 Pinout ................................................................................................................................................. 87
4.3.1 Headers ....................................................................................................................................... 87
4.3.2 Indicator LED............................................................................................................................. 87
4.4 D/A Converter Outputs ...................................................................................................................... 88
4.4.1 Calibration .................................................................................................................................. 89
4.5 Software ............................................................................................................................................. 90
4.5.1 Dynamic C Libraries .................................................................................................................. 90
4.5.2 Sample Programs........................................................................................................................ 90
4.5.3 D/A Converter Card Function Calls ........................................................................................... 92
4.5.4 Status Byte.................................................................................................................................. 99
4.6 Specifications ................................................................................................................................... 100
4.6.1 Electrical and Mechanical Specifications................................................................................. 100
4.6.2 Physical Mounting.................................................................................................................... 102
Chapter 5. Relay Card
103
5.1 Features ............................................................................................................................................ 104
5.1.1 Software.................................................................................................................................... 104
5.2 Connections ...................................................................................................................................... 105
5.2.1 Power Supply............................................................................................................................ 106
5.3 Pinout ............................................................................................................................................... 108
5.3.1 Headers ..................................................................................................................................... 108
5.3.2 Indicator LEDs ......................................................................................................................... 108
5.4 Relay Outputs ................................................................................................................................... 109
5.5 Software ........................................................................................................................................... 110
5.5.1 Dynamic C Libraries ................................................................................................................ 110
5.5.2 Sample Programs...................................................................................................................... 110
5.5.3 Relay Card Function Calls........................................................................................................ 112
5.5.4 Status Byte................................................................................................................................ 115
RabbitNet Peripheral Cards
5.6 Specifications....................................................................................................................................116
5.6.1 Electrical and Mechanical Specifications .................................................................................116
5.6.2 Physical Mounting ....................................................................................................................118
Chapter 6. Keypad/Display Interface
119
6.1 Features .............................................................................................................................................120
6.1.1 Software ....................................................................................................................................120
6.2 Connections ......................................................................................................................................121
6.2.1 Power Supply ............................................................................................................................122
6.3 Key RabbitNet Keypad/Display Interface Components ...................................................................123
6.3.1 Headers and Jacks .....................................................................................................................123
6.3.1.1 Keypads............................................................................................................................ 123
6.3.1.2 Liquid Crystal Displays.................................................................................................... 124
6.3.2 LEDs .........................................................................................................................................124
6.3.3 Buzzer .......................................................................................................................................124
6.4 Liquid Crystal Display Backlights....................................................................................................125
6.5 Display Contrast ...............................................................................................................................127
6.6 Software ............................................................................................................................................128
6.6.1 Dynamic C Libraries.................................................................................................................128
6.6.2 Sample Programs ......................................................................................................................128
6.6.3 RabbitNet Keypad/Display interface Function Calls................................................................130
6.6.3.1 Buzzer............................................................................................................................... 130
6.6.3.2 LEDs................................................................................................................................. 131
6.6.3.3 Keypad ............................................................................................................................. 132
6.6.3.4 Display ............................................................................................................................. 135
6.6.4 Status Byte ................................................................................................................................141
6.7 Specifications....................................................................................................................................142
6.8 Electrical and Mechanical Specifications .........................................................................................142
6.8.1 Physical Mounting ....................................................................................................................144
Appendix A. Keypad/Display Interface Expansion Kit
145
A.1 Keypads............................................................................................................................................146
A.1.1 Keypad Templates....................................................................................................................147
A.2 LCD Displays...................................................................................................................................150
A.2.1 2 × 20 Character LCD ..............................................................................................................151
A.2.2 4 × 20 Character LCD ..............................................................................................................151
A.3 ZMENU.C........................................................................................................................................152
A.4 Configuring Key Code Indexes and Physical Keypad Arrangement...............................................156
A.4.1 Basics of Assigning Key Code Indexes ...................................................................................156
A.4.2 Expansion Kit Keypads............................................................................................................158
A.4.2.1 3 × 4 Keypad ................................................................................................................... 158
A.4.2.2 2 × 6 Keypad ................................................................................................................... 159
A.4.2.3 4 × 10 Keypad ................................................................................................................. 160
A.5 2 × 6 Keypad Datasheet ...................................................................................................................161
A.6 3 × 4 Keypad Datasheet ...................................................................................................................162
A.7 4 × 10 Keypad Datasheet .................................................................................................................163
A.8 2 × 20 Character LCD Datasheet .....................................................................................................164
A.9 4 × 20 Character LCD Datasheet .....................................................................................................188
Index
195
Schematics
199
User’s Manual
RabbitNet Peripheral Cards
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.
SLAVE
Straight-through
CAT 5/6 Ethernet cable
SLAVE
Rabbit 3000®
Microprocessor
MASTER
Crossover
CAT 5/6 Ethernet cable
MASTER
SLAVE
Power
Supply
Straight-through
CAT 5/6 Ethernet cable
Figure 1. Connecting Peripheral Cards to a Master
User’s Manual
1
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
• 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:
Signal = 0.1" friction-lock connectors
Power = 0.156" friction-lock connectors
RabbitNet = RJ-45 connector
• 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:
Signal = 0.1" friction-lock connectors
Power = 0.156" friction-lock connectors
RabbitNet = RJ-45 connector
2
RabbitNet Peripheral Cards
• D/A Converter Card
8 channels of 0–10 V 12-bit D/A conversion. The following connectors are used:
Signal = 0.1" friction-lock connectors
Power = 0.156" friction-lock connectors
RabbitNet = RJ-45 connector
• 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:
Signal = 0.1" headers or sockets
Power = 0.156" friction-lock connectors
RabbitNet = RJ-45 connector
• Relay Card
6 relays rated at 250 V AC, 1200 V·A or 100 V DC up to 240 W. The following connectors are
used:
Relay contacts = screw-terminal connectors
Power = 0.156" friction-lock connectors
RabbitNet = RJ-45 connector
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.
User’s Manual
3
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.
3
AI
0
R7
3
C7
8
R8
AG
ND
AI
1
2
R7
5
J11
R7
C7 4
9
GN
D
U4
J1
C1
C2
U2
U5
O1
1
C7
O1
2
O1
3
C6
O1
4
C5
O1
5
C4
+K
2
C3
J2
+K
2
U8
U7
+
D1
1
O1
0
O9
0
C1
1
U1
J8
0
J1
0
U6
U3
U11
C1
0
8
C4
Q4
O6
3
Q
32
O5
5
JP
D
16
C1
D
O4
4
GN
J5
+K1
J9
DCIN
+K
1
8
J4
GN
D
C1
O0
O1
6
O2
C1
2
O3
2
C1
+K
DC
IN
C1
C
Q1
6
O7
2
VC
+
3
JP
VCC
GND
C4
1
+K
1
O8
J3
C1
9
5
C3
RP
Q
64
GN
D
GN
D
U9
U1
Q
R14
R30
9
4 IN1
5
1
JP
J6
17
R15
R31
C9
C4
IN
PU 8-1
LL 5
3IN1
Q
33
4
7
C4
2
C8
RP
2 IN1
1 IN2
2 IN2
3
Q
7
8 RP
C5
R16
R32
8
C4
8
8
10
0 IN1
1 IN1
7
49
RP
C3
R4 7
7 C3
R4
2
5 RP
C6
IN1
8 IN1
9IN2
0 IN2
Q
C3
R4 6
C3
R4 5
5
6
9
C5
3 RP
IN9
C1
C3
R4 3
3
C3
R4 4
4
5 C6
RP
RP11
R6 12
6
C6
IN8
RP
2
IN
GN PU 16
+K D
LL -2
3
2
R24 R8
1
C3
R4 1
1 C3
R4 2
2
R25 R9
R21 R5
DC
C2
R3 7
7
0
C3
R4 0
9
R10
R26
R22 R6
RP
R19 R3
C2
R3 6
6
C2
R3 9
9
R4
5
J7
GN
D
RP
3
C1
C2 9
C2 0
C2 1
2
R18 R2
C2
R3 5
5
8
C2
R3 8
0
4
C7
IN
PU 0LL 7
D
B IG
O IT
A A
R L
D I/O
R12
R28
R13
R29
R11
R27
R17 R1
C2
R3 4
4
C5
R5
2
C6
R5
R5
4
6
C5
0
R23 R7
R20 R4
IN
VC
C
C6
0
9
9
2
C7
C5
2
C4
6
3
R8
R7
+
C5
3
C4
C4 3
C4 4
C5 5 R3C2
3
1
3
13 C6
R5
R6
2
3
65 C7
1
R6
Q
+
R5
1
7
+
7
6
RP
7
Y
1
C7
2
R6
PO
W
ER
IN0
6 IN0
C5
4
RP
C8
R5
R5 5
R5 6
R58 7
0
CR Q66
1
RA
BB
IT
3 IN0
4IN
05
9
7
4
NE
T
0 IN0
1 IN0
2 IN0
R5
Q6
C7
R6 0
5
9
R8
RA
BB
IT
IN0
C73
R7
1
C6
6
R6
0
9
R7
R6
R7 9
0
4
DC
IN
R7
7
C6
R6 8
1 C6
R6
AI
3+
R7
8
IN1
6 IN1
7 IN1
AI
2
+5
RE
FAI
3-
R8
7
R88
R85
R86
C7
R7 7
6
R8
N/
C
RabbitNet I/O
Card
Tray Side
Modular PC
Board Trays
DIN Rail
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 cm*
19 59 87 4
Tray Side Elements
UM 108-SE
29 59 47 6
Foot Elements
UM 108-FE
29 59 46 3
* 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.
4
RabbitNet Peripheral Cards
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.
User’s Manual
5
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.
6
RabbitNet Peripheral Cards
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.
User’s Manual
7
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.
• 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.
8
RabbitNet Peripheral Cards
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
rn_find
User’s Manual
9
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:
unsigned int flags;
unsigned int ports;
char pna
char productid;
char productrev;
char coderev;
long serialnum;
//
//
//
//
//
//
//
status flags see MATCH macros below
port bitmask
physical node address
product id
product rev
code rev
serial number
Use a maximum of 3 macros for the search criteria:
RN_MATCH_PORT
RN_MATCH_PNA
RN_MATCH_HANDLE
RN_MATCH_PRDID
RN_MATCH_PRDREV
RN_MATCH_CODEREV
RN_MATCH_SN
//
//
//
//
//
//
//
match
match
match
match
match
match
match
port bitmask
physical node address
instance (reg 3)
id/version (reg 1)
product revision
code revision
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. -1 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
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.
10
RabbitNet Peripheral Cards
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
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
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
rn_write
User’s Manual
11
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.
12
RabbitNet Peripheral Cards
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
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
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
rn_enable_wdt, rn_sw_wdt
User’s Manual
13
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.
14
RabbitNet Peripheral Cards
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 error*
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
expired†
* Use the function rn_comm_status() to determine which error occurred.
† Use the function rn_rst_status() to determine which timer expired.
User’s Manual
15
16
RabbitNet Peripheral Cards
Digital I/O Card
2. DIGITAL I/O CARD
Chapter 2 describes the features and the use of the Digital I/O
Card, one of the peripheral cards designed for use with the RabbitNet expansion ports on selected Rabbit Semiconductor singleboard computers, operator interfaces, and RabbitCore Prototyping
Boards.
Figure 3 shows a conceptual view of the Digital I/O Card connected to a master.
RabbitNet
LAN
Digital I/O
Card
SLAVE
MASTER
Rabbit 3000®
Microprocessor
DIGITAL
INPUTS
DIGITAL
OUTPUTS
ANALOG
INPUTS
DCIN, +5 V
EXTERNAL
+K SUPPLIES
Figure 3. Digital I/O Card (Slave) Connected to Master
NOTE: The OP7200 master and the RabbitCore Prototyping Boards do not supply any
power to the slave.
User’s Manual
17
RN1100
2.1 Features
• 24 protected and filtered digital inputs
• 16 high-speed protected digital outputs, individually configurable as sinking or sourcing
up to 200 mA at up to 36 V DC
• four 10-bit analog input channels:
2 buffered, 0 – 10 V, single-ended
1 buffered, 0 – 1 V, single-ended
1 buffered, -0.25 – +0.25 V, differential
• can be mounted in standard 100 mm DIN rail trays sold by other suppliers
• interfaces with master through RabbitNet™ serial protocol at 1 Megabit per second
using standard CAT 5/6 Ethernet cable, can be up to 10 m (33 ft) away from master
2.1.1 Software
The Digital I/O Card is a slave; the master to which it is connected is programmed using
version 8.01 or later of Rabbit Semiconductor’s Dynamic C. If you are using a master with
an earlier version of Dynamic C, Rabbit Semiconductor recommends that you upgrade
your Dynamic C installation. Contact your authorized Rabbit Semiconductor distributor or
your Rabbit Semiconductor Sales Representative for more information on Dynamic C
upgrades.
18
RabbitNet Peripheral Cards
Use a straight-through CAT 5/6 Ethernet cable to connect the Digital I/O Card’s RJ-45
RabbitNet jack to a RabbitNet port on the master. You may use either port if you are connecting to a master such as the BL2500 that has more than one RabbitNet port.
NOTE: The RJ-45 RabbitNet jacks are serial I/O ports for use with a master and a network of peripheral cards. The RabbitNet jacks do not support Ethernet connections.
C14
O5
C13
C15
O6
O7
+K1
O9 O10 O11 O12 O13 O14 O15
J3 O8
+K2
J2
GND
+K2
D1
Q1
DCIN
J10
J8
RABBIT NET
JP2
Digital I/O
Card
RP7
GN
D
RP8 C57
RP9 C62 RP10
U11
GND
+K1
C75
VCC
IN 0-7
PULL
C76
RP5
IN8
IN9
IN10
IN11
IN12
IN13
IN14
IN15
RP4 C49
DC
IN
R72
C40
C42
R15
R31
R16
R32
R13
R29
R14
R30
C66
U10
C73
R71
R89
+
Q66
CR1
R86
AI3+
IN 8PULL15
Q48
C72
R88
R85 R
78
AI0 AGNDAI1 AI2 +5REFAI3-
C80
R84
C55
C63
C65
RP11
RP12
R66
R67
Y1
R79 Q67
U3
U6
R52
R54
R63 C71
Q65
C37 C38
R47 R48 C48
R49
C64
R62
C36
R46
C52
U5 U2
+
U8
C35
R45
C34
R44
JP3DIGITAL I/O
BOARD
IN00
IN01
IN02
IN03
IN04
IN05
IN06
IN07
R50
R51
R55
R56
R57
R58
C59
C33
R43
Power-supply
cable
J7
U7
C32
R42
C31
R41
C53
C30
R40
R11
R27
R12
R28
R8
R24
R9
R25
R10
R26
C29
R39
R53
C67
R69
R70
R77
R75
N/C
R74
C79
RP13
R87
R60
C70
R65
J11
C28
R38
C27
R37
C50
R3
R19
R4
R20
R5
R21
R6
R22
R7
R23
C26
R36
+
C78
C25
R35
C60
GN
D
R73
R1
R17
R2
R18
C54
IN22
IN23
R82
C41
C39
C46
RP3
IN21
R83
Q64
C43
C44 C23 C24
C45 R33 R34
C51
U1
U4
GND
+K2
DC
IN
VCC
RP2
IN16
IN17
IN18
IN19
IN20
RP6
U9
C77
R76
Q33
Q49
C19
C20
C21
C22
R59
J5
+
Q32
Q17
C17
RP1
C68 C69
R61 R64
C18
Q16
+
D16
GND
+K2
DC
IN
VCC
J6
+K1
C16
GN
D
O4
C12
O3
C11
O2
C10
C9
O1
C8
O0
C7
C6
GND
J1
IN 16-23
JP1PULL
C5
C4
C3
+K1
C2
C1
J4
+K2
J9
RABBIT POWER
Master
Some masters have only
one RabbitNet port and
do not have a friction-lock
power terminal.
Straight-through
CAT 5/6 Ethernet cable
RabbitNet
X
Ethernet
Figure 4. Connect Digital I/O Card to Master
You will also have to provide two separate DC power supplies to your Digital I/O Card:
+5 V and a DCIN of 9–32 V. These power supplies are connected via the polarized
friction-lock terminal at header J9. You may assemble a suitable cable using the frictionlock connectors from the Connectivity Kit described in Section 1.1.3. If you are using a
BL2500 or BL2600 as your master, you may draw this power from the BL2500 or
BL2600 as shown in Figure 4.
If you are using the digital outputs, you will need two additional external power supplies
up to 36 V that can each handle up to 1.6 A for +K1 and +K2. The actual voltage and
current depend on the requirements of the loads you plan to connect to the digital outputs.
These power supplies are connected to friction-lock terminals J1 and J4 on the Digital I/O
Card. You may assemble suitable cables using the friction-lock connectors from the Connectivity Kit described in Section 1.1.3. See Section 2.2.1 for detailed wiring diagrams.
User’s Manual
19
Digital I/O Card
2.2 Connections
Figure 5 illustrates the assembled friction-lock connector wiring diagram for the power
supplies used to supply power to the Digital I/O Card.
GND
DCIN/+5 V
GND
+5 V
DCIN
GND
+K
GND
+K
DCIN
n.c.
+5 V
GND
If you are not drawing power
from the master, connect the
power-supply grounds of the
DCIN and 5 V power supplies
at the power supplies.
+K1/+K2
RABBIT NET
RN1100
2.2.1 Power Supply
J1 or J4
J9
J8
Figure 5. Power-Supply Connections
NOTE: If you are using separate DC power supplies for DCIN and +5 V because you are
not drawing this power from the master, note that the crimp pins used in the fractionlock connector assembly can only hold one wire each. Connect the one GND wire from
the fraction-lock connector assembly to the ground on one of the two power supplies,
then use a separate wire to connect the power-supply grounds together.
Use 18-gauge (AWG) wire for
power-supply connections up
to 10 m away from the master.
If the wire length is less than
3 m, 22 gauge (AWG) wire is
acceptable. Do not daisy-chain
the power supply connections
between different peripheral
cards, but use a star configuration from the master or router
when there are several peripheral cards.
Daisy
Chain
X
Star
Figure 6. Daisy Chain vs. Star Configurations
20
RabbitNet Peripheral Cards
Large transient currents flow in the ground and positive supply wires when the digital output
drivers are switched on/off, and it is imperative that any ground differential resulting from
resistive or inductive loss in the ground wire be kept as low as possible (