![ICP DAS USA PCI-1202 Series User Manual Download Page 78](http://html2.mh-extra.com/html/icp-das-usa/pci-1202-series/pci-1202-series_user-manual_4476309078.webp)
PCI-1202/1602/180x Series Card
Multi-Function Boards
User Manual/ Ver. 4.8/ Mar. 2015/ PMH-0014-48/ Page: 78
6.5.1.6 Bit13: Handshake Control Bit
Set the B13 to 0
if the command is sent to the
MagicScan controller. Keep this bit at high when
not used.
The demo program of handshaking is given as follows:
WORD pic_control(WORD i)
{
WORD j;
if ((inport(wAddrCtrl)&0x04)==0)
{
outport(wAddrCtrl,0xffff);
/* send a recovery to PIC */
}
j=0;
while ((inport(wAddrCtrl)&0x04)==0)
{
j++;
if (j>65530) return(AdControllerError);
/* time out */
}
i = i & 0xDFFF;
/* set pic low !! */
outport(wAddrCtrl,i);
j=0;
while ((inport(wAddrCtrl)&0x04)!=0)
{
j++;
if (j>65530) return(AdControllerError);
/* time out */
}
outport(wAddrCtrl,(WORD)(i | 0x2000));
/* set pic high !! */
j=0;
while ((inport(wAddrCtrl)&0x04)==0)
{
j++;
if (j>65530) return(AdControllerError);
//time out
}
return(NoError);
}
Command
[B13]
Handshake Control to MagicScan
Controller
0
Set the external trigger logic
1