Table 4.2-1 Function of the Gain Control Bits                                         Table 4.2-2 Function of the Gain Control Bits



Системы реального времени

РГЗ №1 “Разработка драйвера универсального адаптера сбора данных под MS DOS”:

 

1. В соответствии с документацией на многофункциональный адаптер ACL-8112 DG и адаптер аналогового вывода А-626 написать драйвер, обеспечивающий ввод и вывод аналоговой и дискретной информации в реальном времени под MSDOS в режиме программного опроса.

Базовый адрес ACL-8112 DG = 230H, Базовый адрес А-626 = 2C0H.

а) Входные аналоговые сигналы внешнего физического интерфейса обрабатывать следующим образом:

- каналы 0 и 1 оцифровываются АЦП платы ACL-8112 DG, отображаются в текстовом режиме в виде

MSB= …__LSB=…__WORD=…__REAL=… и выводятся без изменений в 0 и 1 каналы ЦАП платы ACL-8112 DG;

- каналы 2 и 3 оцифровываются АЦП платы ACL-8112 DG, отображаются в текстовом режиме в виде

MSB= …__LSB=…__WORD=…__REAL=… и выводятся без изменений в 0 и 1 каналы ЦАП платы А-626.

б) Все каналы дискретного ввода инвертируются, отображаются в текстовом режиме в виде DIL=…__DIH=… и выводятся в каналы дискретного вывода в порядке DI0 в DO0, DI1 в DO1, …, DI15 в DO15.

в) Реализовать подсистему контроля длительности шага квантования с использованием:

- системного таймера RTC;

- нулевого таймер-счетчика платы ACL-8112 DG.

г) Сгенерировать 4 синусоидальных сигнала в диапазоне ± 10В, отобразить их в текстовом режиме в виде

MSB= …__LSB=…__WORD=…__REAL=… и вывести в каналы со 2го по 5й ЦАП платы аналогового вывода А-626. При этом частоты сигналов должны соотноситься как 1:2:4:8.

2. Источник сигналов для плат ввода-вывода, приемник их сигналов и минимальный интерфейс реализован в Genie 3.0. Файл стратегии adio_tst.gni.

3. Начертить общую блок-схему программы драйвера, включающую процедуры инициализации, ввода аналоговых и дискретных сигналов, преобразования кодов, соответствующих аналоговым сигналам, и логических функций преобразования дискретных сигналов, вывода аналоговых и дискретных сигналов, контроля длительности шага квантования.

4. Начертить подробные блок-схемы процедур программы с комментариями.

5. Представить листинг программы драйвера и с комментариями.

_____________________________________________________________________________________________


Выдержка из документации на многофункциональный адаптер ACL-8112 DG.

4. Registers Structure & Format

The detailed descriptions of the register format and structure of the DAS BOARD are specified in this chapter. This information is quite useful for the programmer who wish to handle the card by low-level program.

In addition, the low level programming syntax is introduced. This information can help the beginners to operate the DAS BOARD in the shortest learning time.

I/O Port Address

The DAS BOARD requires 16 consecutive addresses in the PC I/O address space. The Table 4.1 shows the I/O address of each register with respect to the base address. The function of each register also be shown.

I/O Address Read Write
Base + 0 Counter 0 Counter 0
Base + 1 Counter 1 Counter 1
Base + 2 Counter 2 Counter 2
Base + 3 Not Used 8254 Counter Control
Base + 4 A/D low byte CH1 D/A low byte
Base + 5 A/D high byte CH1 D/A high byte
Base + 6 DI low byte CH2 D/A low byte
Base + 7 DI high byte CH2 D/A high byte
Base + 8 Not Used Clear Interrupt Request
Base + 9 Not Used A/D Range Control
Base + 10 Not Used Channel MUX
Base + 11 Not Used Mode Control
Base + 12 Not Used Software A/D trigger
Base + 13 Not Used DO low byte
Base + 14 Not Used DO high byte
Base + 15 Not Used Not Used

Table 4.1 I/O Address

A/D Data Registers

The DAS BOARD series are 12-bit resolution for analog input channels, the digital data will store in the A/D data registers. The A/D data is put into two 8 bits registers. The low byte data (8 LSBs) are put in address BASE+4 and the high byte data (4 MSBs) are put in address BASE+5. A DRDY bit is used to indicate the status of A/D conversion. DRDY goes to low level means A/D conversion is completed.

Address : BASE + 4 and BASE + 5

Bit 7 6 5 4 3 2 1 0
BASE+4 AD7 ADS AD5 AD4 AD3 AD2 AD1 AD0
BASE+5 0 0 0 DRDY AD11 AD10 AD9 AD8

Attribute : read only

Data Format:

 

 

AD11 .. ADO : Analog to digital data. AD11 is the Most Significant Bit (MSB). AD0 is the Least Significant Bit(LSB).

DRDY :        Data Ready Signal.

1: A/D data is not ready

0: A/D conversion is completed. It will be set to 1, when reading the low byte.

A/D Channel Multiplexer Register

This register is used to control the A/D channels to be converted. It's a write only register. When the channel number is written to the register, the multiplexer switches to the new channel and await for conversion.

Bit 7 6 5 4 3 2 1 0
BASE+10 X X CS1 CS0 CL3 CL2 CL1 CL0

Address : BASE + 10

Attribute: write only

Data Format:

CLn :        multiplexer channel number (n=0~3). CL3 is MSB, and CL0 is LSB.

CS0, CS1: Single-ended and Differential Selection

CS0 and CS1 are used to determine which MPC508A chip is selected. The MPC508A is used to multiplex channel from channel, when CS0 is set as 1, the analog input channels from 0 to 7 is selectable, and CS1 is set, the ch8 to ch15 can be selectable. When both CS0 and CS1 are set as 1, it means the analog input is differential mode. The possible analog input channel selections are listed as the table below.

Bit Channel 7 X 6 X 5 CS1 4 CSO 3 CL3 2 CL2 1 CL1 0 CL0
S.E. CH0 X X 0 1 0 0 0 0
S.E. CH1 X X 0 1 0 0 0 1
S.E. CH2 X X 0 1 0 0 1 0
S.E. CH3 X X 0 1 0 0 1 1
S.E. CH4 X X 0 1 0 1 0 0
S.E. CH5 X X 0 1 0 1 0 1
S.E. CH6 X X 0 1 0 1 1 0
S.E. CH7 X X 0 1 0 1 1 1
S.E. CH8 X X 1 0 1 0 0 0
S.E. CH9 X X 1 0 1 0 0 1
S.E. CH10 X X 1 0 1 0 1 0
S.E. CH11 X X 1 0 1 0 1 1
S.E. CH12 X X 1 0 1 1 0 0
S.E. CH13 X X 1 0 1 1 0 1
S.E. CH14 X X 1 0 1 1 1 0
S.E. CH15 X X 1 0 1 1 1 1
D.I. CH0 X X 1 1 0 0 0 0
D.I. CH1 X X 1 1 0 0 0 1
D.I. CH2 X X 1 1 0 0 1 0
D.I. CH3 X X 1 1 0 0 1 1
D.I. CH4 X X 1 1 0 1 0 0
D.I. CH5 X X 1 1 0 1 0 1
D.I. CH6 X X 1 1 0 1 1 0
D.I. CH7 X X 1 1 0 1 1 1

S.E. Single-ended Analog Input

D.I. Differential Analog Input

A/D Range Control Register

The A/D range register is used to adjust the analog input ranges for A/D channels. The Table 4 2 shows the relationship between the register data and the A/D input range

Bit 7 6 5 4 3 2 1 0
BASE+9 X X X X G3 G2 G1 G0

 Address : BASE + 9

Attribute : write only

Data Format:

This table is only forHigh Gain Card                                                                       This table is only for Low Gain Card

G3 G2 G1 GO GAIN Bipolar or Unipolar Input Range   G3 G2 G1 GO GAIN Bipolar or Unipolar Input Range
0 0 0 0 1 Bipolar ±5V   1 0 0 0 0.5 Bipolar ±10V
0 0 0 1 10 Bipolar ±0.5V   0 0 0 0 1 Bipolar ±5V
0 0 1 0 100 Bipolar ±0.05V   0 0 0 1 2 Bipolar ±2.5V
0 0 1 1 1,000 Bipolar ±0.005V   0 0 1 0 4 Bipolar ±1.25V
0 1 0 0 1 Unipolar 0V~10V   0 0 1 1 8 Bipolar ±0.625V
0 1 0 1 10 Unipolar 0V~1V   0 1 0 0 1 Unipolar 0V~10V
0 1 1 0 100 Unipolar 0V~0.1V   0 1 0 1 2 Unipolar 0V~5V
0 1 1 1 1,000 Unipolar 0V~0.01V   0 1 1 0 4 Unipolar 0V~2.5V
1 0 0 0 0.5 Bipolar ±10V   0 1 1 1 8 Unipolar 0V~1.25V
1 0 0 1 5 Bipolar ±1V                
1 0 1 0 50 Bipolar ±0.1V                
1 0 1 1 500 Bipolar ±0.01V                
1 1 0 0 1 Unipolar N/A                
1 1 0 1 10 Unipolar N/A                
1 1 1 0 100 Unipolar N/A                
1 1 1 1 1,000 Unipolar N/A                

Table 4.2-1 Function of the Gain Control Bits                                         Table 4.2-2 Function of the Gain Control Bits

The jumper JP9 is used to change the maximum analog input range form ±5V or ±10V.

If the JP9 is set as ±5V, the analog input range is listed as below.                  If the JP9 is set as ±5V, the analog input range is listed as below

G3 G2 G1 G0 GAIN Analog Input Range   G3 G2 G1 G0 GAIN Analog Input Range
0 0 0 0 1 ±5V   0 0 0 0 1 ±10V
0 0 0 1 2 ±2.5V   0 0 0 1 2 ±5V
0 0 1 0 4 ±1.25V   0 0 1 0 4 ±2.5V
0 0 1 1 8 ±0.625V   0 0 1 1 8 ±1.25V
0 1 0 0 16 ±0.3125V   0 1 0 0 16 ±0.625V

Table 4.2-3 Analog Input Range ( max. is ±5V)                                       Table 4.2-4 Analog Input Range (max. is ±10V)


Дата добавления: 2018-08-06; просмотров: 198; Мы поможем в написании вашей работы!

Поделиться с друзьями:






Мы поможем в написании ваших работ!