NAR-5620 Series
User
’
s
Manual
56
// GP14 output 0 and GP15 input
outport(0x2e,0xf1);
outport(0x2f,0x00);
indata=inport(0x2f);
check1=indata & 0x20;
outport(0x2e,0xf0);
outport(0x2f,0x02);
//GP15 =Input GP14=output
// GP14 output 1 and GP15 input
outport(0x2e,0xf1);
outport(0x2f,0x10);
indata=inport(0x2f);
check2=indata & 0x20;
//if ((check1==2) && (check2==0)) display_line(50 ,9, "PASS", 15,1);
if ((check1==0x20) && (check2==0x00)) display_line(50 ,9, "PASS", 15,1);
else {display_line(50 ,9, "FAIL", 12,1);fail_beep();}
//*********************
Test
GPI2
P2
output
and
P3
input
***************************************/
display_line(1,10, "
?GPIO P2 output and P3 input Test :", 14,1);
outport(0x2e,0xf0);
outport(0x2f,0x80);
//GP17 =Input GP16=Output
// GP16 output 0 and GP17 input
outport(0x2e,0xf1);
outport(0x2f,0x00);
indata=inport(0x2f);
check1=indata & 0x80;
outport(0x2e,0xf0);
outport(0x2f,0x80);
//GP17 =Input GP16=Output
// GP16 output 1 and GP17 input
outport(0x2e,0xf1);
outport(0x2f,0x40);