background image

Copyright © Parallax Inc.

Digital I/O Board Kit (#27113)

v1.0  2/19/2010  Page 10 of 13

Connecting and Testing (Serial Interface)

The serial interface (2x5 header) allows you to reduce the number of pins required to control the Digital 
I/O Board by serially shifting data  to/from the board over a synchronous serial interface.  Whereas full 

control requires 16 I/O pins using the parallel interface, the serial interface can provide full control with 
as few as 4 I/O pins.

The  pins  labeled  DATA_RLY,  SCLK_RLY,  LAT_RLY  and  /OE_RLY  are  connected  to  a  74HC595  serial  to 
parallel shift register.  These pins have the following functions: DATA_RLY is serial data going out to the 

shift register.  This data is sent MSB first (8 bits) synchronously with the SCLK_RLY pin.  On the BASIC 
Stamp  this  can  be  achieved  with  the  SHIFTOUT  command.  Once  the  data  has  been  shifted  out  the 

LAT_RLY pin must be pulsed to latch the data onto the outputs.  /OE_RLY must be LOW in order for the 
74HC595 to drive the relays.  This can be tied to VSS or controlled via an I/O pin.

The pins labeled DIN, SCLK_IN and LOAD_IN are connected to a 74HC165 parallel to serial shift register.  
These pins have the following functions: DIN is serial data from the shift register sent synchronously with 

a clock pulse on SCLK_IN generated by the host microcontroller.  On the BASIC Stamp this is achieved 
with the SHIFTIN command.  Before data is shifted in the current contents of the inputs must be loaded. 
This is accomplished by pulsing the LOAD_IN line from HIGH to LOW and then back to HIGH.  This line 

must remain HIGH during shift operations and must only go LOW during a LOAD operation.

The  DIN  line  has  a  1K  resistor  in  series  to  allow  sharing  of  the  74HC165  data  line  with  the  74HC595 
DATA_RLY line.  By connecting these lines together and also connecting SCLK_RLY to SCLK_IN you can 

reduce the number of I/O pins required by your microcontroller down to four (4).  In this configuration 
LAT_RLY and LOAD_IN must have their own I/O pins and /OE_RLY can be connected to VSS.  This circuit 
provides  a  half-duplex  system  where  you  can  access  one  shift  register  at  a  time.    For  full  duplex 

operation the DIN and DATA_RLY lines must be separate and for independent operation the SCLK_RLY 
and SCLK_IN must also be separate.

Note: Do not use the parallel and serial circuits at the same time.  Use only one type of interface.

Communication Protocol

The serial protocol (synchronous serial) used by the 74HC595 and 74HC165 is defined in more detail in 

the datasheets for each device.  BASIC Stamp users can also download the free PDF and example code 
for the Stamp Works kit and review experiments 23 through 25 which deal with these shift registers both 

independently and together.

Mode Jumper (JP1)

The 3-pin jumper just below the 74HC165 determines whether the data shifted in from the shift register 
is inverted or not.  Because the optocouplers inherently invert the data, when reading inactive inputs you 

get  all  ones  instead  zeros  which  isn’t  very  intuitive.    This  jumper  allows  you  to  invert  the  data  to 
normalize the output and make it more intuitive.  In the 1-2 position data is inverted and when an input 
is active is will make its output go HIGH.  With JP1 in the 2-3 position data is not inverted and when an 

input is active you will get a LOW.

Note:  The  Parallel  interface  is  unaffected  by  this  jumper.    Therefore  the  parallel  signals  from  the 
74HC165 are always inverted

Summary of Contents for 27113

Page 1: ...input voltages by changing a couple of components Features Mechanical or Solid State Relay output Configurable Input Voltage range Serial or parallel interface to inputs outputs LED indication of power and input output status AppMod compatible connection for Board of Education Key Specifications Power requirements 12VDC 1A for relay power and 3 3 5VDC for logic power Communication Parallel or Sync...

Page 2: ...2 01040 U1 U8 IC 4N25 Optoisolator DIP 6 8 500 00005 U9 IC ULN2803 Darlington Array DIP 18 1 602 00009 U10 IC 74HC595 Shift Register DIP 16 1 602 00010 U11 IC 74HC165 Shift Register DIP 16 1 452 00052 S1 S8 Socket IC DIP 16 8 452 00053 S9 Socket IC DIP 18 1 452 00054 S10 S11 Socket IC DIP 16 2 452 00012 J1 J17 2 Position Terminal Block 21 452 00007 J18 2 1mm DC Barrel Jack 1 452 00049 J19 2x10 20 ...

Page 3: ...erprints Set your board in a position to start installing and soldering groups of components In the following steps the component locations will be highlighted with a yellow square circle Step 2 Install Resistor Network RN1 into the location shown to the right The notch should be toward the top Solder this device in carefully avoiding overheating the component as will all components from this poin...

Page 4: ...e right The components stand on end in the right hole with the stripe facing up as shown in the inset and the other lead bent over into the left hole This is vertical mounting of an axial component Step 6 If you will be using input voltages outside the range of 15 30VDC then please skip this step until you read the section on setting the input voltage range Install the 1 5K resistors R25 R32 into ...

Page 5: ...s shown at right Color code is Red Red Brown Gold Inset shows details Step 8 Install the 10K resistors R17 R24 and R43 into the positions shown at right Color code is Brown Black Orange Gold Inset shows details Step 9 Install the 1K resistors R1 R8 R33 and R42 into the positions shown at right Color code is Brown Black Red Gold Inset shows details ...

Page 6: ...Gold Install these in the same manner as previous resistors Step 11 Install the headers resistors J19 J20 JP1 and JP2 into the positions shown at right Inset shows details Step 12 Install the Terminal Blocks J1 J17 21 pcs total into the positions shown at right Note 12 Terminal Blocks must be snapped together for the relay connections These slide together vertically to create one long strip ...

Page 7: ...Step 14 Install Diode D25 into the position shown at right With the diode mounted in the right side with square the stripe should be on the bottom The other lead should bend over into the left hole Inset is from other side Step 15 Install Capacitors C1 C4 into their respective positions as shown at right Observe proper polarity on C4 C1 C3 are non polarized Inset shows details ...

Page 8: ...le and the 74HC165 U11 is on the bottom Step 17 If you have not already done so you may now install the shorting blocks shunts The details for these are covered later in this documentation Inset shows detail for JP1 set for inverted serial data Step 18 Install the relays you have chosen for your application in any position Relays only install in one direction and you cannot mount both types in the...

Page 9: ... the need for an additional power supply If your microcontroller s board has an on board voltage regulator you can obtain V from the Digital I O Board and then send your regulated output back to the VDD pin V will be at the voltage of the relay supply typically 12VDC Connecting and Testing Parallel Interface Using the parallel interface 2x10 header controlling relays is as simple as making a pin H...

Page 10: ...o LOW during a LOAD operation The DIN line has a 1K resistor in series to allow sharing of the 74HC165 data line with the 74HC595 DATA_RLY line By connecting these lines together and also connecting SCLK_RLY to SCLK_IN you can reduce the number of I O pins required by your microcontroller down to four 4 In this configuration LAT_RLY and LOAD_IN must have their own I O pins and OE_RLY can be connec...

Page 11: ...the input using a 1K resistor VINMAX 1000 0 02 1 2 21 2V Sensitivity Because of the way the input LEDs are driven on the output they will indicate voltage on an input even when it is not sufficient to trigger and output Voltage as low as 2V will cause the LED to start to glow however the output won t trigger until the minimum current has been reached This provides some safety in the sense that you...

Page 12: ...es AppMod connector Pin Name Function 1 V Relay Power Can be disconnected via JP2 2 VDD Logic Power 3 RLY1 Relay 1 Control Line 4 RLY2 Relay 2 Control Line 5 RLY3 Relay 3 Control Line 6 RLY4 Relay 4 Control Line 7 RLY5 Relay 5 Control Line 8 RLY6 Relay 6 Control Line 9 RLY7 Relay 7 Control Line 10 RLY8 Relay 8 Control Line 11 IN_1 Input 1 Signal 12 IN_2 Input 2 Signal 13 IN_3 Input 3 Signal 14 IN_...

Page 13: ...ata Out to 74HC595 input from host microcontroller 5 SCLK_IN Synchronous Serial Clock input from host microcontroller 6 SCLK_RLY Synchronous Serial Clock input from host microcontroller 7 LOAD_IN Load Inputs input from host microcontroller 8 LAT_RLY Latch Relay Output input from host microcontroller 9 VSS Ground 10 OE_RLY Relay Output Enable input from host microcontroller Module Dimensions Module...

Page 14: ...Mouser Electronics Authorized Distributor Click to View Pricing Inventory Delivery Lifecycle Information Parallax 27113 ...

Reviews: