Previous

Next

Bottom

Contents

Glossary

Index

 

Persistor CF1 User's Manual

Multiple Parallel I/O

July 1998

Revision 1.01

 Persistor Instruments Inc.
© 1998 All rights reserved.
Single Chip 3.3V Octal Input  

Hardware: 

This circuit makes use of one 74LVT245 to provide 8 digital inputs at 3.3 volt logic levels. These inputs are also 5 volt tolerant and can be driven by 5 volt logic. On the underside of your prototyping board you will find a set of SOIC pads that this IC will fit into if you make sure to order the 300 mil wide SOIC package. The DigiKey part number for this part is: PI74LPT245AS-ND. The circuit diagram follows with a brief explanation below:

 

As you can see this is about as simple as it gets. It involves eight connections to the data bus and one chip select line. We have used /CS8 in this example but you could just as easily use /CS10. One question that may arise in your mind is, "Why D8-15 and not D0-7?" The answer to this relates to how the 68338 aligns 8 bit values internally. When you pass an 8 bit value, the 68338 always aligns it in the MSB of its internal 16 bit words. You may extrapolate this design to allow 16 inputs with only one additional part, a second 74LPT245. You would wire it in exactly the same manner but to DATA0-7 instead of DATA8-15. You would use the same chip select. But that's another story...

Application Level Interface

First and foremost you must tell the CF1 where it can find this newly added peripheral. We have made a function called InputExpandInit() to do just this:

void InputExpandInit (void)
{
	CS8Setup(0x00100000, 0x00000001, false);
	CS8Options(true, false, false, 0);
}

As is probably evident, this function sets up the chip selects for the new inputs which allows their levels to be transferred to the bus when their memory location is read. Writing to this memory location will cause a bus error. You can always read the input values by reading their memory location and masking to read the correct bit, but we have also provided a function to read each input individually:

bool ExpIORead(short whichLine)
{
	ushort io;
	bool onOff;
	
	io = *(vushort *)0x00100000;
	onOff = (bool)((io >> (8 + whichLine)) & 0x0001)
	
	return onOff;
}

This should put you well on your way to adding more inputs, also, as you may recall we offer more advanced application notes for adding both inputs and outputs as well as configureable Input/Outputs.

Back to Parallel I/O Expansion Application Note

Previous

Next

Top

Contents

Glossary

Index

Tel: 508-759-6434

Fax: 508-759-6436

Copyright (C) 1998 Persistor Instruments Inc. - All Rights Reserved