The DSCARD is an 8051 based microcontroller (DS80C320) with resources to control up to 4 TTL/CMOS inputs, up to 4 relay outputs (Form A, 30Vdc @ 1A max.), and a Wiegand Card Reader control/ interface port. In addition the unit can sense several jumper settings, has onboard LED indicators and, a socket for an optional battery backed clock/calendar/RAM. The DSCARD has an addressable (8-bit) RS485 communications port for operation up to 115.2K Baud. An onboard switching regulator allows for 9-35VDC operation of the unit (5VDC card reader, 19-35VDC for 15VDC card reader). A second onboard switching regulator provides power to the Wiegand Card Reader and is jumper selectable for 5V, 8V, 10V, 12V, 15V (minimum input voltage required is selected voltage plus 4 volts). The DSCARD will interface to a wide variety of Wiegand Card Readers, with allowable time between pulses from about 0.5mS up to 2.1mS, and pulse widths from approximately 25uS to over 100uS. Wiegand formats of 8-64 bits can be accommodated in the "universal" mode of operation. A "hold" line is NOT required, and two open collector outputs are provided to the reader (30VDC @ 50mA) for controlling LEDs, audio indicators, etc.
BOARD CONFIGURATION JUMPER DESIGNATIONS | ||||
Jumper | Bit | Setting | JUMPER FUNCTION | Other/For |
J1 | X | A/B | RESET - J1B MUST BE INSTALLED | DO NOT REMOVE J1B |
J2 | 2 | I/R | I=UNIVERSAL, R=26-BIT | FS = I |
J3 | 3 | I/R | I=DISABLE, R=ENABLE
OFF LINE SITE-CODE ENTRY |
FS = I |
J4 | 4 | I/R | I=CSUM, R=NO CSUM | FS = I |
J5 | X | I/R | I=CHASSIS GROUND OPTION | FS = I |
J6 | X | A or B | A=27512 PROM
B=2764/27128/27256 |
FS = B
PROM TYPE |
J7 | X | I/R | I = 2764/27128
R = 27256/27512 |
FS = I
PROM TYPE |
J8 | X | I/R | I = 32K RAM
R = 16/8K RAM |
FS = I
RAM TYPE |
J9 | X | I/R | I = RS485 Common LOW-Z
R = RS485 Common 100 OHMS |
FS = I |
J10 | X | I/R | I = ENABLE RS485 AC/DC Termination | FS = I
120 OHMS DC |
J10A | X | I/R | I = DC Termination
R = AC Termination |
FS = I
120 OHMS DC |
J11 | 3 | I/R | Reserved | FS = I |
J12 | 2 | I/R | Reserved | FS = I |
J13 | 1 | I/R | Baud Rate MSB (2) | FS = I |
J14 | 0 | I/R | Baud Rate LSB (1) | FS = I |
J15 | 7 | I/R | MSB unit address (128) | FS = R |
J16 | 6 | I/R | Mid unit address (64) | FS = R |
J17 | 5 | I/R | Mid unit address (32) | FS = R |
J18 | 4 | I/R | Mid unit address (16) | FS = R |
J19 | 3 | I/R | Mid unit address (8) | FS = I |
J20 | 2 | I/R | Mid unit address (4) | FS = I |
J21 | 1 | I/R | Mid unit address (2) | FS = I |
J22 | 0 | I/R | Mid unit address (1) | FS = I |
J23-30 | 7-0 | I/R | Site Code Address
J23 = MSB, J30 = LSB |
FOR 26-BIT
MODE ONLY |
J31 | 0 | I/R | Reserved | FS = R |
J32 | X | I/R | I = 2.2K PULLUP TO +VA | XA OUTPUT |
J33 | X | I/R | I = 2.2K PULLUP TO +VA | XB OUTPUT |
I = INSTALL JUMPER, R = REMOVE JUMPER, FS = FACTORY SETTING
CARD READER JUMPER DESIGNATIONS (ONE JUMPER ONLY) | ||||
Jumper | Bit | Setting | JUMPER FUNCTION | Other/For |
5V | X | I/R | CARD READER VOLTAGE = 5V REMOVE 8V, 10V, 12V, 15V | FS = I |
8V | X | I/R | CARD READER VOLTAGE = 8V
REMOVE 5V, 10V, 12V, 15V |
FS = R |
10V | X | I/R | CARD READER VOLTAGE = 10V
REMOVE 5V, 8V, 12V, 15V |
FS = R |
12V | X | I/R | CARD READER VOLTAGE = 12V
REMOVE 5V, 8V, 10V, 15V |
FS = R |
15V | X | I/R | CARD READER VOLTAGE = 15V
REMOVE 5V, 8V, 10V, 12V |
FS = R |
I = INSTALL JUMPER, R = REMOVE JUMPER, FS = FACTORY SETTING
REGISTER | NAME | LOCATION | FUNCTION | OTHER |
OUTPUT R | OR | R5F (5Fh) | Reserved | |
OUTPUT L | OL | R5E (5Eh) | RELAY/OUTPUT REGISTER | SEE BELOW |
INPUT R
DEBOUNCE |
IR | R5D (5Dh) | INPUTS 1-4, J11-14 | STATUS |
INPUT L
FAST |
IL | R5C (5Ch) | INPUT 1-4, J11-14 | IN1 = MSB |
AUXIN R | AR | R5B (5Bh) | SITE ADDRESS J23-30 | 26-BIT
MODE |
AUXIN L | AL | R5A (5Ah) | X,X,X,J4,J3,J2,X,J30 | STATUS |
UNIT ID | ID | R51 (51h) | UNIT STATUS BITS | SEE Q-CMD |
COMM.
ADDRESS |
CA | R50 (50h) | UNIT COMMUNICATIONS
HEX ADDRESS |
MSB = J15
LSB = J22 |
PROM VER | PV | R60 (60h) | PROM VERSION X.X | VER 2.0 |
CARD# | CN | R40 (40h)
R47 (47h) |
64-BIT CARD VALUE
R40=MSB, R47=LSB |
G-CMD FOR
FIRST 54 |
CARD-BITS | CB | R38 (38h) | NUMBER OF CARD BITS
CAPTURED DURING READ |
8-64 BITS
SUPPORTED |
INT "A" | IA | R37 (37h) | INTERNAL "A" OUTPUT
Any input change |
GRN LED
1 SECOND |
INT "B" | IB | R36 (37h) | INTERNAL "B" OUTPUT
CARD IN BUFFER |
GRN LED
ON=CARD |
EXT "A" | XA | R35 (35h) | EXTERNAL "A" OUTPUT
On, Off, 0.5-127 sec. |
OPEN
COLLECTOR |
EXT "B" | XB | R34 (34h) | EXTERNAL "B" OUTPUT
On, Off, 0.5-127 sec. |
OPEN
COLLECTOR |
RELAY K4 | K4 | R33 (33h) | K4 FORM-C RELAY
On, Off, 0.5-127 sec. |
OPEN
COLLECTOR |
RELAY K3 | K3 | R32 (32h) | K3 FORM-C RELAY
On, Off, 0.5-127 sec. |
OPEN
COLLECTOR |
RELAY K2 | K2 | R31 (31h) | K2 FORM-C RELAY
On, Off, 0.5-127 sec. |
OPEN
COLLECTOR |
RELAY K1 | K1 | R30 (30h) | K1 FORM-C RELAY
On, Off, 0.5-127 sec. |
OPEN
COLLECTOR |
WCARD | WC | R26 (26h) | CARD READ FLAG AND
TOTAL CARD BITS |
READ FLAG
= BIT-7 |
WCARDIO | IO | R25 (25h) | SMART-LXX I/O STATUS | LCC CMD |
BCD = BINARY CODED DECIMAL, MSD = MOST SIGNIFICANT DATA, LSD = LEAST SIGNIFICANT DATE
REG. | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
OR (5Fh) | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
OL (5Eh)
REFERENCE |
IA | IB | XA | XB | K1 | K2 | K3 | K4 |
IR (5Dh)
DEBOUNCE |
IN1 | IN2 | IN3 | IN4 | J11 | J12 | J13 | J14 |
IL (5Ch)
WORKING |
IN1 | IN2 | IN3 | IN4 | J11 | J12 | J13 | J14 |
AR (5Bh) | J23=
128 |
J24=
64 |
J25=
32 |
J26=
16 |
J27=
8 |
J28=
4 |
J29=
2 |
J30=
1 |
AL (5Ah) | N/A | N/A | N/A | J4 | J3 | J2 | N/A | J31 |
ID (51h)
QUICK-STATUS |
N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
CA (50h)
COM ADDR |
J15=
128 |
J16=
64 |
J17=
32 |
J18=
16 |
J19=
8 |
J20=
4 |
J21=
2 |
J22=
1 |
RESERVED | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
All commands/arguments to the DSCARD unit are in ASCII or ASCII(HEX). Commands are one capital ASCII character (G through Z), and arguments are 2-hexadecimal ASCII characters (0-9 or A through F). Response data will be ASCII(HEX or BCD). The characters "L", "R", "M", "G", "P", "I", and "Q" are used as commands at the present time. Characters from "0" through "9" and "A" through "F" are used to send/receive data one nibble at a time (hex or BCD format). The communications format is 9600,N,8,1 with Baud rates from 9600 to 115.2K (jumper selectable).
In general three ASCII characters (1-command, 2-argument) are sent by the host, and the slave units respond with a four character string. The "GXX" command response is fixed at 16 characters. The specifics for each command are detailed in the following paragraphs along with examples.
The "LXX" command is used to locate the desired unit to communicate with. A capital "L"(04CH) followed by two location characters (0-9, A-F) is sent to the DSCARD network to enable communications with a specific unit. All other units are disabled if not specifically selected.
A typical communications string from a host computer and a response from a slave unit would be as follows:
Host: L23 (ASCII/ASCII-HEX)
Response from slave unit 23: 2348 (ASCII-HEX)
L (04CH) Command Character
2 (032H) High nibble of communications address (CA)
3 (033H) Low nibble of communications address (CA)
A typical response string from the DSCARD is as follows:
DELAY 0 to 1mSEC response delay
2 (032H) Echo high nibble of communications address (CA)
3 (033H) Echo low nibble of communications address (CA)
4 (034H) WCARD/WCARDIO high status nibble (WC/IO)
8 (038H) WCARD/WCARDIO low status nibble (WC/IO)
Notes:
1) If ID-Bit-7 is set (1) this indicates that a
Wiegand card read has occurred (and should be read
by the host computer). If Bit-7 is set (1), then
Bit-6 (MSB) through Bit-0(LSB) indicate the number
of card bits read into the buffer.
2) Bit-6 indicates K1 status if Bit-7 = 0
3) Bit-5 indicates K2 status if Bit-7 = 0
4) Bit-4 indicates K3 status if Bit-7 = 0
5) Bit-3 indicates IN1 status if Bit-7 = 0
6) Bit-2 indicates IN2 status if Bit-7 = 0
7) Bit-1 indicates IN3 status if Bit-7 = 0
8) Bit-0 indicates IN4 status if Bit-7 = 0
The "RXX" command is used to set the register data pointer, (used by the MODIFY) and to retrieve the contents of a register pair from the DSCARD unit. A capital "R"(052H) followed by two register location characters (0-9, A-F) is sent to the unit. The DSCARD will respond with a character string containing the contents of the register selected and the contents of register+1. The data pointer is set to "XX" (register location). The data pointer remains fixed until a subsequent "RXX" command changes it; however, it is good practice to always read a register before changing its contents with the MODIFY command ("MXX").
A typical communications string from a host computer and a response from a slave unit would be as follows:
Host: R30 (ASCII/ASCII-HEX)
Response from slave unit: 0B44 (ASCII-HEX)
R (052H) Command Character
3 (033H) High nibble of register address
0 (030H) Low nibble of register address
A typical response string from the unit is as follows:
DELAY 0 to 1mSEC response delay
0 (030H) High nibble of register data
B (042H) Low nibble of register data
4 (034H) High nibble of register+1 data
4 (034H) Low nibble of register+1 data
Note:
In this example the R30 command was used to
retrieve the contents of the K1 timer (0Bh = 5.5
sec.) and the K2 timer (44h = 24 sec.)
The "MXX" command is used to modify the contents of the register previously selected using the "RXX" command. A capital "M"(04DH) followed by two data characters (0-9, A-F) is sent to the unit to modify the "target" register contents (8-bits only).
A typical communications string from a host computer and a response from a slave unit would be as follows:
Host: M00 (ASCII/ASCII-HEX), Assume R30 previously selected.
Response from slave unit: 0044 (ASCII-HEX)
M (04DH) Command Character
0 (030H) High nibble of new register data
0 (030H) Low nibble of new register data
A typical response string from the unit is as follows:
DELAY 0 to 1mSEC response delay
0 (030H) High nibble of register data
0 (030H) Low nibble of register data
4 (034H) High nibble of register+1 data
4 (034H) Low nibble of register+1 data
Notes:
1) If additional "MXX" commands are issued without any
intervening "LXX" or "RXX" commands the same
register contents can be modified as many times as
desired.
2) The above command has been used to clear the high-byte of the K1 relay counter.
3) For 16-bit counters it is good practice to select the low-byte of the counter and clear it, before clearing the high-byte. This will prevent roll-over errors from the low-byte to the high-byte.
The "GXX" command is used to select a node (similar to "LXX" command), return the least significant 54-bits (right justified) of the Wiegand card reader data and, check sum information (16 ASCII-HEX characters). The "GXX" command will disable all modules except the one addressed by "GXX." A capitol "G"(048H) followed by two data characters (0-9,A-F), is sent to the DSCARD unit.
A typical communications string from a host computer and a response from a slave unit would be as follows:
Host: G23 (ASCII/ASCII-HEX)
Response from slave unit: 0000061EE4F55208
(ASCII-HEX)
G (048H) Command character
2 (032H) High nibble of communications address (CA)
3 (033H) Low nibble of communications address (CA)
A typical response string is as follows:
DELAY 0 to 1mSEC response delay
0 (030H) Card data MSB-Mid nibble (R41), (54-bits total)
0 (030H) Card data Mid nibble (R41)
0 (030H) Card data Mid nibble (R42)
0 (030H) Card data Mid nibble (R42)
0 (030H) Card data Mid nibble (R43)
6 (036H) Card data Mid nibble (R43)
1 (031H) Card data Mid nibble (R44)
E (045H) Card data Mid nibble (R44)
E (045H) Card data Mid nibble (R45)
4 (034H) Card data Mid nibble (R45)
F (046H) Card data Mid nibble (R46)
5 (035H) Card data Mid nibble (R46)
5 (035H) Card data Mid nibble (R47)
2 (032H) Card data LSB nibble (R47)
0 (030H) High check sum nibble (HEX)
8 (038H) Low check sum nibble (HEX)
Notes:
1) A total of 16 ASCII characters are returned by the
slave for the "GXX" command in approximately 20mS
at 9600,N,8,1.
2) The check sum should be checked for data integrity. The check sum is formed by adding the first 14-ASCII characters (in HEX) and inverting the least significant byte and appending this value as the last 2-characters of the response string.
3) The least significant 54-bits (64-bits total), right justified, is returned by using this command. 54-bits of data is generally sufficient for most card reader applications; however, if the most significant 8-bits are required, use the R40 command to retrieve them before issuing a reset command (R26, M00 sequence, or QXX command).
The "IXX" command is used to select a node (similar to "LXX" command), return the nodes communications address (CA), along with the digital inputs/outputs and, check sum information (16 ASCII-HEX characters). The "IXX" command will disable all modules except the one addressed by "IXX". A capitol "I"(049H) followed by two data characters (0-9,A-F), is sent to the DSCARD unit.
A typical communications string from a host computer and a response from a slave unit would be as follows:
Host: I0F (ASCII/ASCII-HEX)
Response from slave unit: 0F02423231C2F0D
(ASCII-HEX or Packed BCD)
I (048H) Command character
2 (030H) High nibble of communications address (CA)
3 (046H) Low nibble of communications address (CA)
A typical response string is as follows:
DELAY 0 to 1mSEC response delay
0 (030H) Echo high nibble of communications address (CA)
F (046H) Echo low nibble of communications address (CA)
2 (032H) Relay high status nibble (OL), (IA,IB,XA,XB)
4 (034H) Relay low status nibble (OL), (K1-K4)
0 (030H) Output Register Right high status (OR), (N/A)
0 (030H) Output Register Right low status (OR), (N/A)
2 (032H) Input high status nibble (IL), (IN1-IN4)
3 (033H) Input low status nibble (IL), (J11-J14)
2 (032H) Input high status nibble (IR), (IN1-IN4)
3 (033H) Input low status nibble (IR), (J11-J14)
1 (031H) Jumper high status nibble (AL), (X,X,X,J4)
C (043H) Jumper low status nibble (AL), (J3,J2,X,J31)
2 (032H) Site Code high status nibble (AR), (J23,J24,J25,J26)
F (046H) Site Code low status nibble (AR), (J27,J28,J29,J30)
0 (030H) High check sum nibble (HEX)
D (044H) Low check sum nibble (HEX)
Notes:
1) A total of 16 ASCII characters are returned by the
slave for the "IXX" command in approximately 20mS
at 9600,N,8,1.
2) Address and check sum should be checked for data integrity. The check sum is formed by adding the first 14-ASCII characters (in HEX) and inverting the least significant byte and appending this value as the last 2-characters of the response string.
After using the "GXX" command to retrieve data from the DSCARD unit a pointer is set that can be used by the "PXX" command. This pointer is set to R30 (K1 Relay Timer). The "PXX" command is similar in nature to the "MXX" command with the added advantage that data is written to R30 on the first execution of the command without the requirement of setting the pointer first. Also, after writing data to R30 the pointer is incremented to R31 (K2 Relay Timer) and the subsequent "RXX" command will write data to R31 and set the pointer back to R30 again. Always use the "GXX" command prior to using the "PXX" command to insure the pointer is set to a known location. This command can be used as a quick way of loading the timers for Relay K1 and Relay K2. The response string is the same as the "MXX" command.
The "QXX" command can be used to modify the contents of register R51 (control register) if the unit is active (previously selected by a "GXX",LXX", or "IXX" command). No bits are active at this time. By using the "QXX" command the contents of R51 will be changed to "XX." It is anticipated that this command will be used for fast resetting the Card Reader input software after executing a "GXX" command without having to perform the sequence R26, M00. Also additional bits could be used for buffer control (battery backed RAM) and/or enabling or disabling specific functions in the DSCARD unit. The response string (CA)(ID) will be sent to verify that the selected bits have been set/cleared. This is a special command to modify the contents of R51 only and care must be exercised to avoid interference with the any reserved bits. It may be necessary in the future to read before you write when using the "QXX" command.
LXX Locate unit "XX". Return (CA)(ID).
RXX Set register pointers to register "XX". Return
register data and register+1 data (DD)(DD+1).
MXX Modify the contents of a register with data "XX".
Return register data and register+1 data (DD)(DD+1).
GXX Get unit "XX". Return (54-bit card reader data),(CSum), 16-Character string is returned.
PXX Fast setting of K1 and K2 relay timers.
QXX Modify control register (QR). Return (CA)(ID) to acknowledge that the appropriate bits have been set/cleared. This command will modify R51 (ID) before the return string is issued. QR+1 is reserved for informational status only; however, it can be modified by an R3F/MXX sequence.
IXX I/O status at unit XX. CA-ID-OL-OR-IL-IR-AL-AR-CS (16-character string is returned.
Input #1 General Purpose TTL/CMOS Input
Input #2 General Purpose TTL/CMOS Input
Input #3 General Purpose TTL/CMOS Input
Input #4 General Purpose TTL/CMOS Input
Output #1 General Purpose Relay Output
Output #2 General Purpose Relay Output
Output #3 General Purpose Relay Output
Output #4 General Purpose Relay Output
NOTE:
All General Purpose Outputs: K1, K2, K3, K4, XA, and XB
should be controlled by loading the timer register
associated with that output. Writing 00h to the register
location will turn the function off. Writing 0FFh to the
register location will turn the function on permanently.
Any values between 00h and 0FFh will be used as timing
information with a 0.5 sec. resolution (8-bits). By
reading the OL register the status of these outputs can
be determined. The Outputs IA and IB are reserved for
local indications of input changes and card data in
buffer. Do NOT load values into these registers.
Wiegand Card Reader Port Connections:
"A" General Purpose NPN Open Collector Output (30VDC @ 50mA) Controlled by 8-bit timer (0.5 sec. resolution) located at register R35. J32 for 2.2K pull-up to +VA.
"B" General Purpose NPN Open Collector Output (30VDC @ 50mA) Controlled by 8-bit timer (0.5 sec. resolution) located at register R34. J33 for 2.2K pull-up to +VA.
"1" Latched input "1" data from the Wiegand Reader (5VDC max. with onboard pull-up resistor for interface to reader O.C. output).
"0" Latched input "0" data from the Wiegand Reader (5VDC max. with onboard pull-up resistor for interface to reader O.C. output).
+VA Power output to Wiegand Reader, Jumper selectable voltages of 5V, 8V, 10V, 12V and, 15V, with output current to 350mA.
COM Common connection to Wiegand Reader.
RS485 Multi-drop Communications Port Connections:
COM Common connection, low-Z or 100 Ohms to common (J9), this connection is optional or it can be used as a connection to a shield (one end of cable only). In low-Z setting this terminal can be connected to an earth ground to shunt induced voltages/current through the onboard protection network to ground.
"+" Non-inverting RS485 I/O communications terminal.
"-" Inverting RS485 I/O communications terminal.
Note:
This unit was designed for operation from a distributed
power source (24VDC recommended). A typical unit should
use approximately 1-2.5 Watts of power, plus the Wiegand
Card Reader power. Because switching regulators are used
in the design, very little power is wasted. Starting
with a "high" voltage reduces the current in the power
distribution cable and, thus reduces the IR losses in the
cable. Care should be taken to insure that sufficient
wire size is used to reduce voltage drops (IR) in the
power distribution system. These voltage drops will
appear as a common mode error to the communications lines
and should be limited to a maximum of approximately 3.0V
for best results. Independent power can be applied
locally if necessary. "Home Run" wiring or multiple
distribution legs are often desirable. Use twisted pair
wire with 100 Ohms impedance and terminate at both ends
of the network with 120 Ohm resistors (J10, J10A). Do
not over terminate. Biasing of the line is recommended.
Many R.E. Smith converters and/or repeaters have this
biasing function available (jumper selectable). For
"Home Run" distribution (or virtually any distribution
pattern/layout) R.E. Smith offers isolated and non-isolated quad-repeaters that solve many problems
typically encountered in large RS485 multi-drop networks.
Call Ron Smith at (513) 874-4796 for additional information.
Please call us at: 513-874-4796
Contact
Information: R.E. Smith, 10330 Chester Road, Cincinnati, Ohio 45215 513-874-4796 Phone, 513-874-1236 Fax., rs485.com |