Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MAX187 AD converter from LPT port

Status
Not open for further replies.

hsimola

Programmer
Jul 9, 2003
1
FI
Could somebody help me with following code. Problem is that I don't know where to put or how to include code which enables pins 4-7 (MAX187 takes power from pins)

So, pins 4-7 have to be enabled before trying to read data from LPT port connected MAX187. That's problem. I can't do it.



------------------------------------------------------------------------
------------------------------------------------------------------------
asm
PUSH EBX
PUSH ECX
PUSH EDX

xor ebx,ebx
mov ecx,12
xor eax,eax
mov edx,370h
out dx,al
//*****************
add dx,9
@Tsek: // Here it stucks if pins 4-7 are not enabled
in al,dx
and al,20h
jz @Tsek
//*****************
@LuePorttia_12x:
shl bx,1
dec dx
mov al,2
out dx,al
xor al,al
out dx,al
inc dx
in al,dx
and al,20h
jz @zero
inc bx
@zero:
loop @LuePorttia_12x
//*****************
mov al,1
dec dx
out dx,al
mov[jannite],bx

MOV DX,0378H // enables pins 4-7
MOV AL,60 //
OUT DX,AL //


POP EDX
POP ECX
POP EBX

end;
------------------------------------------------------------------------
 
Is that pins 4-7 or bits 4-7. You could try to do this:
1. Read port 888
2. X-OR port 888's value w/ 11110000
3. Write the new value to the port

I'm not sure if it will work for your purpose but it's worth a shot.
~ TripleFault !)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top