McGraw-Hill - The Robot Builder's Bonanza Episode 2 Part 5

Tham khảo tài liệu 'mcgraw-hill - the robot builder's bonanza episode 2 part 5', kỹ thuật - công nghệ, cơ khí - chế tạo máy phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 476 COMPUTER CONTROL VIA PC PRINTER PORT Inputs Outputs OE I O L L L L H H H X HI-Z Truth table -- 74367 FIGURE The internal configuration of the 74367 chip. Note the two independent ENABLE lines on pins 1 and 15. Y INP x In place of x you put the decimal address of the port you want to read. In the case of the main printer port at starting address 888 the address of the status register is 889. The Y is a variable used to store the return value for future use in the program. For testing you can PRINT the value of Y which shows the decimal equivalent of the binary bit pattern on the screen. Listing is a sample program that displays the current values of the four inputs connected to the Robot Experimenter s Interface. The values are shown as 0 false and -1 true . Bear in mind that the Busy and Online lines are active-low therefore their logic is the reverse of the others. The code in the test program compensates for the active-low condition by reversing the logic in the If expressions. Also note the less-than-straightforward method for determining if pins 15 and 12 are triggered exclusively. These extra If tests are needed because the parallel port most anyway will automatically bring pin 12 HIGH if pin 15 is brought HIGH. Weirdness is also INPUTTING DATA 477 Parallel port connector FIGURE Block diagram for a selectable parallel port using three 74367 ICs to independently control three separate devices. encountered if pin 15 is brought HIGH while trying to read the values of pins 10 and 11. The port reads pins 10 and 11 as LOW even though they may be HIGH on the interface. Again this is the action of pin 15 printer error and for this reason it s usually a good idea to limit its use or to ensure that the values of other inputs are ignored whenever pin 15 is HIGH. LISTING . DIM BaseAddress AS INTEGER StatusPort AS INTEGER DIM DataPort AS INTEGER ControlPort AS INTEGER DIM x AS INTEGER Count AS INTEGER BaseAddress 888 DataPort BaseAddress StatusPort

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
33    73    1    07-06-2024
373    75    1    07-06-2024
13    138    1    07-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.