Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:30 02 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 : VAR CLEAR

     Page 6 of 7    
Author Message
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 04:09am 22 Jan 2019
Copy link to clipboard 
Print this post

I wish you hadn't said that!

Peter
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 04:20am 22 Jan 2019
Copy link to clipboard 
Print this post

one of the important things seems to be that the firmware is freshly installed. after some small quantity of use, the 'fault condition' that exists in a fresh 5.05.01 intall is cleared. even typing 'new' may be sufficient to permanently fix the issue, though i've not explored this fully.

paul: try using pic32prog to install the firmware, then follow the exact same steps i did. if necessary, type the basic program into the edtor by hand using teraterm - mmedit may well inadvertently clear the fault condition before it shows up.


cheers,
rob :-)
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 04:22am 22 Jan 2019
Copy link to clipboard 
Print this post

I found a setup that can display the error.
I tried V5.5.1 and 5.5.2 beta1 and Windows 10.

Using Robs method
load firmware with pic32prog
edit
paste the program
F2
"error"

If I type "new" before entering the editor.
no errors

Typing NEW first works for me with a freshly flashed chip.

Typing NEW is second nature to me. It solves a lot of problems.

Jim
Edited by TassyJim 2019-01-23
VK7JH
MMedit
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 04:23am 22 Jan 2019
Copy link to clipboard 
Print this post

Found another chip that was flashed with 5.04.04 and it worked OK. Re flashed to
5.04.10 beta 10 (the only other one I have) and it failed. Tried 5.0501 again and it still fails.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 04:26am 22 Jan 2019
Copy link to clipboard 
Print this post

I suspect that's right Rob. I can't replicate the error after a hard reset. I don't see what Panky sees either.

If I do a hard reset and type VAR SAVE I get a syntax error because no variable has been defined or specified.

Bill
Keep safe. Live long and prosper.
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 04:33am 22 Jan 2019
Copy link to clipboard 
Print this post

@ Robert.Rozee
Did as you said and it failed.
But then I re flashed the chip with 5.0501 and this time instead of loading PeterB's code I loaded some other code and ran that first, then cleared that code and loaded PeterB's test code and it runs.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 04:40am 22 Jan 2019
Copy link to clipboard 
Print this post

Finally! I removed chip from one of my projects. Re-flashed it with V5.0501 and got the error.

Saved 53 bytes
[2] VAR restore
Error: Variable name
>
>
> list
Option autorun on
VAR restore
Do
Print "LLL"
Loop
>

Bill
Keep safe. Live long and prosper.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 04:42am 22 Jan 2019
Copy link to clipboard 
Print this post

  Turbo46 said   Finally! I removed chip from one of my projects. Re-flashed it with V5.0501 and got the error.

Bill

can you try again but this time enter NEW first before entering the editor

Jim
VK7JH
MMedit
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 04:44am 22 Jan 2019
Copy link to clipboard 
Print this post


I think my code can be reduced to:

OPTION AUTORUN ON
VAR SAVE

I just get a warm feeling seeing all those L's when it works.
They have been a long time coming but I am pleased you other blokes are seeing what I've been seeing.

Peter
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 04:51am 22 Jan 2019
Copy link to clipboard 
Print this post

It's life Jim but not as we know it (sorry)

Yes you knew it would work and it did. MMEdit is masking the problem by sending NEW. That's why I couldn't replicate the problem whilst using it.

Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 04:55am 22 Jan 2019
Copy link to clipboard 
Print this post

Peter,

Are you sure the 'warm feeling' is not because it's about 40 degrees outside?

Bill
Keep safe. Live long and prosper.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 07:08am 22 Jan 2019
Copy link to clipboard 
Print this post

Well, this is really interesting. It would seem that to see this issue, you have to have a fresh install of MMBASIC. Following any NEW or VAR CLEAR command on a fresh install, the problem does not happen. That is very interesting indeed, and if conclusively proven, is one HELL of a crafty bug you might have found there, Peter!

I will dig out a 170 and run some tests of my own and report back.

EDIT: Yes, the plot does indeed thicken.....








PROCEDURE: (With an E28 module)

1) Load 5.0501 in PIC32PROG
2) Press SELECT button for programmer mode
3) Program in 5.0501 HEX to E28
4) Connect to E28 using GFXterm
5) Type AUTOSAVE and press enter
6) Paste test code, then CTRL-Z
7) RUN

ERROR!

Tinker with this idea a bit, then issue VAR CLEAR, then run again - All L's.

I will now load an earlier version of MMBASIC and test if that works as expected. I think it actually will, based on other comment thus far.

EDIT: CONFIRMED!

If I flash 5.0408 into the same E28, use exactly the same procedure, and run the code - no error. This is intensely interesting. I think we do have a bug here in the newer versions of MMBASIC, when you try to VAR RESTORE on a fresh install. It's obscure, because it only ever seems to be a problem on a CLEAN INSTALL of MMBASIC, and then you run the code the first time. Subsequent running of the code will NOT show this issue. But if you are using a full HEX consisting of the MMBASIC interpreter, your own code, and previously saved variables, I can see this being a problem.Edited by Grogster 2019-01-23
Smoke makes things work. When the smoke gets out, it stops!
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 08:33am 22 Jan 2019
Copy link to clipboard 
Print this post

  Grogster said  
EDIT: CONFIRMED!

If I flash 5.0408 into the same E28, use exactly the same procedure, and run the code - no error. This is intensely interesting. I think we do have a bug here in the newer versions of MMBASIC,


All this time I have been lurking, in secret terror, on this thread. I have dozens of 170 based units installed in customer premises (Snooker table light controllers) and I have no problems on any but am crapping myself because if this suddenly starts it would be deeply embarrassing and a right royal PITA to get out and fix.

The clue to me having no problems and VAR <anything> working is busted wide open by Grogs above... I am still using 5.04.08 in production, purely because I have created an image of the code for the modules and flash that into brand new chips. Probably, developing the code on a warhorse 170 with 5.0408 has immunized the modules - the image is then pulled back using MPLAB and flashed into the production units.

I never considered myself to be especially lucky - until now. Genuinely feel I have dodged a bullet! Fantastic detective work guys.

Edited by CaptainBoing 2019-01-23
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 08:40am 22 Jan 2019
Copy link to clipboard 
Print this post

If you are using 5.04.08 in production, you WILL NOT SEE THIS ERROR.
If you keep using 5.04.08 for now, you will not see this error.

It seems to be specific to the newest versions of MMBASIC, and is a very obscure error, in my humble opinion. It's not easy to reproduce, but you CAN reproduce it with the correct sequence of events.
Smoke makes things work. When the smoke gets out, it stops!
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 10:27am 22 Jan 2019
Copy link to clipboard 
Print this post

I believe that if the programs run once then you won't have any problems. As PeterB said:

  Quote  I think my code can be reduced to:

OPTION AUTORUN ON
VAR SAVE


For some reason it needs the AUTORUN ON then VAR RESTORE very early in the program - maybe right at the beginning. I have several programs with those two instructions in the program running on V5.05.01 with no problems.

I normally use MMEdit which issues a NEW command but using TeraTerm to transfer my programs via Xmodem (no NEW command) I still have no problems,

I tried flashing a new chip and running a program with just the single instruction:

VAR RESTORE

and had no problem. I then edited the program using the internal editor to be:

OPTION AUTORUN ON
VAR RESTORE

and got the error. If you enter the NEW command or VAR RESTORE first (or later) the error does not occur and it doesn't re-occur. Very obscure.

Even stranger? I added a few extra lines to the program:

OPTION AUTORUN ON
OPTION EXPLICIT
DIM A AS INTEGER
DIM B AS STRING
DIM C AS FLOAT
VAR RESTORE

and still got the error. so I reduced the program to just:

VAR RESTORE

and got the error even though just running that single line program earlier without the OPTION AUTORUN ON command worked OK. So just to be sure - to be sure. I re-flashed the chip again, entered the one line program:

VAR RESTORE

no error - so I changed it to:

OPTION AUTORUN ON
VAR RESTORE

and got the error.

removed the OPTION AUTORUN ON and still get the error.

I hope all of that helps someone because I'm buggered. It's time to open a bottle of red. Cheers.

Bill

PS All of the above was done using TeraTerm and the internal editor.
Keep safe. Live long and prosper.
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 10:57am 22 Jan 2019
Copy link to clipboard 
Print this post

G'Day Bill

I think the "rules" for bringing on the fault are now clear although NEW is new to me.
As to why the "rule" works I dunno.
Re the bottle of red, can I bring my glass over?

Peter
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 11:26am 22 Jan 2019
Copy link to clipboard 
Print this post

has anyone pm'ed geoff to let him know the good news?


cheers,
rob :-)
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 11:32am 22 Jan 2019
Copy link to clipboard 
Print this post

Sure.

Because I use MMEdit I couldn't repeat your problem because, as part of downloading the program, it issues a NEW command. If you were using MMEdit I don't think you would have come across the problem in the first place. It was very confusing - it's good to have all the inquiring minds on the forum. Its been a long bumpy road to get to this point. I hope Geoff understands because I haven't a clue.

Bill

Edit: I just PM'd Geoff thanks Rob.Edited by Turbo46 2019-01-23
Keep safe. Live long and prosper.
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 07:29pm 22 Jan 2019
Copy link to clipboard 
Print this post

Even if AUTORUN ON is entered at the command prompt and then a program with var restore is loaded it fails.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 10:51pm 22 Jan 2019
Copy link to clipboard 
Print this post

G'Day all.

Grogster, you didn't say what version of windows you used.
When I started this second phase (was it only yesterday?) I said that it only fails with WIN 7 and rob added XP.
Are we now saying that it fails with all versions of windows?
That is interesting because nobody could replicate the fault for the first couple of weeks. Does that mean that every body starts with NEW or uses MMedit? both of which clear the problem by clearing the flash.

Geoff did comment on this problem several days ago.

Peter
 
     Page 6 of 7    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025