Digital Output

The Digital Output Module provides 24 lines of digital output via 3 IO ports.  Each port can set 8 outputs high or low, represented by a number between 0 and 255.

Digital Output

Address lines A0, A1 and !A7 along with M1, IOReq and !WR are used to select the multiplexer 74LS138.  This is capable of 8 ports of switching, although for this board, only 3 are used – the other 5 are broken out to pads for further expansion if required.

The address selection pins from the 74LS138 need links to be soldered.  It is assumed that A0, A1 and A7 will be used, however, if this clashes with other devices, the other address lines are broken out to be used as required.  A0 and A1 provide the addressing when A7 is low, so these 3 ports are nominally 0, 1 and 2 – however, due to the fairly broad addressing scheme, they will respond to any address below 128 that ends with a binary 00, 01 or 10.

For alternative addressing, switching the links to A4 and A5, for example, the ports would respond to addresses of 0b0x00xxxx, 0b0x01xxxx and 0b0x10xxxx.  So, port 15, 31, 37 could be used to avoid clashing with the Digital I/O Module

A 74LS374 flip-flop on each port will read the databus when the Chip Enable pin is pulled high, and output the values on 8 pins.  The output is either 0v or 5v with respect to the ground pins which are next to the output pins.  This value is latched, so when the CE pin is no longer high, the output stays to what it was last set to.

Click image below for schematic in PDF format

Digital Output Schematic

In BASIC the port can be written to with the OUT n,x command which will set the output to number x from 0 to 255 where n is the port number – typically 0, 1 or 2

In assembly language, the mnemonics out (n) , a do the same function

Digital_Output_Tindie

Buy one here

Bill of materials

RC2014 Digital Output PCB 1
40 pin RA header 1
20 pin narrow DIL socket 3
16 pin narrow DIL socket 1
74HCT374 3
74HCT138 1
24 pin header 2