background image

Manual PCI-DIO-48JP/JPS 

13

Chapter 6: Programming

 

 
These cards are I/O-mapped devices that are easily configured from any language and any language can 
easily perform digital I/O through the card's ports. This is especially true if the form of the data is byte or 
word wide. All references to the I/O ports would be in absolute port addressing. However, a table could be 
used to convert the byte or word data ports to a logical reference. 
 

DEVELOPING YOUR APPLICATION SOFTWARE 

 
If you wish to gain a better understanding of the programs on diskette, then the information in the following 
paragraphs will be of interest to you. Refer to the data sheets and 8255-5 specification in Appendix A. 
 
A total of 16 register locations are used by these. The PPIs are addressed consecutively with Address bits 
A3 through A0 as follows: 
 
 

Address Port 

Assignment 

Operation 

Base Address 
Base A1 
Base A2 
Base A3 
Base A4 
Base A5 
Base A6 
Base A7 
Base A8 
Base A9 
Base AB 
Base AF 

Port A Group 0 
Port B Group 0 
Port C Group 0 
Control Group 0 
Port A Group 1 
Port B Group 1 
Port C Group 1 
Control Group 1 
Enable/Disable Buffer, Grp 0
Enable/Disable Buffer, Grp 1
Enable Chg-of-St. Interrupt 
Clear Chg-of-St. Interrupt 

Read/Write 
Read/Write 
Read Write 

Write Only 

Read/Write 
Read/Write 
Read/Write 

Write Only 
Write Only 
Write Only 
Write Only 
Write Only 

 

Table 6-1: Address Assignment Table 

 
These cards use two type 8255-5 PPIs to provide a total of 48 bits input/output capability. The cards are 
designed to use each of these PPI's in Mode 0 wherein: 

  
a. There are two 8-bit groups (A and B) and two 4-bit groups (C Hi and C Lo). 
b. Any group can be configured as an input or an output. 
c. Outputs are latched. 
d. Inputs are not latched. 

 
Each PPI contains a Control Register. This write-only, 8-bit register is used to set the mode and direction of 
the ports. At Power-Up or Reset, all I/O lines are set as inputs. Each PPI should be configured during 
initialization by writing to the Control Registers even if the groups are only going to be used as inputs. 
Output buffers are automatically set by hardware according to the Control Register states. Note that Control 
Registers are located at base a3 and base a7. Bit assignments in each of these Control 
Registers are as follows: 
 

Summary of Contents for PCI-DIO-48JP

Page 1: ...23 Roselle Street San Diego CA 92121 858 550 9559 FAX 858 550 7322 contactus accesio com www accesio com DIGITAL INPUT OUTPUT CARD Models PCI DIO 48JP and PCI DIO 48JPS USER MANUAL File MPCI DIO 48JPS A1e ...

Page 2: ...CCES nor the rights of others IBM PC PC XT and PC AT are registered trademarks of the International Business Machines Corporation Printed in USA Copyright 1998 2005 by ACCES I O Products Inc 10623 Roselle Street San Diego CA 92121 All rights reserved WARNING ALWAYS CONNECT AND DISCONNECT YOUR FIELD CABLING WITH THE COMPUTER POWER OFF ALWAYS TURN COMPUTER POWER OFF BEFORE INSTALLING A CARD CONNECTI...

Page 3: ... or parts not excluded by warranty Warranty commences with equipment shipment Following Years Throughout your equipment s lifetime ACCES stands ready to provide on site or in plant service at reasonable rates similar to those of other manufacturers in the industry Equipment Not Manufactured by ACCES Equipment provided but not manufactured by ACCES is warranted and will be repaired according to the...

Page 4: ...ess Selection 10 Chapter 5 Software 11 Chapter 6 Programming 13 Table 6 1 Address Assignment Table 13 Table 6 2 Control Register Bit Assignment 14 Table 6 3 Control Register Configuration 15 Table 6 4 Change of State Interrupt Enable Register 16 Chapter 7 Connector Pin Assignments 18 Table 7 1 Connector Pin Assignments 18 Figure 7 1 68 Pin Female SCSI Pin Locations 18 Table 7 2 Connector Pin Assig...

Page 5: ... interface to 48 lines Each PPI provides three 8 bit ports A B and C Each 8 bit port can be software configured to function either as inputs or as latched outputs Port C can also be software configured for four inputs and four latched outputs Pull ups on the cards assure that there are no erroneous outputs at power up until the card is initialized by system software The feature that distinguishes ...

Page 6: ...address space The base address is selected by the system An illustrated setup program is provided on the diskette or CD shipped with your card Interactive displays show locations and proper configuration of jumpers to set up the interrupt enable function Also sample programs in Turbo C and Turbo Pascal are presented in the Software section of this manual PCI BUS CONTROL LOGIC INTERRUPT ENABLE PPI ...

Page 7: ...ons for usage of the various card options CD Software Installation The following instructions assume the CD ROM drive is drive D Please substitute the appropriate drive letter for your system as necessary DOS 1 Place the CD into your CD ROM drive 2 Type B to change the active drive to the CD ROM drive 3 Type GLQR JJ to run the install program 4 Follow the on screen prompts to install the software ...

Page 8: ...gned resources 10 Run one of the provided sample programs that was copied to the newly created card directory from the CD to test and validate your installation The base address assigned by BIOS or the operating system can change each time new hardware is installed into or removed from the computer Please recheck PCIFind or Device Manager if the hardware configuration is changed Software you write...

Page 9: ...ing or disabling the 74LS245 input output buffers under program control is provided at the jumper position labeled TST BEN When the jumper is in the BEN Buffer Enable position the I O buffers are always enabled When the jumper is in the TST Tristate position enabled disabled state is controlled by a control register See the programming section of this manual for a description NOTE A jumper must be...

Page 10: ...h of the cards and the respective IRQs allotted Alternatively some operating systems Windows95 and WindowsNT 5 0 can be queried to determine which resources were assigned In these operating systems you can use either PCIFind or the Device Manager utility from the System Properties Applet of the control panel The cards are installed in the Data Acquisition class of the Device Manager list Selecting...

Page 11: ...sions are in the form of a DLL a GBL and a VisualBASIC sample Together these files allow you to access the port and main memory space in a fashion similar to BASIC QuickBASIC Pascal C C Assembly and most other standard languages To use these files in a VisualBASIC program you must create a MAK file File l New Project similar to the sample provided or else modify your existing project file and incl...

Page 12: ...nt less intuitive All integers in BASIC are signed numbers wherein data are stored in two s complement form All bit patterns must be converted to and from this two s complement form if meaningful display is required Otherwise values returned from the InPortb function will be 128 to 127 rather than 0 to 255 An alternative is to perform all assignments in hexadecimal rather then decimal form Before ...

Page 13: ... 0 Port C Group 0 Control Group 0 Port A Group 1 Port B Group 1 Port C Group 1 Control Group 1 Enable Disable Buffer Grp 0 Enable Disable Buffer Grp 1 Enable Chg of St Interrupt Clear Chg of St Interrupt Read Write Read Write Read Write Write Only Read Write Read Write Read Write Write Only Write Only Write Only Write Only Write Only Table 6 1 Address Assignment Table These cards use two type 8255...

Page 14: ...ssociated PPI chip as well as the mode can be set For example a write to Base Address 3 with data bit D7 high programs port direction at group 0 ports A B and C If for example hex 80 is sent to Base Address 3 the group 0 PPI will be configured in mode 0 with ports A B and C as outputs At the same time data bit D7 is also latched in a buffer controller for the associated PPI chip A high state disab...

Page 15: ...low See item d above outportb BASE_ADDRESS 3 0x09 PROGRAMMING EXAMPLE BASIC The following example in BASIC is provided as a guide to assist you in developing your working software In this example the card base address is 2D0 hex and the I O lines of group 0 are to be setup as follows Port A Input Port B Output Port C Hi Input Port C Lo Output The first step is to configure the control register Con...

Page 16: ...rite to the Control Register with bit D7 low If you wish to subsequently disable the buffers you can write to the Control Register with bit D7 high In this way you can enable disable the output buffers without programming the PPI mode Note When writing a command byte to these cards while the TST jumper is installed the PPI output buffers are disabled Thus when you desire to to change the mode you ...

Page 17: ...ddress Bh Toggle bit C3 high for at least 1 uS then low Note that this pulse will show up at pin 5 or 41 of the connector Example 2 External interrupt The interrupt option jumper for the group must be in the IEN position Configure port C Low as an input and enable interrupts globally by reading any address decoded by the board The pulse at pins 9 or 59 bit C3 must go high for at least 1 uS then lo...

Page 18: ...p 0 Port B Group 0 Port B Group 0 Port B Group 0 Port B Group 0 Port B Group 0 Port B Group 0 Port B Group 0 Port B Group 0 Port A Group 0 Port A Group 0 Port A Group 0 Port A Group 0 Port A Group 0 Port A Group 0 Port A Group 0 Port A 5 VDC PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0 PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 1 2 3 4 5 6 7 8 13 14 15 16 17 18 19 20 25 26 27 28 29 30 31 3...

Page 19: ...ort B Group 1 Port B Group 1 Port B Group 1 Port B Group 1 Port A Group 1 Port A Group 1 Port A Group 1 Port A Group 1 Port A Group 1 Port A Group 1 Port A Group 1 Port A 5 VDC PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0 PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 37 38 39 40 41 42 43 44 49 50 51 52 53 54 55 56 59 60 61 62 63 64 65 66 67 Ground Ground 35 36 45 46 47 48 57 58 This line is a...

Page 20: ...s manual or just want to give us some feedback please email us at manuals accesio com Please detail any errors you find and include your mailing address so that we can send you any manual updates 10623 Roselle Street San Diego CA 92121 Tel 858 550 9559 FAX 858 550 7322 www accesio com ...

Reviews: