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

Serial port strange behavior

Status
Not open for further replies.

accacca

Technical User
Apr 18, 2011
3
IT
I am a beginner with Tcl and I start practice with wish85 console
under Win XP sp3
Mi goal is read incoming serial port chars
I use the com port on my PC. Com1 is open from TCL and Com2 from Hyperterminal. My console instructions are


% set comport [open com1 RDWR]
file12e2a18
% fconfigure $comport -mode 9600,n,8,1
% fconfigure $comport -blocking 0 -buffering none -translation binary
% fconfigure $comport -mode
9600,n,8,1
% set data [read $comport]
% set data [read $comport]
aaá
% fconfigure $comport -lasterror
% fconfigure $comport -pollinterval
10


the strange is: If from hyperterminal I type a random sequence like "kfsjhdklj" all work ok and the data var contain exactly the typed sequence
But if I type the same char three times like "aaa" the received sequence is wrong like "aaá" And this happens for all chars.
Also If I type "aa" and after few seconds (or minutes) I type the third "a" the result is the same, and receiving continues alternating "a" and "á" until I press another key. But after two times also the new character alternate whit a wrong value

I think this is not a buffer or polling problem but I have no idea how to fix it.
thanks for help
 
This sounds more like a problem in your hyperterminal rather than in Tcl as such. Check your emulation settings. It sounds like it's emulating like a cell-phone text message system.

_________________
Bob Rashkin
 
Thanks for reply.
Yes is a PC serial problem I don't understand why the serial port send a wrong char.
The serial port is mounted on a PCI board with MosChip and I can't see nonthing to configure.


But the main problem is solved!

Thanks again Bong
(and sorry for reply delay)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top