View previous topic :: View next topic |
Author |
Message |
philm
Joined: 14 Jul 2004 Posts: 138 Location: Australia
|
Posted: Sun Sep 19, 2004 2:10 am Post subject: Hyperterminal Hangs? |
|
|
When I use ANSI/VT100 terminal control escape sequences, after a time, Hyperterminal hangs my computer. It works fine for a little while, but then hangs.
Code: | '***************************************************************
'ANSI Clear Screen
'***************************************************************
Ansicls:
Printbin 27 ; 91; 'escape [
Print "2J"; 'erase screen
Return
'***************************************************************
'ANSI Locate
'***************************************************************
Sub Ansilocate(byval Row As Byte , Byval Col As Byte)
Printbin 27 ; 91; 'escape [
Print Row ; ";" ; Col ; "H"; 'force cursor position
End Sub
'***************************************************************
'ANSI Clear current line
'***************************************************************
Ansiclrline:
Printbin 27 ; 91; 'escape [
Print "2K"; 'erase the current line
Return |
Is there a better (free) ANSI/VT100 terminal emulation prog?
Thanks
Phil |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sun Sep 19, 2004 2:13 am Post subject: |
|
|
When the BASCOM terminal emulator does work, i can create a stand alone terminal emulator when you can not find another one. _________________ Mark |
|
Back to top |
|
|
Frankeman
Joined: 11 Aug 2004 Posts: 948 Location: the Netherlands
|
Posted: Sun Sep 19, 2004 9:16 am Post subject: |
|
|
Hi,
Do you know when HyperTerminal hangs or is it random ?
Is it possible that you send invalid esc codes ?
Frank. |
|
Back to top |
|
|
philm
Joined: 14 Jul 2004 Posts: 138 Location: Australia
|
Posted: Mon Sep 20, 2004 12:00 am Post subject: |
|
|
Mark,
The inbuilt terminal emulator does not hang, but it after a while it shows a blank screen. All I can see is the cursor moving around to the correct positions, but no characters.
Frank,
I am using serial at 38400 and stream constant data.
I suspect that hyperterminal hangs when it's input buffer overflows. I have a slow (330MHz) computer, and do not use any handshaking.
So I would guess that other programs will do the same or similar.
Maybe Mark can include xon/xoff flow control into all the print statements (only joking).
Maybe it is a good excuse to get a new computer.
Phil |
|
Back to top |
|
|
Frankeman
Joined: 11 Aug 2004 Posts: 948 Location: the Netherlands
|
Posted: Mon Sep 20, 2004 10:21 pm Post subject: |
|
|
Hi Phil,
I wrote a little test program
Code: |
$regfile = "8052.dat"
$baud = 57600
$crystal = 11059200
dim a as long
do
print a
incr a
loop
end
|
With this received on a P4 3Ghz terminal emulatie never craches.
A super high baudrate is in some case not effective.
For example if you have a processor running at 1 Mhz and a baudrate of 256000 the processor can simply not make the data to send in one contant stream.
In my test prog with a baudrate of 19200 the counter is at 4000 after one minute.
When i increase the baudrare to 57600 (3 times faster) the counter is at 4300 after one minute.
Thus not 12000 what you might have been expected.
A baudrate of 19200 is mostly the highest speed to send data.
Frank. |
|
Back to top |
|
|
philm
Joined: 14 Jul 2004 Posts: 138 Location: Australia
|
Posted: Tue Sep 21, 2004 12:33 am Post subject: |
|
|
Yes the program as a whole will not run 3 times faster, but the "print a" statement will run 3 times faster.
what happens if you run this.
Code: |
$regfile = "8052.dat"
$baud = 57600
$crystal = 11059200
declare sub Ansilocate(byval Row As Byte , Byval Col As Byte)
dim a as byte
gosub Ansicls
do
Ansilocate(10, 10) 'locate somewhere
print a;
incr a
if a = 0 then gosub Ansicls 'clear screen every 256 iterations
loop
end
Ansicls:
Printbin 27 ; 91; 'escape [
Print "2J"; 'erase screen
Return
Sub Ansilocate(byval Row As Byte , Byval Col As Byte)
Printbin 27 ; 91; 'escape [
Print Row ; ";" ; Col ; "H"; 'force cursor position
End Sub |
|
|
Back to top |
|
|
Frankeman
Joined: 11 Aug 2004 Posts: 948 Location: the Netherlands
|
Posted: Tue Sep 21, 2004 6:31 pm Post subject: |
|
|
Quote: | what happens if you run this.
| I get compiler errors ,Your example is Bascom AVR code i use Bascom 8051.
The program works fine, hyperterminal don't hangs. |
|
Back to top |
|
|
|