Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to initialize NAT9914 make it conduct handshake action?

hi,I'm developing a GPIB interface used your company NAT9914 for our conduction,but the Nat9914 handshake lines has not any action when I run "scan instrument"command i the MAX
0 Kudos
Message 1 of 4
(4,242 Views)
Hi,

The only configuration needed is to set the T1 delay of the handshake. You can check this in the chip's User manual:

http://digital.ni.com/manuals.nsf/webAdvsearch/A45DBE18111629518625665E006A7482?OpenDocument

I do have some questions. Are you using the NAT9914 as a controller or as a device?. You mention that your developing a GPIB interface, but that would imply that you have to make your own driver, and MAX would not be able to communicate with you interface.

If you could give a brief description of how is your system setup we might be able to provide more help.

DiegoF.
National Instruments.
0 Kudos
Message 2 of 4
(4,242 Views)
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
0 Kudos
Message 3 of 4
(4,242 Views)
Hi,

I've been reading the NAT 9914 reference and comparing the code, but it is practically imposible for me to debug the code. I found an application note for the NAT9914 that has different example codes. I think the most eficient thing is for you to use these example programs as guides for your debugging.

http://zone.ni.com/devzone/conceptd.nsf/2d17d611efb58b22862567a9006ffe76/40d4bb8dcd8ceb35862568040069e228?OpenDocument

DiegoF.
0 Kudos
Message 4 of 4
(4,242 Views)