DataSheet39.com

What is AN-203?

This electronic component, produced by the manufacturer "ZBasic", performs the same function as "I/O Expansion Techniques".


AN-203 Datasheet PDF - ZBasic

Part Number AN-203
Description I/O Expansion Techniques
Manufacturers ZBasic 
Logo ZBasic Logo 


There is a preview and AN-203 download ( pdf file ) link at the bottom of this page.





Total 8 Pages



Preview 1 page

No Preview Available ! AN-203 datasheet, circuit

ZBasic
AN-203 I/O Expansion Techniques
Application Note
Introduction
On more complex projects it is often the case that more I/O lines are needed than the number that are available on
the chosen processor. In this situation, you might first try to redesign the application to require fewer I/O lines. For
example, you may be able to use a given output for multiple purposes. If you still need additional I/O lines, there
are several techniques that you might employ, separately or in combination, to solve the problem.
Although the examples given in this application note are based on the ZX-24, the principles can be equally well
applied to the other ZX processors.
Using a Multiplexer for Multiple Inputs
If your application has a number of signals that only need to be connected to the processor when it is time to read
the input, you may benefit from utilizing an external digital multiplexer. These devices allow 1 of N input signals to
be selected for passing on to the processor, where N is a power of two. Examples of such a device are the
74HC151 (single 8 to 1), the 74HC153 (dual 4 to 1) and the 74HC157 (quad 2 to 1). Figure 1 shows how a ‘151
can be connected to a ZX-24.
Figure 1 Multiplexing 8 Digital Inputs
In this example, using the multiplexer allows up to eight inputs to be read while only using 4 I/O lines of the
processor. The I/O pins 18-20 are used to select the desired input and pin 17 is used to read the state of the
selected input.
An example of the code required to read one of the 8 inputs is given below. Note that the example code may not
work well in a multi-tasking environment depending on how the ports are used. The reason is because the first line
in the GetInput() function reads the value of Register.PortA, modifies it and writes it back. In a multi-tasking
environment, it is possible for a task switch to occur between the time when the value of Register.PortA is read and
when it is written back. If another task gets control between those actions and that task modifies the value of
Register.PortA, the value written back when the Main() task resumes will be incorrect. This problem can be
avoided by either using a semaphore to control access to Register.PortA or by locking the Main() task before the
operation and unlocking it afterward. It should be pointed out, however, that if a task is awaiting an external
Copyright © 2005 Elba Corp.
Rev. A
Published November 2005
Free Datasheet http://www.datasheet4u.net/

line_dark_gray
AN-203 equivalent
AN-203 I/O Expansion Techniques
Depending on the requirements of the application, a shift register with no output latch (e.g. the 74HC164) might
also be used. The difference is that as the data is being shifted out the outputs of this type of shift register will
“ripple” to their final state. If the data is being presented in parallel to an external device like an LCD this difference
may be insignificant since those devices usually have there own “strobe” input to direct them to accept the data.
Using a Shift Register for Multiple Inputs
A shift register can also be used to free up some I/O lines by sampling input data in parallel and then shifting it in
serially. An example circuit is shown in Figure 4. The shift register shown has an input to control the loading of
input data into the internal register (pin 1, /PL). To read the 8 data inputs you set the /PL input low and then high
again. The logic level that was present at the P7 input of the shift register when the load signal goes high appears
immediately on the Q7 output of the shift register. Then, on each subsequent rising edge of the clock input (pin 1,
CP1 or pin 2, CP2) the logic level of the next lower input will appear at the Q7 output. The DS input (pin 10) is the
data that is shifted into the internal register as it is clocked. If the Q7 output is connected to DS (instead of
grounding DS as is shown), the register will maintain its data value through a cycle of 8 clock signals. This
capability may or may not be useful in your application.
Figure 4: Using a Shift Register for Inputs
The sample code below shows how to read data in from the external shift register. Note, particularly, that the call to
ShiftInEx() uses a ‘flags’ value that causes the data input to be sampled before the clock signal is generated. This
is necessary since the shift register is already presenting the MSB of the data before the first clock transition
occurs.
Private Const dataPin as Byte = 20
Private Const clockPin as Byte = 19
Private Const latchPin as Byte = 19
Dim b as Byte
Sub Main()
' initialize the I/O pins
Call PutPin(dataPin, zxInputTriState)
Call PutPin(clockPin, zxOutputLow)
Call PutPin(latchPin, zxOutputHigh)
' read data from the shift register
b = GetInput()
End Sub
Copyright © 2005 Elba Corp.
-5-
Published November 2005
Free Datasheet http://www.datasheet4u.net/


line_dark_gray

Preview 5 Page


Part Details

On this page, you can learn information such as the schematic, equivalent, pinout, replacement, circuit, and manual for AN-203 electronic component.


Information Total 8 Pages
Link URL [ Copy URL to Clipboard ]
Download [ AN-203.PDF Datasheet ]

Share Link :

Electronic Components Distributor


An electronic components distributor is a company that sources, stocks, and sells electronic components to manufacturers, engineers, and hobbyists.


SparkFun Electronics Allied Electronics DigiKey Electronics Arrow Electronics
Mouser Electronics Adafruit Newark Chip One Stop


Featured Datasheets

Part NumberDescriptionMFRS
AN-203The function is I/O Expansion Techniques. ZBasicZBasic
AN-203The function is Using the AD2S80A Series Resolver-to-Digital Converters As a Controller Transformer. Analog DevicesAnalog Devices

Semiconductors commonly used in industry:

1N4148   |   BAW56   |   1N5400   |   NE555   |  

LM324   |   BC327   |   IRF840  |   2N3904   |  



Quick jump to:

AN-2     1N4     2N2     2SA     2SC     74H     BC     HCF     IRF     KA    

LA     LM     MC     NE     ST     STK     TDA     TL     UA    



Privacy Policy   |    Contact Us     |    New    |    Search