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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I "map" a Serial Port in QBasic?

Status
Not open for further replies.

robherc

Programmer
Apr 20, 1999
921
US
I am developing a high-tech app that must utilize I/O on ALL pins of a serial port while transmitting/receiving only a single bit @ a time.....but the program *MUST* be able to discern WHICH pin(s) it is receiving a "true" bit from at any given time (sorta like how your processor determines which key on the keyboard you press by which combination of a few connections is live. I am wanting to have @ LEAST 64 possible combinations, so ALL pins MUST be used (a pre-designated pin will be used for O to device(s), but the other 8 MUST ALL be functional for I from the device & I *cannont* get the necessary # of possibilities w/o knowing *exactly* which COMBINATION of pins is live @ a given moment)<br>
<br>
-Robherc<br>
robherc@netzero.net
 
If you are using QB45 you may be able to use the InterruptX library function to call interrupt 14, functions 01h & 02h (write and read characters to port). For the write, InRegs.DX = the port # (0-3), Inregs.AX = &H100 + (character to write in hex). Bit 7 of the high byte of OutRegs.AX is set on error and the rest contain port status data.<br>
<br>
Use InRegs.AX = &H200 to read a character. OutRegs.AX contains the line status data returned in 16 bits.<br>
Use InRegs.AX = &H300 to get the port status. The high byte in OutRegs.AX contains 8 bits of line status data and the low byte contains 8 bits of modem status data.<br>
<br>
Setting and monitoring the values for any given pin would be quite a trick using BASIC (probably a hardware solution needed here). Let me know how it goes... and GOOD LUCK.
 
ummm....thanks for the info & I'm sure it may be vastly helpful to me in the future, but right now it is really of little use in my current problem....I am wanting my computer to communicate with a bay of relays that have been engineered in several parallel & series circuits to perform AWESOME tasks.<br>
<br>
Alt255_<br>
I will be e-mailing you some CONFIDENTIAL information about this soon...just have to figure out how to word it so as to be at all comprehensible by any human ;-)<br>
<br>
All-<br>
PLEASE do not hesitate to post further responses, I still need a LOT of help with this thing.<br>
<br>
Thanks;<br>
-Robherc<br>
robherc@netzero.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top