B&B Electronics Parallel Port Input/Output Converter PPIO User Manual

Manual is about: B&B Electronics Parallel Port Input/Output Converter User Manual

Summary of Parallel Port Input/Output Converter PPIO

  • Page 1

    .Ppio2899 manual cover page b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 parallel port input/output converter model ppio document no. Ppio2899 b&b electronics mfg. Co. Inc. 707 dayton road -- p.O. Box 1040 -- ottawa, il 61350 usa pho...

  • Page 2: Table of Contents

    Ppio2899 manual table of contents i b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 table of contents introduction .............................................................................1 p acking l ist ..............................

  • Page 3: Ntroduction

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 1 i ntroduction the ppio allows you to connect your ibm pc (or clone) computer to the outside world using the computer’s parallel port. The eight i/o points can be used as ...

  • Page 4: Packing List

    2 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 packing list examine the shipping carton and contents for physical damage. If there is damage, contact b&b electronics immediately. The following items should be in the s...

  • Page 5: Pc P

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 3 pc p arallel p ort d escription to understand how the ppio can be controlled you must first understand how the parallel port works inside the computer. The parallel port ...

  • Page 6

    4 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 used to read the status of the port. The ppio does not need to use this port as an input port. Again, referring to table 1, if you input the data on port 0379h, then what...

  • Page 7

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 5 table 1 note 1: x means no connection to any db-25 pin. Note 2: bit 4 of 37ah as an output is used to control the interrupt irq7. When this bit is high, irq7 is enabled a...

  • Page 8

    6 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 there are three port addresses that are normally used on a pc for parallel ports: 3bch, 378h, and 278h. When your pc is reset or turned on these three addresses are scann...

  • Page 9: Ppio D

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 7 ppio d escription & c onnection the ppio makes use of the eight output pins (pins 2 through 9) at address 378h to drive its eight outputs. It uses the upper four bits of ...

  • Page 10

    8 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 figure 1.

  • Page 11: Ontrolling The

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 9 c ontrolling the ppio u sing gwbasic refer to the fragment of gwbasic code in figure 2 to see how to input the bits and make one 8-bit word. 100 out &h37a,&h04: rem this ...

  • Page 12

    10 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 table 2 the big advantage of using the anding and oring as shown in table 2 is that it makes each ppio pin independent. If you have, for instance, ppio bit 2 on and all ...

  • Page 13

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 11 when you input the 8-bit word using lines 300-460 of figure 2, note that you also get the status of the outputs. If some i/o bits are used by the ppio as outputs the sta...

  • Page 14: Ontrolling The

    12 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 c ontrolling the ppio u sing p ascal the ppio disk includes two source code files as an example of using the ppio with the pascal programming language. Ppio.Pas is the m...

  • Page 15

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 13 procedure set_irq_off; begin port[control_address] := $04;{write 4 to disable irq} end; {set_irq_off} the function, in_byte, returns the value of the variable, input_byt...

  • Page 16: Mask Value

    14 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 the parallel port’s status register stores the upper nibble (four bits) of the input line status. Since the smallest value that can be read from the port is a byte, some...

  • Page 17

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 15 notice that in the binary representation of the mask value, line zero’s mask has bit number zero set, and line one’s mask has bit number one set, etc. So, instead of ret...

  • Page 18

    16 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 as with the function, in_byte, the mask value is calculated by shifting 00000001b right the same number of times as the desired line number. Once the mask value is calcu...

  • Page 19

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 17 for example: output_byte = 01010101b line_number = 3 status = 1 00000001b (1 decimal) shift-right 3 (line_number) = 00001000b xor 11111111b 11110111b (mask 1) and 010101...

  • Page 20: Ontrolling The

    18 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 c ontrolling the ppio u sing c the ppio disk includes three source code files as an example of using the ppio with the c programming language. Ppio.C is the main routine...

  • Page 21

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 19 the function, set_irq_off(), tells the parallel port not to generate any interrupts. This should be called immediately after set_start(). It is defined as: void set_irq_...

  • Page 22: Mask Value

    20 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 the parallel port’s status register stores the upper nibble (four bits) of the input line status. Since the smallest value that can be read from the port is a byte, some...

  • Page 23

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 21 notice that in the binary representation of the mask value, line zero’s mask has bit number zero set, and line one’s mask has bit number one set, etc. So, instead of ret...

  • Page 24

    22 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 line_number = 3 output_byte = 10101010b 00000001b shift-right 3 (line_number) = 00001000b and 10101010b (output_byte) 00001000b the function, set_output_bit(), sets the ...

  • Page 25

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 23 for example: output_byte = 01010101b line_number = 3 status = 1 00000001b (1 decimal) shift-right 3 (line_number) = 00001000b xor 11111111b 11110111b (mask 1) and 010101...

  • Page 26

    24 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 the function, is_ppio(), tests whether or not the ppio is connected to the parallel port and functioning properly. This function should only be used if it is safe to tog...

  • Page 28: Nterfacing to The

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 27 i nterfacing to the ppio each output of the ppio is capable of handling currents as high a 500 ma when the output is low. This means that you can connect a relay or a li...

  • Page 29

    28 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 figure 4.

  • Page 30: Xample

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 29 e xample u se of the ppio figure 5 shows a simple use of the ppio to create an automatic heating and air conditioning system. The top relay controls the air conditioning...

  • Page 31

    30 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 heat and the air. See line 230. If ib is equal to two then the 72 degree thermostat is on and the 78 degree one is off. At this time we want both the heat and the air of...

  • Page 32

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 31 90 rem ib is the input byte and ob is the output byte 100 out &h37a,&h4: rem set up 37a for inputting 110 out &h378,&h0: rem force i/o bits 0&1 high 120 rem to use them ...

  • Page 33: Ppendix

    Ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 33 a ppendix hexadecimal numbers hexadecimal numbers are base-16 numbers. Instead of only using the digits "0" through "9" to represent a number, the letters "a" through "f...

  • Page 34: Binary Numbers

    34 ppio2899 manual b&b electronics mfg co inc – 707 dayton rd - po box 1040 - ottawa il 61350 - ph 815-433-5100 - fax 815-433-5104 table 4 binary numbers binary numbers are base-2 numbers. They are written as a sequence of one's and zero's and end with a lower or upper case "b". Table 3 shows how to...