Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Bascom Terminal Emulator: Carriage return and Line feed and

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Unsupported versions
View previous topic :: View next topic  
Author Message
Zodiac

Bascom Member



Joined: 07 Sep 2014
Posts: 5

PostPosted: Sat Oct 25, 2014 5:47 am    Post subject: Bascom Terminal Emulator: Carriage return and Line feed and Reply with quote

I need some help with regard to displaying data obtained from the ATMEGA88 board to Basom's terminal emulator. I would like to do advance in nice easy to understand steps so please bear with me if the pace seems a little slow.

Problem 1
My program reads a single channel of data approx once per second and then sends out the following to the terminal emulator using a print statement. For example, Print "The voltage is " ; Volt ; " Volts"

Typically, the output that appears on the terminal emulator is as follows :-

The voltage is 0.8203125 Volts
The voltage is 0.766601562 Volts
The voltage is 0.76171875 Volts
The voltage is 1.313476562 Volts
The voltage is 1.870117187 Volts
The voltage is 2.202148437 Volts
The voltage is 2.485351562 Volts
The voltage is 2.79296875 Volts
The voltage is 3.1640625 Volts
The voltage is 3.481445312 Volts

HOWEVER, I wish all the reading to update the same single line RATHER than scrolling multiple lines off the screen. Now, either the Bascom Print routine or the terminal emulation program is inserting a carriage return and line feed that is causing the lines to scroll off the screen. I suspect that it's Bascom's Print statement that is sending the CR and LF ; but, I can't get the Terminal Emulator to ignore them despite selecting the VT100 or any other of the terminal emulators listed. I was hoping to be able to control the cursor; but, apart from: Line feeds and Carriage returns, Horizontal and vertical tabs nothing else works and only gives weird characters. I can't get a backspace to work Chr(0Cool and there seems to be no way to move the cursor up.

Is there anyway to control the cursor position of the terminal emulator using any of the ASCII codes with a particular terminal type selected? Also is there anyway to send a command to the terminal emulator instructing it to clear the screen without doing lots of line feeds?
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sat Oct 25, 2014 9:23 am    Post subject: ANSI... Reply with quote

Do an search on ANSI in google and download TeraTerm terminal program.

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 320
Location: Japan

japan.gif
PostPosted: Sat Oct 25, 2014 12:50 pm    Post subject: Reply with quote

If a return code setup of your terminal is "CR" only, it should work with the following programs.

Print "The voltage is " ; Volt ; " Volts" ; Spc(15) ; Chr(&H0d);
Back to top
View user's profile Visit poster's website
Zodiac

Bascom Member



Joined: 07 Sep 2014
Posts: 5

PostPosted: Sat Oct 25, 2014 4:42 pm    Post subject: Reply with quote

To: Ben Zijlstra

I have looked up the ANSII standard as suggested and it looks like a whole world has opened up!! Thanks!

However, having found and downloaded Tera Term and made the appropriate settings it just seems sits there with a Blank Screen!

My board, with it's Bascom programmed ATMEGA88, is connected to my lap top via COM Port 9. The program is simple: it sends out voltage readings every few seconds via the USB to Basocm's Terminal Emulator where it is then displayed (incorrectly for me anyway) as described in an earlier post. However, when I close or shut down the Bascom IDE my board still continues to run (which is what I would expect) and I know that it is still sending out the voltage data via the USB because I have a flashing led to indicate this status condition. Now, when, I run Tera-Term it is my guess that it then tries to re-initialise port 9, and, in so doing it terminates my Bascom program running on the ATMEG88. This would explain why Tera-Term is just sitting there blank, because before it has had time to display anything the program was stopped from sending anything out!

So, my Question is how do I enable the Tera-Term terminal program without causing it to prematurely terminate the program running on the ATMEGA88?


Steve Zodiac
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sat Oct 25, 2014 5:46 pm    Post subject: Serial port setup.... Reply with quote

Check in TeraTerm the serial port settings. Setup, serial port, flow control. It should be on 'none'.

Hyperterminal can also be put in ANSI-mode by the way...

And this is the Bascom - ANSI way to clear the screen

Code:
Print Chr(&H1b) ; "[2J"; ' ANSI goto 0/0


Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Unsupported versions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum