Model 650 GPIO Interface Support

The function of the TransEra Model 650 General Purpose Input Output (GPIO) interface card is to provide a means of communication between a peripheral device and a computer.

Card Defaults
Base Address 380 (hex)
Interrupt 10

 




Model 650 Support

The Model 650 card is supported in both HTBasic for DOS and HTBasic for Windows.

General Setup

The Model 650 card has three switches that are used to configure the card. An understanding of the GPIO interface is necessary to properly set the switches. If you have not previously used the GPIO interface, please study the Interface Description section of the Installing and Using Manual before proceeding with the installation. Switches labeled RES are reserved. The switch is ON when it is toward the PC board and OFF when it is away from the board.

Switch One - Interface Settings
This switch selects the signal polarity and the type of handshaking that will be used. The chart below shows the switch settings for handshaking and polarity.

Interface Settings for the Model 650
Name of Switch Position
PCTL
PFLG
PSTS
HND
DIN
DOUT
DCLR
Function
Set Polarity of PCTL
Set Polarity of PFLG
Set Polarity of PSTS
Full/Pulse Handshake
Set Polarity of Data In
Set Polarity of Data Out
Clear DOUT on Reset
ON
Low = Set
High = Clr
Low = Rdy
High = Bsy
Low = OK
High = OK
Full
Low = 1
High = 0
Low = 1
High = 0
Yes
OFF
Low = Clr
High = Set
Low = Bsy
High = Rdy
Low = OK
High = OK
Pulse
Low = 0High = 1
Low = 0
High = 1
No

Switch Two - Input Clock SourceThis switch selects the latch source that will clock the data into the input data buffers. The switch for the desired clock should be off with the other two on. The clocks for the high and low bytes do not need to be the same.

The RD clock source causes the computer to clock the input buffers whenever it is reading the data. The BSY clock source causes the input buffers to be loaded on the ready-to-busy transition of PFLG. The RDY clock source uses the busy-to-ready transition of PFLG.

For more information on GPIO input clocking, refer to the Interface Description section of the Installing and Using Manual for a more detailed explanation.
Switch Three - I/O Address

This switch is used to select the I/O address of the board. The I/O address selected by this switch is the base address that the computer uses to communicate with the board. The GPIO board uses 8 address locations above the base address. The address space of the GPIO board cannot be used by any other peripheral. The default address of the GPIO board is 380h.

The following table shows the switch settings with the corresponding hexadecimal board address.

Address Selection for GPIO 650
Switches
I/O Address
Switches
I/O Address
A9             A3
(hex)
A9              A3
(hex)
1 0 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0 0 1
3 C 8
1 0 1 1 0 1 0
2 D 0
1 1 1 1 0 1 0
3 D 0
1 0 1 1 0 1 1
2 D 8
1 1 1 1 0 1 1
3 D 8
1 0 1 1 1 0 0
2 E 0
1 1 1 1 1 0 0
3 E 0
1 0 1 1 1 0 1
2 E 8
1 1 1 1 1 0 1
3 E 8
1 0 1 1 1 1 0
2 F 0
1 1 1 1 1 1 0
3 F 0
1 0 1 1 1 1 1
2 F 8
1 1 1 1 1 1 1
3 F 8

If you change the I/O address, you must inform the software that uses the board. If you are using HTBasic, specify the new address in the LOAD BIN statement:

LOAD BIN "GPIO16;BASE 3F0"

Interrupt and DMA Channels
Interrupts and DMA are used to assist the transferring of data. There are a fixed number of interrupt and DMA channels on a PC, and they cannot be shared with other devices. The Model 650 enables the channel(s) for use with software so no hardware settings are required.

The Model 650 supports the following channels:

Interrupt Channels
DMA Channels
5, 7, 9, 10, 11, 12, 15
5, 6, 7

The board can use one interrupt channel and one DMA channel. An interrupt must be selected for DMA to be used. These channel numbers are given to the software driver during the initialization procedure. If there are no interrupt of DMA channels allocated to the board, it can still be used to transfer data but it’s performance will decrease and interrupts will not be available.

The three DMA channels are the 16-bit DMA channels available on a PC. These channels do not support 8-bit transfers. To handle this limitation the Model 650 was designed to pack two 8-bit peripheral handshakes into a single DMA transfer. This not only allows 8-bit peripheral transfers but also doubles the effective 8-bit transfer rate of the board.

Installation

Before installing the board into the machine, check the IRQ and address settings on the card. It is necessary to check that these settings will be compatible with the systems resource settings.

 Physically install the board by doing the following:

  1. Turn off and unplug the computer.
  2. Remove the computer cover.
  3. Locate an empty slot and take off the slot cover by removing the screw.
  4. Eliminate any static electricity by touching the metal computer case.
  5. Remove the GPIO board from the static protection pouch and insert it into the selected slot. The board should be handled by its edges only.
  6. Replace the screw to hold the board in place.
  7. Replace the computer cover.

Device drivers are handled by HTBasic and are discussed in the “Device Drivers” section.

GPIO16 Driver for the Model 650

The driver is loaded by including a line like the following in your AUTOST file: 

LOAD BIN “driver;options

If the card was installed using the default settings, the driver is loaded by simply typing: 

LOAD BIN “GPIO16”

This loads the driver for a Model 650 board at base address 0x380, ISC 12 and interrupt 5.  If any of the settings have been changed on the board then these will have to be reflected in the options of the LOAD BIN command.  The legal options for the GPIO16 driver are:

BASE address
INTERRUPT I
ISC n
DMA n
DELAY n

One or more options can be specified, and each are separated by a space.  The option may be abbreviated as long as the abbreviation is unique.

BASE Option
The address set with the I/O Address switch must match the BASE address value used for LOAD BIN.  If these do not agree, the LOAD BIN statement will return a device not found error.

An example of a LOAD BIN statement for a Model 650 card set to address 2F0h is:

LOAD BIN “GPIO16;BASE 2C0”

INTERRUPT Option
Interrupts may be disabled by using a 0 as the interrupt value. If interrupts are disabled, the board will not support TRANSFER commands and ENTER and OUTPUT commands could be slower.

Extending the example above, suppose the same board was also set with IRQ jumpers to 6.  The LOAD BIN statement would appear as follows:

LOAD BIN “GPIO16;BASE 2C0 INT 6”

ISC Option
The default ISC for the GPIO board is 12. This is the same ISC number assigned to the second parallel port. If the computer has a second parallel port, the ISC of the GPIO board should be changed.

To change the ISC on the board from the default 12 to 17:

LOAD BIN “GPIO16;BASE 2C0 INT 6 ISC 17”

DMA Option
DMA transfers are supported by the Model 650. An interrupt channel must be specified for DMA to be used.

Value
Delay Time
0
0-100ns
1
200-300ns
2
400-500ns
3
600-700ns
4
800-900ns
5
1.0-1.1ms
6
1.2-1.3ms
7
1.4-1.5ms

DELAY Option
The DELAY option controls the PCTL delay time for the Model 650. This delay is the time from when the computer outputs the data onto the GPIO cable until the PCTL line is set. If set to a time shorter than the data settling time, there can be data errors on outputs.

Below is an example LOAD BIN for the Model 650 with a base address of 220 hex, ISC number of 13, using interrupt channel 15 and DMA channel 6 with a PCTL delay of 400-500ns.

LOAD BIN “GPIO16; BASE 220 ISC 13 INT 15 DMA 6 DELAY 2

Multiple GPIO Cards

Any combination of up to four GPIO interfaces may be active at one time. Each GPIO interface is associated with an Interface Select Code (ISC) by the LOAD BIN command. To use more than one GPIO interface, each interface must have a unique ISC, BASE address, and IRQ. Therefore, a separate LOAD BIN command is required for each interface. However, you cannot use the same driver file name in more than one LOAD BIN command.

To use more than one GPIO interface that uses the same driver, you must load copies of the driver with altered names. Here is an example that uses one GPIO card with ISC 12 and a second card with ISC 13.

  1. Before installing the boards in the machine, the jumper settings must be changed. Examine the system settings to determine if there will be any resource conflicts and adjust switches and jumpers accordingly. In this example, we will set the GPIO board with ISC 12 to address 2F0h and leave the default IRQ 5. The GPIO board with ISC 12 will be set to address 310h and IRQ 7. See the section above entitled “General Setup” for more information on changing the board settings. Once the hardware is set to be compatible with the system, the card may be physically installed into the computer.

  2. Next, a second copy of the GPIO16 driver will need to be made. Open the HTBasic folder. Make a copy of the GPIO16 driver and rename the new copy. The copy can have any arbitrary base name but must end with the .D36 suffix, i.e.,

GPIO2.D36

You now have two copies of the same driver named GPIO16.D36 and GPIO162.D36.

  1. Finally, run HTBasic for Windows. To load the device drivers, add the following lines to the AUTOST file. Notice that each LOAD BIN statement reflects the settings that were changed in step 1 above.

LOAD BIN "GPIO16; ISC 12 BASE 2F0"
LOAD BIN "GPIO162; ISC 13 BASE 310 INT 7"

Troubleshooting

"Error 167":
Loading the GPIO16 drivers is the most common error returned when using the LOAD BIN statement to load HTBasic drivers. Fortunately, the cause of the error is almost always the same: disagreement between driver parameters and actual card settings.

Nine times out of ten, when fielding this call, the answer is found in a discrepancy between the BASE and INT values loaded in the LOAD BIN statement and the BASE and INT values setup on the card (jumper switches or software settings).

To properly deduce the source of "Error 167," check the following areas.

  1. Determine the base address setting and interrupt setting on the card itself.
  2. Make sure that these values agree with those specified in the LOAD BIN statement.

If the value of the jumper switches on the card were set to a base address of 2B8 and an interrupt of 5, you would need to assure that the LOAD BIN statement agrees. For example:

LOAD BIN "GPIO16;BASE 2B8 INT 5"

  1. Make sure that no other hardware devices in your computer are set to use this same interrupt.

(Note: On most new motherboards, Interrupt 2 is taken by the motherboard so do not use it. Other major offenders of conflicts are network and video cards)

Differences Between Model 600 and Model 650

The Model 600 and 650 are both designed to provide the same interface for communication with digital peripherals. All interaction with the peripheral are essentially the same. The differences come from the interaction between the GPIO board and the host computer. There are also some configuration differences.

The Model 650 has a 16-bit interface with the host computer and can use DMA to transfer data. The Model 600 uses an 8-bit interface and does not support DMA. The wider data path and the available DMA can allow the Model 650, using fast peripherals, to transfer data significantly faster than the Model 600.

Since the Model 650 has a 16-bit interface, it has access to the high numbered interrupt sources. These higher sources, greater than 9, are more available than the lower sources making it easier to locate a free interrupt channel.

The input clock source is set on both boards with a dip switch, but on the Model 650 the software can override these settings.

The PCTL delay time is modified on the Model 600 by soldering in a capacitor or a resistor. The PCTL delay time for the Model 650 is selected from software. This limits the maximum delay on the Model 650 to 1.5ms while the Model 600 can be extended to hundreds of microseconds with the use of a large capacitor.

The DOUT clear jumper on the Model 600 and switch on the Model 650 clears the DOUT lines on reset. With the Model 600, this forces the output lines low regardless of the polarity set for the output lines. The Model 650 sets the lines to a logical 0. This allows the lines to be set low or left high impedance depending on the polarity set for the lines.


Copyright 2007 © TransEra Corp.