[comp.lang.pascal] Serial COM port communication

H.Jones@massey.ac.nz (H.S. Jones) (06/05/91)

I am looking for a unit which will allow me to read and write data to and
from _BOTH_ serial COM ports on an AT computer.  At present I am using TP
4.0 and using the unit ASYNC4 written by  Quinlan and Dealey but this only
works for one port at a time.  I am using each port to run a separate stimulus
controlled by an external microprocessor and it is now required that they
run simultaneously.  The ASYNC4 unit includes an interrupt service
routine written in machine language but only addresses the one port which
has been opened.  I really don't want to re-invent the wheel but perhaps
there is someone out there who is also crazy enough to use two serial ports.

	Thanks in advance,  (I hope)
	Harvey

-- 

| Harvey Jones				Email - H.Jones@massey.ac.nz
| Psychology Department			Fax   - (06) 3505-611
| Massey University			Phone - (06) 3569-099 Ext 8198
| New Zealand.

H.Jones@massey.ac.nz (H.S. Jones) (06/10/91)

Re Multiple Serial COMM port access

>I am looking for a unit which will allow me to read and write data to and
>from _BOTH_ serial COM ports on an AT computer.  At present I am using TP
>4.0 and using the unit ASYNC4 written by  Quinlan and Dealey but this only
>works for one port at a time.  I am using each port to run a separate stimulus
>controlled by an external microprocessor and it is now required that they
>run simultaneously.  The ASYNC4 unit includes an interrupt service
>routine written in machine language but only addresses the one port which
>has been opened.  I really don't want to re-invent the wheel but perhaps
>there is someone out there who is also crazy enough to use two serial ports.
>

For those who replied to my problem regarding multiple serial port
communication I thank you.  For others who have wondered how I will give a
short breakdown of answers sent to me.


-------------------------- Letter Seperator -----------------------------
From: Othmar Wigger <owigger@physik.unizh.ch>
Subject: Re: Serial COM port communication
Organization: Physics Institute, University of Zuerich, Switzerland


You don't want to reinvent the wheel --- you're absolutely right.
Although, when I had the same problem some time ago, it's exactly
the thing I did. The result was the unit Serial2 which I am happy
to share with you. I never posted it or archived it anywhere, 
because there are some similar packets around, and I am for
standardisation of commonly used libraries. Still, if somebody
seems very much to need exactly what I have, I can help out.
I think that in the meantime, it's very well tested and bugfree.
The data acquisition system I wrote it for in the first place
is still up and running here in Zurich.

By the way, I used it under Turbo Pascal 5.0 and 5.5. I am not
sure if it will do with 4.0, but probably it will.

-----------------------------------------------------------------------
Othmar Wigger     Physikinistitut der Universitaet      CH-8001 Zuerich 
phone +41 1 2572904                             owigger@physik.unizh.ch
-----------------------------------------------------------------------

Note :- From HJones **
	I have used this version in my program and it works fine (at
present anyway).  I had to move up to Turbo Pascal 5.0 to use it however
which was not a problem.  The unit used a TYPE = Function which Version 4
would not cope with.

-------------------------- Letter Seperator -----------------------------


  Try to get ahold of ASYNC12. I'm not sure if it's newer or older, but I
think it may allow you to have up to 4 serial ports open at once. If you
want, I can send it to a FTP site that supports anonymous logins. Also, if
that fails to support multiple open serial ports, then I have a crude
example of how to set up the PIC to detect data being received through
a serial port... such a setup would allow your program to run without
having to monitor the serial ports all the time and you could have up to
4 ports open at once (more if you had the capability of installing more
serial ports).

-- 
+---------------------------+----------------------------------------------+
| Chris Wood                |  "If you can't convince them, confuse them." |
| woodc@jacobs.cs.orst.edu  |                                   -unknown   |
+---------------------------+----------------------------------------------+


-------------------------- Letter Seperator -----------------------------

Here are some texts that I've found useful:

    Advanced Techniques in Turbo Pascal
	Charles C Edwards, 1987 Sybex Inc.
	(The code is for version 3.0, but it isn't too hard to adapt
	the code for later versions)
    NS1600 Databook, National Semiconductor
	Real helpful to read this to become familiar with the 8250.
    IBM-XT Technical Reference, IBM


-------------------------- Letter Seperator -----------------------------

I had this problem when i wanted to control a MC68hc11 evaluation board
that had two serial ports on it. I use TP5.5 so I downloaded the
LiteComm toolbox off sol.deakin.edu.au ( simtel mirror ) site in the
pub/PC/simtel-20/turbopas directory. You will need the version for tp4.0
which i think there is.

This toolbox supports up to four serial ports....
I will get the programs for you if you have any trouble getting them
off the deakin server ( ip address is 184.128.1.1 )

          **********************************************

	There was also a suggestion to use `Blaise Turbo Asynch Plus'
which works but is not in the public domain (Also costs US$350).

	I used Othmar Wigger's unit in my program which requires TP 5.0
or above mainly because it arrived first and did what was required.  It
works very well so far and fits into my existing program without any
major modifications.

	I am sure some of the other public domain units are fine too and
have listed them above as given to me.

	Thank you again for your help.

Harvey.

-- 

| Harvey Jones				Email - H.Jones@massey.ac.nz
| Psychology Department			Fax   - (06) 3505-611
| Massey University			Phone - (06) 3569-099 Ext 8198
| New Zealand.