COM Ports Gone - Page 2

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Re: COM Ports Gone

don wrote:
Quoted text here. Click to load it

Are you using a loopback connector ? How does the TXD signal
get to the RXD signal ?

At a low baud rate (with little risk of buffer overflow), you
can just connect pin 2 to pin 3 with a wire. I find it easier to
just buy a soldertail RS232 connector, and join the two pins with
one of those.

In some configurations, with a loopback wire between TX and RX,
the application software has "echo" enabled, while the serial port
itself receives a character via loopback. In such a case, for
every letter typed, you see the letter *twice*. So you have
to be careful when doing that test, to account for whether echo
was being used or not. You might just be seeing the echo character
provided by the computer, rather than something traveling through
the serial port.


I plugged my serial mouse into COM3, fired up Hyperterm, used
1200 baud 8-N-1, and I can see garbage characters appear on the
screen if I move the mouse. That suggests the mouse is transmitting.
If I change the baud rate to 9600 on the computer end, Hyperterm
sees a stream of the letter "C" instead, implying the baud rate
isn't quite right. So the 1200 baud I was initially using (from
a previous experiment), might be close to the right value.

You could try that if you want. It's not much of a test, because
the mouse could be sending 8 bit codes, which may not make nice
7 bit printable characters on the Hypertrm screen. You need to
know more about mouse protocol, to formulate a better test.


Re: COM Ports Gone

Quoted text here. Click to load it

That isn't telling you anything.  The final >con rules the day.
"Take everything from the console and copy it back to the console."
That's not a serial test at all.

Andrew Smallshaw

Re: COM Ports Gone

to keyboard and composed:

Quoted text here. Click to load it

The "MODE COMx" command should tell you whether COM port x exists.

Otherwise, each COM port has a scratchpad register that is writeable
even in protected mode. For COM ports at 0x2F8, 0x3F8, 0x2E8, and
0x3E8, the respective scratchpad registers are 0x2FF, 0x3FF, 0x2EF,
and 0x3EF.

For example, the following debug session writes all ones, all zeros,
and alternate ones and zeros to the scratchpad register for COM2

 -d 40:0 f
 0040:0000  F8 03 F8 02 E8 02 00 00-78 03 78 02 00 00 13 02
 -i 2ff
 -o 2ff ff
 -i 2ff
 -o 2ff 00
 -i 2ff
 -o 2ff aa
 -i 2ff
 -o 2ff 55
 -i 2ff
 -d 40:0 f

A more interesting example involves transferring data between two DOS
boxes in Win98SE via the scratchpad register. Normally one DOS box
"owns" the COM port, so any changes made to UART registers in that
session will not appear in the other DOS box. However, the scratchpad
register does not appear to be protected in this way.

For example, let's write 0x55 to the scratchpad register 0x2FF in DOS
box A. If we now open DOS box B, we see that the value of 0x2FF is in
fact 0x55. Now go back to DOS box A and change the value to 0xAA. If
we switch to DOS box 2, the value is now 0xAA. Similarly, any changes
made in box B appear in box A.

However, the remaining 7 registers are all protected. For example, the
Line Control register (0x2FB) configures the word format. The default
value is 0x03 which corresponds to 1 stop, 8 data bits, no parity. If
we change this value to 0x02 (7 data bits), we find that the value of
this register remains at 0x03 in the other DOS box.

- Franc Zabkar
Please remove one 'i' from my address when replying by email.

Re: COM Ports Gone

Quoted text here. Click to load it


I still run a lot of Dos stuff.  Did you install a mouse driver?
In Dos you MUST have a mouse driver.  I cant recall where I got mine.
THere should be a file called MOUSE.EXE.  You need to add that to your
autoexec.bat file, or just put it in the path (like the dos folder),
and type mouse after bootup.  

I'm sure you can find one online.  I'd suggest that you install the
Dos that comes with Win98.  It's a little better than the 6.22, but it
does lack a few commands.  You can keep the missing commands from 6.22
and run them in the Win98 version of dos.

You do have autoexec.bat and config.sys installed, right?

Sample autoexec.bat

@echo off
Set Boot=c:
PATH  C:\;C:\Windows;C:\DOS
LH /L:0;1,25168 /S c:\dos\mouse.exe

Site Timeline