PEX/PIO/PISO-DA Series Card
Analog Output Boards
User Manual/ Ver. 3.1/ Oct. 2013/ PMH-0010-31/ Page: 68
6.3.12 D/A Data Output Register
(Write): wBase+0xf0
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
D7
D6
D5
D4
D3
D2
D1
D0
(Write): wBase+0xf4
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
A1
A0
D13
D12
D11
D10
D9
D8
Each D/A converter have four analog output channels. When writing data to the D/A
converter, the
relevant
channel to be used is indicated by A1 and A0.
D/A programming sequence:
1. Send data to the D/A converter. (This data will be buffered)
2. Select the D/A converter. (Start the conversion)
For example:
outportb(wBase+0xf0,wDaValue);
/* output low byte of D/A data*/
outportb(wBase+0xf4,(wDaValue>>8)|0x02);
/* output high byte of D/A data and */
/* select channel 2 on this converter */
outportb(wBase+0xe0,0);
/* select DA_0 */
/* after this procedure wDaValue will */
/* be sent to channel_2 */
pio_da16_da(2,wDaValue);
/* send wDaValue to channel_2 */
void pio_da16_da(char cChannel_no,int iVal)
{
iVal=iVal+(cChannel_no%4)*0x4000;
/* cChannel_no: 0 - 15 */
outportb(wBase+0xf0,iVal);
/* iVal: 0x0000 - 0x3fff */
outportb(wBase+0xf4,(iVal>>8));
outportb(wBase+0xe0+4*(cChannel_no/4),0xff);
}
Refer to the DEMO6/7/8/9.C files for more information.
ГК
Атлант
Инжиниринг
–
официальный
представитель
в
РФ
и
СНГ
+7(495)109-02-08 [email protected] www.bbrc.ru