Hi,
thank you for your answer,I'm developing a GPIB interface for our production,It will be used to comunicate with GPIB card made in NI. The GPIB interface is consised of sn75160,sn75162 and NAT9914
the microcontroller is 80c51.the initialize program is:
void GPIB_init(void)
{
P1&=0X7F;//reset=0
wr9914(&GPIB_AUXCR,CH_RST);
wr9914(&GPIB_AUXCR,SW7210);
wr9914(&GPIB_SPMR,0x50);/*7210 MODE PAGE IN */
wr9914(&GPIB_AUXCR,0X81);/*MICR=1 */
wr9914(&GPIB_SPMR,SW9914);
wr9914(&GPIB_AUXCR,PIACCR); /*Page-in ACCR*/
wr9914(&GPIB_ACCR,_16MHZ); /* SET CLOCK 16MHZ*/
wr9914(&GPIB_AUXCR,CLRPI);
wr9914(&GPIB_ADR,PRI_ADD);
wr9914(&GPIB_AUXCR,PIEOSR); /*PAGE-IN EOSR*/
wr9914(&GPIB_EOSR,0x0a);
wr9914(&GPIB_AUXCR,CLRPI);
wr9914(&GPIB_AUXCR,PIACCR);
wr9914(&GPIB_ACCR,0x94);
wr9914(&GPIB_AUXCR,CLRPI);
wr9914(&GPIB_IMR0,(BOIE+BIIE+ENDIE));
wr9914(&GPIB_IMR1,(GETIE+DCASIE));
wr9914(&GPIB_AUXCR,PIIMR2);
wr9914(&GPIB_IMR2,GLINT+NLEN+STBOIE);
wr9914(&GPIB_AUXCR,CLRPI);
wr9914(&GPIB_AUXCR,PIACCR);
wr9914(&GPIB_ACCR,0XE0);
wr9914(&GPIB_AUXCR,CLRPI);
wr9914(&GPIB_AUXCR,VSTDL);//N_
wr9914(&GPIB_AUXCR,STDL);//N_
wr9914(&GPIB_AUXCR,PIACCR);
wr9914(&GPIB_ACCR,0XE4);
wr9914(&GPIB_AUXCR,CLRPI);
wr9914(&GPIB_PPR,0);
wr9914(&GPIB_AUXCR,PIACCR);
wr9914(&GPIB_ACCR,0XB0);
wr9914(&GPIB_ACCR,0XCC);
wr9914(&GPIB_AUXCR,CLRPI);
wr9914(&GPIB_AUXCR,N_SWRST);
}
void wr9914(unsigned char xdata *a,char b)
{
{
#pragma asm
clr p3.0 ;74HC373 CP=0
mov P0,r7 ;send address
nop
nop
setb p3.0 ; 74HC373 CP=1
NOP
clr p3.0 ;74HC373 CP=0
mov p0,r5 ;send data
NOP
clr p3.6 ;NAT9914 we=0
clr p2.0 ;NAT9914 ce=0
nop
nop
setb p2.0 ;NAT9914 ce=1
setb p3.6 ;NAT9914 we=1
#pragma endasm
}
}
after I run this initialize program,and then run the "scan instrument" in the MAX , the handshake lines has not any action.
thank and regard
BaiPeiWen
bpw@array.sh
bpw1@163.net