NCD Input Scanner RS-232 User manual

Copyright © 1996, 1997, 1998, 1999, 2000, National Control Devices
8SC RS-232
Input Scanner
Users Guide
Revision 1.0
B y R y a n S h e l d o n

Disclaimer:
NCD will not be responsible for any personal injury or damage to computers or other electronic
devices caused in conjunction with the use of NCD products. The user assumes full responsibility
of any and all damage that may result in combination with NCD products, services, and literature.
NCD takes EVERY known precaution to ensure documentation and examples are accurate. Return
this device within 30 days of purchase for a full refund if you do not agree with these terms and
conditions. Operation or assembly of any products sold by NCD signifies your agreement with
these terms.
Special Thanks:
I would like to thank Kima Dirks for the many hours she has spent editing and refining all of my written literature.
I would also like to thankTom Maier for his dedication to this project. Without his help our products would not be
possible. --Ryan Sheldon
Introduction and Overview:
Thank you for purchasing the NCD-8SC. The 8SC is one of the most unique devices available to computer users
wanting to obtain data via RS-232 communications. The 8SC uses the NCD-110C chip (based on the PIC16C54)
to read each of 8 inputs and send the on/off status to your computer via RS-232 transmission.
The user has complete software control of when the inputs are to be scanned and transmitted. Acting like a
networkable parallel-to-serial encoder, the 8SC when combined with 15 more 8SC devices can obtain 128 bits of
input from a single serial port. The 8SC is fully RS-232 networkable with up to 15 other NCD devices, allowing
the user to control devices based on the input received. Use the 8SC in conjunction with the NCD-LCD display
driver to send messages based on received data. Combine the 8SC with theAVS8 audio/video switcher to switch
video signals based on inputs from doors, fire alarms, and other security devices interfaced to the 8SC.
A single 8SC is capable of interfacing to just about anything that can produce an on/off signal as well as CMOS
and TTL logic circuits. Other features of the 8SC include jumper selectable baud rates for 1200 or 9600 baud
operation. The open-collector output allows the user to directly connect outputs together without “OR”ing data.
Because the 8SC uses open-collector RS-232 transmission, the NCD-RSB will be required for interfacing the 8SC
to your computer.
What You Will Need:
To assemble the 8SC, you will need the following items: Computer with 3.5" drive (Amiga, PC, or Macintosh),
serial cable, RSB serial booster, and an input source such as a switch. A wrist strap should be used for static
grounding during installation of all semiconductors. Macintosh users will need the TR32 to convert the RS-232
outputs of the RSB to the true RS-232 signals required by Macintosh systems.

Helpful hint.
Could cause problems later under
normal operation.
Fatal mistake.
The X tells about common assem-
bly and operation errors as well as
other things to watch out for.
The check is a guide to help the user
with assembly and operation. Use
them to prevent mistakes.
Interfacing to the Serial Port of Your Computer
The NCD-8SC requires the NCD-RSB for interfacing to computers. The RSB is required because it is capable of converting
an open-collector RS-232 transmission to a standard RS-232 signal that can be used by your computer. All NCD devices that
transmit data back to a computer use an open-collector transmission. The open-collector system is important because it
allows many devices to send data to your computer without using extensive logic circuits to "OR" together incoming data. If
you are not familiar with "OR"ing data, you should know that the process can be complicated, especially for RS-232 trans-
missions. The open-collector system allows us to use 3 wires to connect 16 devices. One wire is a ground that must be shared
among all devices on the serial port. Another wire, the transmit (Tx) line, sends data to NCD devices. Some NCD devices
send data back to the computer using a third line (receive or RX). Since the 8SC transmits data back to the computer, the
receive line must be connected to read the transmissions.
See the NCD-RSB manual for interfacing the 8SC to your computer. This manual will assume you have an RSB connected
to your system.
WARNING:
NEVER ASSEMBLE ANY NCD DEVICE WITH ORGANIC OR
ACID CORE SOLDER. USING THESE TYPES OF SOLDER WILL
VOID ALL NCD WARRANTIES.

Input 1
Input 2
Input 3
Input 4
Input 5
Input 6
Input 7
Input 8
Ground
When resistor network RN2 is installed, all inputs are pulled high
(on) and can be turned off by connecting a wire to the ground line.
J1-J4 - Address Select. These jumpers de-
fine the device number of the 8SC, allow-
ing 16 devices to coexist on a single serial
line. See"NCD-110Addressing"for details.
J6 - Reserved for future expansion.
Jumper between the left two posts.
J5 - Baud Rate Select. In-
stall this jumper for 1200
baud operation; remove for
9600 baud operation.
To NCD-RSB Input
To NCD-RSB Output
To NCD-RSB Ground
To V+ (9 to 12 Volts)
To Power Supply Ground
Make sure you NEVER connect the power supply to this device backwards. Doing so will
destroy the 78L05 and possibly the PIC. Remember, minimal operation voltage is around 7
volts. Also, verify part orientation before proceeding. Watch for shorted solder connec-
tions. Please verify component placement before you continue.
When data is received by the computer from the 8SC, each pin that is connected to ground will return a unique
number. Example:
When no inputs are tied to ground, RN2 pulls all inputs high. This returns a 255.
When input 1 is the only line connected to ground, a 254 will be returned (255-1, 1 is the weight of input 1).
When input 4 is the only line connected to ground, a 247 will be returned (255-8, 8 is the weight of input 4).
When input 8 is the only line connected to ground, a 127 will be returned (255-128, 128 is the weight of input 8).
When inputs 1 and 4 are connected to ground, a 246 will be returned (1+8 weighted total is 9, so 255-9).
Input 1 is weighted by 1.
Input 2 is weighted by 2.
Input 3 is weighted by 4.
Input 4 is weighted by 8.
Input 5 is weighted by 16.
Input 6 is weighted by 32.
Input 7 is weighted by 64.
Input 8 is weighted by 128.
See the included program "8SCTESTB.BAS" for an example
of how to software decode the incoming number to the original
lines that were turned on or off. Also, many programs have
been included to decode the 8SC inputs to several desirable
output types. The method shown is the default method.

J6
Inputs D0-D7 are pulled up via RN2 4.7K resistor network.
Data Inputs
RS-232
Ground
RS-232
Input
Open Collector
RS-232 Output
J4
J3
J2
J1
+5
J5
CR 1
23
CR1 RN1
RN1
+5
V+ +5
78L05
V+ C1C1
D0
D1
D2
D3
D4
D5
A
B
C
G
W
Y
D6
D7
74LS251
4
3
2
1
15
14
11
10
9
7
6
5
13
12
U4
U1
U2 R2
R3
D1
Q1
R4 R5
+5 +5
R1
Q2
Q1
Q0
DatIn
STROBE
ASCII-OUT
AD0
AD1
AD2
AD3
RS-232
BAUD
[110C]
8
7
6
9
18
1
10
11
12
13
2
1715
16
Care should be taken when interfacing to the inputs of this device. Remember, inputs are pulled
high and are activated when they are connected to ground.
Debugging:
Basic checks: Verify all chips are located and oriented in the proper location. Also, check to make sure all pins
are in the socket. Verify all parts are installed according to the directions and that you have a modem cable
attached. Also verify there are no shorted solder connections on the 8SC board. We will also assume the 8SC
board is oriented in the direction shown on the previous page.
Problem: Data is Not (or is Incorrectly) Received by the Computer:
Try: Make sure jumper J6 is installed between the left two posts.
Make sure RS-232 lines are not reversed.
Make sure jumpers J1-J4 are set for the same address set in software. See "NCD-110C Addressing" for details.
Make sure baud rate (J5) matches baud rate in your software.
Make sure the correct "COM" port is used in software.
Make sure the RSB is properly connected and powered.
Make sure resistor R1 is properly installed.
Make sure diode D1 is properly installed.
Make sure Q1 is properly installed.
Make sure 78L05 is properly installed.

The NCD-110C Interface Processor and How It Works:
The NCD-110C is a PIC-based computer that has been programmed to listen to incoming data on the serial port and to respond ONLY if
its name is called. To understand how it works, we will examine the processes of the 110C as they were written into the chip.
The NCD-110C carefully listens to incoming data on an RS-232 serial port. It breaks each byte that is received into two 4-bit sections.
The first 4-bit section is interpreted as the “Address” of the NCD-110C; the last 4-bit section is interpreted as the mode that is to be used
for obtaining data.
For example, if we send the character 241 to the NCD-110C, the NCD-110C will first convert the character into its binary equivalent of
11110001. Next, it will read the settings of jumpers located on pins 10 to 13. If the jumpers on the NCD-110C are set to 1111 (+5 volts
for all address pins), the mode will be interpreted as 0001. This will cause the 8SC to scan pin 2 of the inputs. (The decimal equivalent
of 0001 is 1, referring to input pin 2.)
The user may select up to nine different modes of operation. Modes 0 to 7 allow the user to grab the status of an individual pin. Mode 8
allows the user to grab the status of all eight pins. Refer to the program below to understand how modes and device number can provide
the user with additional flexibility. This is a partial program example--reference the floppy disk for functional programs.
DEVICE=4 :REM Set the device number. Valid ranges are from 0 to 15.
MODE=8 :REM 15 valid modes.
REM 0-7 grabs status of individual pins.
REM 8-15 grabs status for all pins.
DEV=DEVICE*16 :REM Compute the device number.
PRINT #1, CHR$(DEV+MODE); :REM Send a request to SC8.
PRINT ASC(INPUT$(1, 1)) :REM Read and display the reply from the 8SC.
NCD-110C Addressing:
Addressing the NCD-110C is very easy. On all NCD devices, we use jumpers to set the address. These jumpers are always located at pins
10 to 13 on the PIC. We have compiled a table that indicates the possible jumper settings:
Binary Address J1/Pin 10 J2/Pin 11 J3/Pin 12 J4/Pin 13 Range
0000 0 Removed Removed Removed Removed 0-15
0001 1 Installed Removed Removed Removed 16-31
0010 2 Removed Installed Removed Removed 32-47
0011 3 Installed Installed Removed Removed 48-63
0100 4 Removed Removed Installed Removed 64-79
0101 5 Installed Removed Installed Removed 80-95
0110 6 Removed Installed Installed Removed 96-111
0111 7 Installed Installed Installed Removed 112-127
1000 8 Removed Removed Removed Installed 128-143
1001 9 Installed Removed Removed Installed 144-159
1010 10 Removed Installed Removed Installed 160-175
1011 11 Installed Installed Removed Installed 176-191
1100 12 Removed Removed Installed Installed 192-207
1101 13 Installed Removed Installed Installed 208-223
1110 14 Removed Installed Installed Installed 224-239
1111 15 Installed Installed Installed Installed 240-255
Note the Range column--this is a quick way to determine what characters will cause the NCD-110 to respond. For example, on the
second row the range is 16 to 31. When the jumpers are set as indicated by the second row in the table, the NCD-110 will respond to
CHR$() commands from 16 to 31.
74LS251 Input Multiplexer
The NCD-110C is interfaced to the 74LS251. The 251 is a general purpose input multiplexer. It requires 3 bits of data to tell it which of
the eight inputs to look at. The 110C handles pointing operations, minimizing user programming. When a mode 0 to 7 command is
received, the NCD-110C points to the desired input. When a mode 8 to 15 command is received, the 110C scans all eight inputs and
transmits a byte representative of the current input status of all eight inputs.

We welcome suggestions and recommendations. Please tell us about
any errors or omissions you may find in this manual. All recommen-
dations become the property of NCD Inc.
The 8SC Input Scanner is property of
National Control Devices.
Copyright © 1996, 1997, 1998, 1999, 2000, All Rights Reserved.
Amiga is a registered trademark of Commodore Business Machines.
IBM is a registered trademark of International Business Machines.
Macintosh is a registered trademark of Apple Computer.
All Rights Reserved.
National Control Devices
P.O. Box 455
Osceola, MO 64776
Phone: (417) 646-5644
FAX: (417) 646-8302
www.controlanything.com
www.controleverything.com
E-mail: ncdry[email protected]
This manual suits for next models
1
Table of contents