[comp.os.msdos.programmer] problems with com3 & com4

kaos@frey.newcsatle.edu.au (Iain `Kaos' Holmes) (01/25/91)

	i have been working on a program to read and write com ports 3 & 4

	i can get com 1 & 2 to work but i can't seem to make 3 & 4 work

	i get the addresses out of the bios data area and they seem right 

	cause i can write to the ports and they react but i think the interupts

	are screwy...

					can anyone help here ?

						thanks in advance,
								iain.

-- 
    Iain "Kaos" Holmes.            +---------+ 
 ACSnet :kaos@frey.nucastle.edu.au |   ~ ~   | Remember, Always keep your feet
                                   |  (o o)  | on the ground, your eye on the 
 Phone : (049) 26-2926 home        |   (_)   | clock, your finger on the pulse

py@meadow.uucp (Peter Yeung) (01/27/91)

In article <1991Jan25.054228.157@frey.newcsatle.edu.au> kaos@frey.newcsatle.edu.au (Iain `Kaos' Holmes) writes:
>
>	cause i can write to the ports and they react but i think the interupts
>
>	are screwy...
>

Which interrupt are you using? Since the original PC does not have provision
for com3/4, the interrupt to be used is implementation dependent.
Most implementations chose to share the interrupts with those being used
by com1/2. Also, typically, those async cards supporting com3/4 also allow
the user to choose the interrupt/port address etc. So, make sure you are
catching the interrupt same as the one setup on the card!

>-- 
>    Iain "Kaos" Holmes.            +---------+ 
> ACSnet :kaos@frey.nucastle.edu.au |   ~ ~   | Remember, Always keep your feet
>                                   |  (o o)  | on the ground, your eye on the 
> Phone : (049) 26-2926 home        |   (_)   | clock, your finger on the pulse


-- 
Peter Yeung     Amdahl Canada Ltd., Software Development Center
                2000 Argentia Road, Plaza 2, Suite 300
                Mississauga, Ont.   L5N 1V8
                Phone: (416) 542-6300    Fax: (416) 858-2233

resnicks@netcom.UUCP (Steve Resnick) (01/29/91)

In article <1991Jan27.034726.15865@meadow.uucp> py@meadow.UUCP (Peter Yeung) writes:
>In article <1991Jan25.054228.157@frey.newcsatle.edu.au> kaos@frey.newcsatle.edu.au (Iain `Kaos' Holmes) writes:
>>
>>	cause i can write to the ports and they react but i think the interupts
>>
>>	are screwy...
>>
>
>Which interrupt are you using? Since the original PC does not have provision
>for com3/4, the interrupt to be used is implementation dependent.
>Most implementations chose to share the interrupts with those being used
>by com1/2. Also, typically, those async cards supporting com3/4 also allow
>the user to choose the interrupt/port address etc. So, make sure you are
>catching the interrupt same as the one setup on the card!
>

COM3 & COM4 have defined, standard addresses and IRQ settings. 
	COM3 Uses a base address for the UART at 3E8 and IRQ 4
	COM4 Uses a base address for the UART at 2E8 and IRQ 3

The interesting thing is that if you are using interrupt driven communications
on, say, COM1 and COM3, you will need to determine the source of the interrupt
based on the IID register on both UARTS. I don't know what happens if 
interrupts happen simultaneously.

Hope this helps,
Steve



-- 
-------------------------------------------------------------------------------
resnicks@netcom.com, apple!camphq!105!steve.resnick, IFNA:	1:143/105.0, 
USNail: 530 Lawrence Expressway, Suite 374 
        Sunnyvale, Ca 94086
- In real life: Steve Resnick. Flames, grammar and spelling errors >/dev/null
0x2b |~ 0x2b, THAT is the question.
-------------------------------------------------------------------------------

roger@wrq.com (Roger Fulton) (01/29/91)

In article <22167@netcom.UUCP> resnicks@netcom.UUCP (Steve Resnick) writes:
>COM3 & COM4 have defined, standard addresses and IRQ settings. 
>	COM3 Uses a base address for the UART at 3E8 and IRQ 4
>	COM4 Uses a base address for the UART at 2E8 and IRQ 3

COM3 and COM4 do NOT have "standard" IRQ settings.  It is *somewhat*
common for software to default COM3 to IRQ4 and COM4 to IRQ3, but
it is NOT a standard.

The only COM ports whose IRQ's are cast in stone are COM1 (IRQ4) and
COM2 (IRQ3).


Roger Fulton
roger@wrq.com

resnicks@netcom.UUCP (Steve Resnick) (01/30/91)

In article <15344@milton.u.washington.edu> roger@wrq.com (Roger Fulton) writes:
>In article <22167@netcom.UUCP> resnicks@netcom.UUCP (Steve Resnick) writes:
>>COM3 & COM4 have defined, standard addresses and IRQ settings. 
>>	COM3 Uses a base address for the UART at 3E8 and IRQ 4
>>	COM4 Uses a base address for the UART at 2E8 and IRQ 3
>
>COM3 and COM4 do NOT have "standard" IRQ settings.  It is *somewhat*
>common for software to default COM3 to IRQ4 and COM4 to IRQ3, but
>it is NOT a standard.
>
>The only COM ports whose IRQ's are cast in stone are COM1 (IRQ4) and
>COM2 (IRQ3).

I dunno, every, I mean *every* serial adaptor I have used which had settings
for COM3 and COM4 used the same IRQ's as COM1 and COM2. I suppose you could
take over the IRQ for LPT1 or LPT2 (IRQ7 and IRQ5) but those are the only
available IRQ's on the Master (and on an XT only) PIC. IMHO, the ideal
IRQ's to use would be 3 & 4, although if you used the printer IRQ's you
might get better interrupt service, but I have never tried this ....


Cheers!
Steve

-- 
-------------------------------------------------------------------------------
resnicks@netcom.com, apple!camphq!105!steve.resnick, IFNA:	1:143/105.0, 
USNail: 530 Lawrence Expressway, Suite 374 
        Sunnyvale, Ca 94086
- In real life: Steve Resnick. Flames, grammar and spelling errors >/dev/null
0x2b |~ 0x2b, THAT is the question.
-------------------------------------------------------------------------------