USER’S GUIDE FOR PC-LAB PCL-711B CARD
Author:
Ćirić Jovanka
Date: 29.09.1994.
English version: Milan Milićević (mm31693d@kiklop.etf.bg.ac.yu)
Date: 16.12.1997.
http://galeb.etf.bg.ac.yu/rti/vlsi/VLSIdodatak.htm
Instructions for using the PCL-711B card as digital output
- After turning the computer on, type command $CD HARDWARE\ PC-LAB and start a driver by command $PCL711
- Type a command $CD C
- Form a text file (with a name at will) with test vectors. Every line in the file contains a 16-bits vector, each one representing a test vector. File is finished with an end-of-file mark. Example:
0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1
0 1 1 1 0 0 0 1 0 1 0 1 1 0 0 1
d7 d0 d15 d8
- You can start the program with command $TEST. In the beginning you should enter the name of the file which contains the previously made test vectors. Two 8-bits test vectors with values that are currently on the pins of digital I/O board (with their decimal values) will be printed on screen. The first test vector is for pins D/O7 – D/O0, and the second is for pins D/O15 – D/O8 (page 8 of the original manual). By pressing any key, test vectors will change in order, ordered by file.
- Program for digital output with calculated frequency of transferring the array of test vectors to the PC-Lab board is started by command $PACE. After starting the program you should enter the name of the file with test vectors. This file was created in step 3). Output test vectors (8 bits long) will be transferred on the pins of the PC-Lab card with the frequency calculated in program pace.c with parameters param[5] & param[6] using the formula:
f = 2MHz/C1*C2 C1=param[5] C2=param[6]
In the case of changing the parameter table, you should compile program again using the integrated environment by command $TC PACE and by choosing the option Compile, or from DOS by command $TCC pace.c 711lib.cs.
- After finishing the work with the PCL-711B card, it is recommended to free the driver from the main memory by command:
$CD.. (to change directory to \HARDWARE\PC-LAB)
$FREE711
- Arrangement of pins on the board for digital input/output
WIRING TERMINAL BOARD FOR PCL-711
- Installing the card
- The PCL-711B has three twenty pin connectors for digital input DIG IN, digital output DIG OUT, and analog input/output ANA I/O.
- The PCL-711B uses 16 neighboring address locations in the I/O space. Switch SW1 is used for selecting the base address on the board PCL-711B. Default is 220H, and you can choose another address using the 6 small switches, marked with A(987654), by turning them ON or OFF (this is marked on a board). You can choose the address according to the table in the manual.
- Jumper JP1 is used for changing the range of output voltage from the D/A converter. Default is 0 to +5V. Referent voltage is set to –5V.
- The card has its own driver. It is recommended using it during making your own application. Driver is a TSR program. Software driver makes programming easiest by using the parameter table. Table contents are parameters, masks, and other information for functions. All function calls supported by driver need only two parameters: function number and pointer on a memory address, which points to the redefined parameter table. The PCL-711B supports 24 functions. List of all parameters and functions is in the manual.
- Some useful general characteristics of PCL-711B
- Program languages supported by the driver are BASICA, GWBASIC, QUICK BASIC 4.0/4.5, Microsoft C, Turbo C, BORLAND C++, MICROSOFT PASCAL, and TURBO PASCAL.
- Functions are divided into A/D functions, functions for Block Channel Scan, D/A functions, digital input, digital output, timer/counter functions, and functions for a daughter board.
- Drawer PLCTEST contains the program testprog.exe that gives all possibilities: A/D, D/A, D/I, and D/O with graphic interface. In the menu you can select type of card, base address, IRQ level, A/D and D/O range. With Edit (D/A or D/O), analog or digital voltage on output can be changed.
- There are two data buffers marked with A and B. Data buffer size may vary from 2B to 64K. Before executing any function call, offset address (or memory pointer on a data buffer) must be send to parameters in parameter table. If you use only buffer A, memory address of buffer B must be set on 0. Take care not to overflow the offset address because of the buffer size. For example, if offset is 8000h, and buffer size is A000h, then 8000h+A000h=12000h gives an overflow.
- Two buffers allow double buffering, which means that the driver first puts data in buffer A, then in buffer B. But it can be dangerous, because during transferring from one buffer to another some data may be lost.
- Buffer size must not be lower then the number of bytes for A/D, D/A, D/I, or D/O. A/D and D/O require 2B, while digital I/O conversion requires 1B. If both buffers were in use they would be of the same size.
- Buffers are 1B wide. This means that if we want to output 16 bits data, first, we must output the lower byte, and then the higher byte, and we change D/O port with the parameter param[38]. The PC-Lab card for digital I/O has two ports with 8 channels each (D/O7-D/O0 and D/O15/D/O8) and both of them can not be active at the same time.
- Driver allows 3 operation mode types: rotational, non-rotational, and trigger mode. Non-rotational mode puts data in order from the first to the Nth conversion. Number of conversions is changed by parameter 37. In rotational mode, data is put from the first to the Nth conversion, and the sequence repeats until the STOP command is given.
- A/D, D/A, and D/O are executed under internal clock trigger mode or under external clock trigger mode. D/I can be triggered only with an internal clock. Internal clock trigger is received from the Timer/Counter chip that is on board (Intel 8253). Frequency can be programmed by C1 and C2 parameters (param[5] and param[6]), using the formula f=2MHz/C1*C2. External clock trigger is used if we want to trigger conversion when external signal is changed.
- Functions for digital output supported by the PCL-711B card:
- Func 28 Digital output initialization: For initialization of D/O, it must be called before every other D/O function.
- Func 29 Software data transfer: Executes D/O conversion N times, where N is defined by param[37]. It finishes only when the Nth conversion is finished. You can use only buffer A, while the rotational mode is not allowed. Time interval between two digital outputs depends of clock frequency.
- Func 30: Reads current digital output status, returns error parameter (param[45]), and parameter at output (param[46]).