I have read some tutorials on how to program the parallel port in qbasic but cant seem to get it right. When I run the code:
OUT 888, 255
X = INP(888)
PRINT X
I always get the value 8. No matter what I set the port to. What am I doing wrong Also the pins dont output the correct value. I know the parallel port works because I have downloaded programs that use the parallel port for interfacing and they have outputed the correct values. Thanks in advance.
Get "PortTalk" available on the web for free. Follow install procedures. You can create a dummy EXE file to run with AllowIO.exe. Use the HEX address for your port listed in Windows hardware.
I installed port talk but I still have the same problem, except I have realized that when I restart Qbasic the first command I send to the parallel port works but after that It always stays the same. For example if I first start Qbasic and type:
OUT 888, 111
X=INP(888)
PRINT X
Then I get 111, no matter how many times I run it. If I then change the code to
OUT 888, 255
X=INP(888)
PRINT X
I still get 111 every time. If I then restart Qbasic and type
It has worked for me, but let me check it out after Xmas.
Did you put the driver file into the Windows\System32\drivers folder? You can also put it in the QB folder. Did you add the PortTalk.Reg to the registry? Widows will ask you to verify the edit!
Look for PPORT.ZIP and download that. There is a BAT file with the proper command line for PortTalk to run the PPORT.EXE program. It is already set for LPT 888. You should also see the Status (889) and Control (890) addresses. When the base port is accessed, you can also access those ports. 889 is Read only, but 888 and 890 are write and read. 890 normally reads 12.
When you are using the program just enter the number 32 to reverse the data port. When you enter any number below 32, the data will appear again, but it will also be increased by the program a bit. Some LPT ports are not reversable, but most newer ones are!