vb.net barcode scanner programming Binary Demultiplexer Input to Output Device Selection SELECTED OUTPUT 0 1 2 3 4 5 6 7 in Software

Generator QR Code ISO/IEC18004 in Software Binary Demultiplexer Input to Output Device Selection SELECTED OUTPUT 0 1 2 3 4 5 6 7

Binary Demultiplexer Input to Output Device Selection SELECTED OUTPUT 0 1 2 3 4 5 6 7
QR-Code Recognizer In None
Using Barcode Control SDK for Software Control to generate, create, read, scan barcode image in Software applications.
QR Maker In None
Using Barcode generator for Software Control to generate, create Quick Response Code image in Software applications.
INPUT CONTROL 000 001 010 011 100 101 110 111
Decoding QR-Code In None
Using Barcode recognizer for Software Control to read, scan read, scan image in Software applications.
Quick Response Code Drawer In Visual C#.NET
Using Barcode printer for .NET Control to generate, create QR image in .NET framework applications.
14.9 EXPANDING AVAILABLE I/O LINES
Making QR Code JIS X 0510 In Visual Studio .NET
Using Barcode creator for ASP.NET Control to generate, create QR-Code image in ASP.NET applications.
Creating QR Code In .NET Framework
Using Barcode generator for .NET framework Control to generate, create QR-Code image in .NET applications.
TABLE 14-2 Using the 74595 Serial-In/Parallel-Out Shift Register to Make Specific Outputs Active SERIAL WORD IN 00000001 00001001 01000110 SELECTED OUTPUT(s) 0 0 and 3 1, 2, and 6
QR Code Creator In VB.NET
Using Barcode creator for .NET framework Control to generate, create QR Code image in .NET framework applications.
Paint Bar Code In None
Using Barcode encoder for Software Control to generate, create bar code image in Software applications.
If this seems like a lot of effort to expend just to turn three I/O lines into eight, many microcontrollers (and some computers) used for robotics include a shiftout command that does all the work for you. This is the case, for example, with the BASIC Stamp 2 (but not the BASIC Stamp I), the BASICX-24, and several others. To use the shiftout command, you indicate the data you want to send and the I/O pins of the microcontroller that are connected to the 74595. You then send a short pulse to the latch line, and you re done! A key benefit of the 74595 is that you can cascade them to expand the I/O options even more. There are still other ways to expand I/O lines, including serial peripheral interface (SPI), the Dallas 1-Wire protocol, and the 82C55. Several of the more commonly used systems were introduced earlier in this chapter. If your computer or microcontroller supports one or more of these systems, you may wish to investigate using these systems in case you find you are running out of I/O lines for your robot.
EAN / UCC - 13 Generation In None
Using Barcode creation for Software Control to generate, create EAN 128 image in Software applications.
ECC200 Creation In None
Using Barcode printer for Software Control to generate, create Data Matrix 2d barcode image in Software applications.
Latch All Clear All Serial Clock Serial Data In
ANSI/AIM Code 128 Generation In None
Using Barcode generator for Software Control to generate, create Code 128 Code Set B image in Software applications.
EAN13 Encoder In None
Using Barcode creation for Software Control to generate, create EAN / UCC - 13 image in Software applications.
74595 Serial-In/Parallel-Out Shift Register 15 13 A 1 /G B 12 C 2 3 D 10 4 E 5 F 6 G 11 7 H 14
Making GTIN - 14 In None
Using Barcode maker for Software Control to generate, create ITF-14 image in Software applications.
Printing GS1-128 In Java
Using Barcode printer for Android Control to generate, create EAN / UCC - 14 image in Android applications.
Parallel Outputs
DataMatrix Drawer In Java
Using Barcode printer for Java Control to generate, create DataMatrix image in Java applications.
Print European Article Number 13 In .NET Framework
Using Barcode creation for Reporting Service Control to generate, create UPC - 13 image in Reporting Service applications.
To Additional 74595s, if any
Encode UCC-128 In None
Using Barcode drawer for Font Control to generate, create UCC.EAN - 128 image in Font applications.
Bar Code Encoder In Java
Using Barcode generator for BIRT reports Control to generate, create bar code image in BIRT applications.
FIGURE 14-23 The 74595 serialin/parallel-out (SIPO) shift register lets you expand the data lines and select multiple lines at the same time.
European Article Number 13 Generator In None
Using Barcode maker for Online Control to generate, create European Article Number 13 image in Online applications.
Encode Bar Code In Visual Studio .NET
Using Barcode drawer for Reporting Service Control to generate, create barcode image in Reporting Service applications.
COMPUTER PERIPHERALS
14.10 Bitwise Port Programming
Controlling a robot typically involves manipulating one or more input/output lines (bits) on a port attached to a computer or built into a microcontroller. A common layout for an I/O port is eight bits, comprising eight individual connection pins. This is the same general layout as the parallel port found on IBM PC-compatible computers, which provides eight data lines for sending characters to a printer or other device (along with a few additional input and output lines used for control and status). The design of the typical microcontroller or computer, as well as the usual program tools for it, do not make it easy to directly manipulate the individual bits of a port. Rather, you must manipulate the whole port all at once and, in doing so, hopefully alter only the desired bits. The alternative is to send a whole value from 0 to 255 for an eight-bit port, and 0 to 15 for a four-bit port to the port at the same time. This value corresponds to the bits you want to control. For example, given an eight-bit port, the number 54 in binary is 00110110. Fortunately, with a little bit of programming it s not hard to convert numeric values into their corresponding bits, and vice versa. Each programming language provides a different mechanism for these procedures, and what follows are some simple approaches using PBASIC. Other languages offer more robust bit-handling operators that you can take advantage of. The sample code that follows is meant more to teach you the fundamentals than to be applied directly with a robot. Take the ideas and adapt them to your particular case.
14.10.1 MASKING VALUES BY ANDing
It is not uncommon to have to manipulate the individual bits of a computer or microcontroller port. Quite often, you will find that the bits are not conveniently placed within bytes for easy manipulation. When working with PBASIC (and other microcontroller programming languages), individual bits can be easily manipulated, regardless of which line it comes in on. For example, declaring an input line on pin12 of a BS2 is accomplished by using the statement
SwitchIn var INS.bit12
and can be manipulated like any other bit in PBASIC
A = SwitchIn & 1
Quite often, however, it is not possible or practical to address each individual bit. Rather, you must read in an entire register and then mask off the bits that you would like to access as well as shift them down so they are zero-based for easy manipulation. In these cases, you will have to AND the bits with a number of set bits and then shift them up or down depending on the requirements of the application. In the following example program, three bits are input to the BS2, they are incremented by 1 and then output on three different lines:
Copyright © OnBarcode.com . All rights reserved.