AT7210BPD It has controlled by Z80.
It takers by Visual Basic to ibrd().
[READYcrlf] is transmitted at this time.
[LF] It is [EOI] when transmitting.
It has published.
[LF+EOI] Interruption occurs from NAT7210 once again after transmission.
What processing should be performed at this time?
The present condition has processed nothing, even if DO interruption occurs.
again -- When "ibrd()" is used, interruption does not occur from NAT7210.
And it will become an error by Visual Basic.
Please teach solution.
#define GPIB_CS 0x00
#define GP0 GPIB_CS + 0
#define GP1 GPIB_CS + 1
#define GP2 GPIB_CS + 2
#define GP3 GPIB_CS + 3
#define GP4 GPIB_CS + 4
#define GP5 GPIB_CS + 5
#define GP6 GPIB_CS + 6
#define GP7 GPIB_CS + 7
/* int_reg1 define */
#define CPT 0x80
#define APT 0x40
#define DET 0x20
#define END_GP1 0x10
#define DEC 0x08
#define ERR_GP1 0x04
#define DO 0x02
#define DI 0x01
/* int2_reg2 define */
#define LOKC 0x04
#define REMC 0x02
#define ADSC 0x01
/* spsr_reg define */
#define PEND 0x40
#define RSV 0x40
/* adsr_reg */
#define MJMN 0x01
#define TA 0x02
#define LA 0x04
#define TPAS 0x08
#define LPAS 0x10
#define SPMS 0x20
#define ATN 0x40
#define CIC 0x80
/* AUX reg */
#define FIN_HS 0x03 /* finish handshake */
#define EOI 0x06 /* EOI */
#define VALID 0x0f /* Valid */
void inat7210(){
char gpadr;
outp(GP5,0x02); /* chip reset */
outp(GP1,( DEC | DO | DI ));/* intreg1 enable */
outp(GP2,( ADSC )); /* intreg2 enable */
outp(GP3,0x00); /* SPM_reg clear */
outp(GP4,0x11); /* MTA,MLA enable */
gpadr = inp(GPADR_SW) & 0x1f;
outp(GP6,gpadr); /* address reg */
outp(GP6,0xe0); /* 2'nd adrs disable */
outp(GP5,0x22); /* clock 2.0Mhz */
outp(GP5,0x85); /* hold off mode (A)reg */
outp(GP5,0xb0); /* INT active hi,slow speed (B)reg */
outp(GP5,0xc0); /* DAC auto send on DEC */
outp(GP7,0x0a); /* end of string code */
outp(GP5,0x00); /* pon */
}
void intgpib()
isr2 = inp(GP2);
if(!(isr2 & 0x80 )) /* no int */
return;
if( isr2 & ADSC )
gp_adsc
isr1 = inp(GP1);
if( isr1 & DO )
gp_do();
if( isr1 & DI )
gp_di( isr1 );
if( isr1 & DEC);
gp_dec();
}
void gp_adsc()
{
lsnled(off);
tlkled(off);
adsr = inp(GP4);
if( adsr & TA )
tlkled(on);
else if( adsr & LA )
lsnled(on);
}
void gp_do()
{
static int dostate = 0;
char cdor;
if( dostate == 2 ){
dostate = 0;
return;
}
if( dostate == 0 ){
dobufp = do_buf;
dostate = 1;
}
if( dostate == 1 ){
cdor = *dobuf_p++;
if( cdor == LF ){
outp(GP5,EOI);
dostate = 2;
}
}
}
void gp_di(char isr1)
{
static int distate = 0;
char cdor;
if( distate == 0 ){
dibufp = di_buf;
distate = 1;
}
cdor = inp(GP0);
*dibuf_p++ = toupper(cdor);
if( isr1 == END )
distate = 0;
di_f = 1;
}
outp(GP5,FIN_HS); 'Finish Handshake
}
void gp_dec()
{}