Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:17 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : RC6 PRINT Problem?

Author Message
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 442
Posted: 04:15pm 13 Dec 2020
Copy link to clipboard 
Print this post

The following (it worked in RC5):
PRINT "FAULTY SPEEDOMETER SPOTTER!!"
PRINT
PRINT "SECONDS",@(120);"MILES PER HOUR"
PRINT "*******",@(120);"***** *** ****"


should print

FAULTY SPEEDOMETER SPOTTER!!

SECONDS       MILES PER HOUR
*******       ***** *** ****


Instead it prints

FAULTY SPEEDOMETER SPOTTER!!
              MILES PER HOUR
SECONDS

Edited 2020-12-14 02:22 by toml_12953
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 04:20pm 13 Dec 2020
Copy link to clipboard 
Print this post

Works for me as expected - try downloading and flashing again
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 442
Posted: 04:24pm 13 Dec 2020
Copy link to clipboard 
Print this post

  matherp said  Works for me as expected - try downloading and flashing again


Have you tried over the serial connection instead of to the screen? That's what I was running at the time.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 04:27pm 13 Dec 2020
Copy link to clipboard 
Print this post

I always run over the serial connection so I tend to miss screen issues rather than the other way round
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 442
Posted: 07:53pm 13 Dec 2020
Copy link to clipboard 
Print this post

  matherp said  I always run over the serial connection so I tend to miss screen issues rather than the other way round


What terminal emulator are you using? I tried TeraTerm and PuTTY on Windows.
Is it possible they don't respond to control codes properly?

I'll try to re-download anywway. If it works, then the verification function on the programmer doesn't work too good!
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 442
Posted: 08:04pm 13 Dec 2020
Copy link to clipboard 
Print this post

  toml_12953 said  
  matherp said  I always run over the serial connection so I tend to miss screen issues rather than the other way round


I have to mention that it does work in direct connection mode rather than serial.

What terminal emulator are you using? I tried TeraTerm and PuTTY on Windows.
Is it possible they don't respond to control codes properly?

I'll try to re-download anywway. If it works, then the verification function on the programmer doesn't work too good!

I just downloaded it again and reflashed. Now I get a different result over serial!

After a screen clear, I get this:

FAULTY SPEEDOMETER SPOTTER
              MILES PER HOUR
*******       ***** *** ****



But if I run again without clearing the screen, it runs normally and prints
FAULTY SPEEDOMETER SPOTTER

SECONDS       MILES PER HOUR
*******       ***** *** ****


I can run over and over without clearing the screen and the output is OK. The first run after a CLS always has the SECONDS missing.
Edited 2020-12-14 06:18 by toml_12953
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 08:47pm 13 Dec 2020
Copy link to clipboard 
Print this post

  toml_12953 said  
I'll try to re-download anywway. If it works, then the verification function on the programmer doesn't work too good!

Peter wants you to download the ZIP file again, not just re-flash. There was a problem with the first one he uploaded.

I can't see any problems with the latest firmware.

Jim
VK7JH
MMedit
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 442
Posted: 09:12pm 13 Dec 2020
Copy link to clipboard 
Print this post

  TassyJim said  
  toml_12953 said  
I'll try to re-download anywway. If it works, then the verification function on the programmer doesn't work too good!

Peter wants you to download the ZIP file again, not just re-flash. There was a problem with the first one he uploaded.

I can't see any problems with the latest firmware.

Jim


Yes, That's what I mean by re-download. I call sending the file to the computer flashing.
I have redownloaded the ZIP and re-flashed the firmware. Both TeraTerm and PuTTY have a problem when I first do a CLS. When they reach the bottom of the screen they don't show all the output either. Here's the whole program I was using:
10 PRINT "FAULTY SPEEDOMETER SPOTTER"
20 PRINT
30 PRINT "SECONDS",@(120);"MILES PER HOUR"
40 PRINT "*******",@(120);"***** *** ****"
50 PRINT
60 FOR T=70 TO 40 STEP -1
70   LET F=T/3600
80   LET R=1/F
90   PRINT T,@(120);R
100 NEXT T
110 END


When I first run it the word SECONDS is missing. After that, SECONDS shows up but some output is missing if the whole table would extend past the bottom of the terminal window.

P.S. Please look past the program itself. It's just an example to show corrupted output in terminal programs.
Edited 2020-12-14 07:15 by toml_12953
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 09:40pm 13 Dec 2020
Copy link to clipboard 
Print this post

When you use PRINT @(x), MMBasic translates the position into VT Escape codes such as <esc>[23;15f
The pixel position converts to character positions.
Normally, you would include the 'y' position as well.
MMBasic uses the current line and the y value if not provided.

In the example code you provided, the first few lines print without any location information and the first time you use location is before the "MILES"

IT is this mix of position printing and plain printing that confuses the terminal programs.

If you want your program to display correctly on terminals, it is safer to use full positioning (x,y) and for the whole display page, not just part of it.

It is also safer to start you program with a CLS.

MMBasic is sending the same information, but with CLS, the line number will be different compared with not doing a cls.


Jim
VK7JH
MMedit
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 442
Posted: 10:15pm 13 Dec 2020
Copy link to clipboard 
Print this post

  TassyJim said  When you use PRINT @(x), MMBasic translates the position into VT Escape codes such as <esc>[23;15f
The pixel position converts to character positions.
Normally, you would include the 'y' position as well.
MMBasic uses the current line and the y value if not provided.

In the example code you provided, the first few lines print without any location information and the first time you use location is before the "MILES"

IT is this mix of position printing and plain printing that confuses the terminal programs.

If you want your program to display correctly on terminals, it is safer to use full positioning (x,y) and for the whole display page, not just part of it.

It is also safer to start you program with a CLS.

MMBasic is sending the same information, but with CLS, the line number will be different compared with not doing a cls.


Jim


Thanks for your clear explanation! I don't use the serial interface very often but wanted to report a bug if it was one. Now I see it's not.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025