PDA

View Full Version : hyperterminals commands



santamaria
- 12th November 2005, 18:47
i would like to know some commands to sent from pic to hyperterminal like clear screen e.t.c


thanks

Dave
- 12th November 2005, 19:25
santamaria, I use VT-100 commands for terminal control. If you do a search for VT-100 commands you will find quite a list. Here are some control codes I have used in the past to control ternimals connected to my products:
' ************************************************** ********
INITS: 'INITIALIZE TERMINAL

CLRS:
SEROUT2 TX1,TX1BAUD,[27,91,72] 'HOME CURSOR
SEROUT2 TX1,TX1BAUD,[27,"[1J"] 'CLEAR SCREEN
RETURN

************************************************** ********
POSITION: 'POSITION CURSOR ON LINE & COLLUM
SEROUT2 TX1,TX1BAUD,[27,91,"H"]
SEROUT2 TX1,TX1BAUD,[27,91,DEC LINE,";",DEC COLLUM,"f"]
RETURN

Dave Purola,
N8NTA

santamaria
- 13th November 2005, 09:38
thanks for your quick answer.i check this commands that you post and working fine.i will search it for more commands.

santamaria

Darrel Taylor
- 13th November 2005, 20:05
Hi santamaria,

ANSI codes for Hyperterminal
http://www.pbpgroup.com/modules/wfsection/article.php?articleid=9
<br>

ptig185
- 5th December 2006, 18:17
Darrel,
I included your ansi.inc file and tried a compile but mpasm gave errors.

sonmething about "found label after column 1" and
a few illegal charcters.

I'm using pbp in Microcode studio and Mpasmwin.

I only included the .inc file and did not use any of the macros.

thanks,
Brian

Darrel Taylor
- 5th December 2006, 20:50
Hi ptig185,

Make sure you have at least 1 HSEROUT statement in your main program.

The include file uses the HSEROUT?C macro's, but it doesn't uses an HSEROUT itself. So PBP doesn't include the HSEROUT?C macro unless you have an HSEROUT statement somewhere in your program.

HTH,

ptig185
- 6th December 2006, 12:51
Darrel,

I added the HSEROUT command and that worked but the CurMove command gives me some errors. I'm using MPASM in Microcode studio.

Thanks,
Brian M.
===============================
define osc 20
define i2c_slow 1 '20mhz requires slower transfers in seeprom
include "modedefs.bas"
include "ansi.inc"

HSEROUT [10,13]
@ ClrScr
@ Blink
@ BackColor blue
@ CurMove 1, 2 'errors here

Darrel Taylor
- 6th December 2006, 13:09
Try adding this at the bottom of your program.



@ ifdef doesnotcompile ; force PBP to include the HSEROUTDEC? macro
HSEROUT [DEC 1]
@ endif

ptig185
- 6th December 2006, 13:27
That fixed it but it would not compile with just the

HSEROUT [10] Before or After the CurMove command

ptig185
- 6th December 2006, 13:32
Now it won't compile once again!???!!!!
It did compile a few time then I tried adding the HSEROUT back in jsut after
the CurMove command and it did not compile. Now it won't compile.


'=================== myfile =================
'file: AnsiTest.bas

define osc 4
include "modedefs.bas"
include "ansi.inc"


Row var byte
Col var byte
Row=1
col=1
SerPinOut var portC.6 'Usart output TX
SerPinIn var portC.7 'Usart input RX


@ ClrScr
@ Blink
@ BackColor blue
@ ForColor yellow
@ CurMove 1,2
@ RequestCurPos

' HSEROUT [DEC 10]

''TermColor ForegroundLightDark, Fore0groundColor, BackgroundColor
''@ TermColor Yellow, Blue

'HSEROUT [10,12]

'row=15:col=15
' serout2 PortC.6,16468,[27,91,DEC row,59,DEC Col,72]

'POSITION: 'POSITION CURSOR ON LINE & COLLUM
'SEROUT2 SerPinOut,16468,[27,91,"H"]
'SEROUT2 SerPinOut,16468,[27,91,DEC Row,";",DEC Col,"f"]


@ ifdef doesnotcompile ; force PBP to include the HSEROUTDEC? macro
HSEROUT [DEC 1]
@ endif

ptig185
- 6th December 2006, 13:49
This is strange, I commented all the ansi stuff out. Then brought it back in
a bit at a time and now it will compile. ??????????

I tried deleting all the output files but that did not help. Now it's compiling
once again.

Brian

ptig185
- 6th December 2006, 17:22
Found something....
It seems that there needs to be at least 2 items in the HSEROUT command

If I do: HSEROUT [DEC 1] it fails to compile.

but if I use: HSEROUT[DEC 1,2] it will compile.


'file: AnsiTest.bas

define osc 4
include "modedefs.bas"
include "ansi.inc"


Row var byte
Col var byte
SerPinOut var portC.6 'Usart output TX
SerPinIn var portC.7 'Usart input RX

Row=1
col=1

@ ClrScr
@ Blink
@ BackColor blue
@ ForColor yellow
@ CurMove 1,2
@ RequestCurPos

HSEROUT [DEC 1,12]
'HSEROUT [DEC 1]

Darrel Taylor
- 6th December 2006, 23:02
Yup, that'll work too.

Anything that will cause PBP to include both the macro's

<pre>HSEROUT?C ; HSEROUT [1]<br>HSEROUTDEC? ; HSEROUT [DEC 1]</pre>Normally these will already be in your program somewhere, so you don't need to worry about it. But since you're starting from scratch with nothing but the include file, they aren't in there yet.

Hope the rest works out for you.
<br>