Weird Serial Comm Issue With Windows

I ran into a weird issue, and I'm curious for any insight.

I'm writing Win32 software to monitor two serial lines. I was 100% sure I got it right. The thread code is here:

formatting link

(You can get to the other code by backing up the tree--I think everyone has seen ViewVC.)

I used a laptop running HyperTerminal (was on the computer) to send characters. I would type a character on the laptop and expect my program (running on my desktop) to display it.

I would get the effect that:

a)As long as I would type a different character than the last one I typed, no issue.

b)If I would continue to type the same character (such as "k" repeatedly) I would get an alternating pattern of "k" and a strange symbol that probably had a code above 127. The same applied for most of the other characters.

The effect is illustrated here:

formatting link

where you can see the funny characters (click on the thumbnail to get the full-res image).

I was very suspicious, because my program uses communication timeouts and I thought maybe I had done something wrong. But I couldn't find any problem in my program.

So, I decided to download and install RealTerm

formatting link

RealTerm works fine as a sender of characters. There are no issues with RealTerm.

Why the difference between HyperTerminal and RealTerm?

Why only when I type the same character over and over again?

Is this encoding or some sort of software error.

Any other explanations?

Thanks, The Lizard

Reply to
Jujitsu Lizard
Loading thread data ...

formatting link

Just a quick observation, the "odd" characters happen to be the normal character's code + 128 in the DOS (US) charset.

Reply to
Grinder

This is a well-known problem that has been part of HyperTerminal for many years. Simply avoid HyperTerminal and use a freeware alternative like TeraTerm or RealTerm (which you're already mentioned).

Reply to
Tom

HyperTerminal lives up to its name. It is a terminal emulator program and it managed to get me very hyper looking for a bug in my program!

Seems like a very odd bug, though.

The Lizard.

Reply to
Jujitsu Lizard

Either there is a baud rate problem, or stop bit/parity etc. or you need an inter byte gap.... hard to tell without getting a 'scope on it and I can't do that from here :) There are lots of alternatives to HT, I use Simple Term Gold. One huge benefit is you can send strings/multiple strings, separated by 'gaps etc, done via macros and u can execute a complete macro, or line by line. Ptronix.com cost is £30 or $60. I have no attachment to this company...

Reply to
TTman

Yup. Hyperterminal is and always has been a steaming pile. It's got many odd bugs (and none of them ever get fixed). Use teraterm or kermit or something else reliable.

--
Grant Edwards                   grante             Yow! Was my SOY LOAF left
                                  at               out in th'RAIN?  It tastes
 Click to see the full signature
Reply to
Grant Edwards
[...]

can you describe this bug indetail or name some source where I gan read more?

TIA,

Oliver

--
Oliver Betz, Munich
despammed.com might be broken, use Reply-To:
Reply to
Oliver Betz

The bug is easy to replicate:

- Get a null modem cable

- Get a PC with two serial ports COM1 and COM2 (or two PCs with one serial port each)

- Connect the null modem cable between COM1 and COM2

- Start HyperTerminal

- When it asks for the name of the connection, enter "mytest"

- Select COM1

- Select 2400 baud, 8 data bits, no parity, 1 stop bit, no flow control

- Now look at the bottom of the screen, the first three items should say "Connected 0:00:01" "Auto detect" "Auto detect"

- Now start any terminal program you want (you can even run another copy of Hyperterminal if you want) and connect it to COM2 with the same settings,

2400:8:N:1

- In the window with HyperTerminal, type "abcdefg" and you will see "abcdefg" come up on the other window

- Now type "hhhhhhhhhhh" and you will see "hh*h*h*h*h*" where the * is actually ASCII character 232 which is the ASCII code for h (104) plus 128.

The only way to work around this bug is to actually send 3 or more UNIQUE bytes to the HyperTerminal in question. This will cause the second item in the status line to change from "Auto Detect" to "2400 8-N-1" and then everything will work properly from that point on. You can even save the session at that point and it work fine the next time you load it.

This problem has been there for over 10 years since it was present in the HyperTerminal that came with Windows 98.

Too many people have wasted too much time on this already. It's really best to just move on.

Reply to
Tom

Tom,

Thanks for this post. It really contains a lot of good information.

I'll have to say, when HyperTerminal did this to me, I was really worried about the correctness of my program that receives serial characters. Thank goodness for an easy-to-find free alternative (suggested by someone else on a newsgroup) so that I could verify what was happening. I was really frustrated because it looked like I was doing everything right in my program.

As it ended up, I was.

If there hadn't been an alternative that I could just download and try, I might have wasted lots of time on this.

The Lizard.

Reply to
Jujitsu Lizard
[...]

[...]

Thanks for the description. support.microsoft.com/kb/892143 also describes the problem, but not correctly/completely.

correct, either from the predefined connection menu or by passing a

*.ht file. One reason why I never observed it myself, I always start Hyperterminal with a *.ht file.

Hyperterminal _saved_ me a lot of time because the service people all have Windows notebooks and I can explain them in under a minute how to get up a terminal session to our devices in the field. No internet connection and no installation needed.

Gladly my devices send a greeting, so even a fresh HT connection doesn't suffer from the problem.

Regarding RealTerm: Not suitable for the average user. Seems to need administrator privileges to run, crashes on my PC when run as "user".

I heared that Tera Term has problems when receiving garbage.

Among the many terminal programs I have been testing in the past (see

formatting link
I didn't find the "perfect" one. It depends on the application and the user which one is "the best".

Oliver

--
Oliver Betz, Munich
despammed.com might be broken, use Reply-To:
Reply to
Oliver Betz

On Mon, 22 Dec 2008 14:45:36 +0100, Oliver Betz wrote: [snip...snip...]

Good info, thanks!

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

Oliver Betz schreef: Among the many terminal programs I have been testing in the past (see

I quit liked uCon, part of the MicroMonitor package, but can be downloaded free at :

formatting link

Not just serial, but telnet or PuTTy also, and scripting....

Since it is not mentioned on your page I thought I should mention it here.

regards, Hans Bus

Reply to
Hans Bus
[...]

a somewhat more detailed description _what_ you like would have been useful.

I dislike that it forces me to run an installer instead of simply unpacking a bunch of files somewhere and that it supports only a small number of predefined bit rates.

Oliver

--
Oliver Betz, Munich
despammed.com might be broken, use Reply-To:
Reply to
Oliver Betz

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.