Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:46 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 2 of 7    
Author Message
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 12:19am 06 Jan 2019
Copy link to clipboard 
Print this post

G'Day Bill

I was hoping someone would:
a. find it useful
b. yes, I have had the same problem
c.explain what happened

I don't think my program could have filled the memory.
Am I correct in assuming the memory was full.

"I am a bear of very little brain" (WTP)

Peter

Paul?

Grogster.
Your post came as I was writing mine.
I generated quite a long program and got it going using your (dog eared)chip but did not include the VAL code.
Once I was happy with the code I changed to a new chip and added the VAL SAVE code with no problems.
I then added VAL RESTORE and got a message about some variable???
From then on the system degraded over time and eventually VAL SAVE would cause a reboot.
From then on I tried every thing plus a bit. The new PICIT3 should arrive soon
But VAL CLEAR did the trick.

Now, please, can we go back to steam?
Edited by PeterB 2019-01-07
 
Grogster

Admin Group

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

Apologies - PETER.

I would love to know from Geoff or matherp, if you somehow corrupt the VAR SAVE area of memory, what kind of response you could get back from VAR RESTORE. I would expect that it would fail with some kind of error message, but what would you have to do, or how could you actually manage to corrupt the VAR SAVE area of memory?
Smoke makes things work. When the smoke gets out, it stops!
 
Turbo46

Guru

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

Sorry Peter,

You don't say what, if any error messages you got but:

I had a problem with VAR SAVE corrupting communications using COM2. Geoff said that the interrupts are disabled while writing to (and I guess reading from) flash memory. if that helps.

I believe flash memory is not very large I'll RTFM later to check but I guess that it would be easy to fill, say with text strings.

Bill

Edit: The Manual says:
  Quote  Because the Micromite does not necessarily have a normal storage system (such as an SD card) it needs to have a facility to save some data that can be recovered when power is restored. This can be done with the VAR SAVE command which will save the variables listed on its command line in non volatile flash memory. The space reserved for saved variables is 2KB on the standard Micromite and 4K on the Micromite Plus.
Edited by Turbo46 2019-01-07
Keep safe. Live long and prosper.
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 12:45am 06 Jan 2019
Copy link to clipboard 
Print this post

Sorry.

For VAL read VAR

Peter
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 12:17pm 06 Jan 2019
Copy link to clipboard 
Print this post

  Grogster said  I would love to know from Geoff or matherp, if you somehow corrupt the VAR SAVE area of memory, what kind of response you could get back from VAR RESTORE. I would expect that it would fail with some kind of error message, but what would you have to do, or how could you actually manage to corrupt the VAR SAVE area of memory?

I don't have an answer to this because the VAR storage should not get corrupted and I have not seen that in normal use.

I have seen an issue where with a chip programmed with a complete image (interpreter + BASIC program) can generate an error on the first VAR RESTORE. Because it is such a special case and VAR CLEAR permanently fixes the issue it has been languishing at the bottom of my todo list.

This might be the same as the subject of this thread but it is difficult to say without a clear description of the fault and the environment.
Geoff Graham - http://geoffg.net
 
PeterB
Guru

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

G'Day Geoff and thanks.

That does sound like it and I still have three new chips in the tube to play with when I pluck up the courage.
My problem was, is it the code , the chip or the hardware?

Peter
(for Grogster)
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 09:25pm 07 Jan 2019
Copy link to clipboard 
Print this post

I know some people don't really like smilies, but they really ARE useful, so you know the mood of the poster. Without them....well....you can see how I totally mistook your sarcastic poke at me in your first reply.

Personally, I probably over-use the smilies!
Smoke makes things work. When the smoke gets out, it stops!
 
PeterB
Guru

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

There was / is no "sarcastic poke"
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 11:12pm 07 Jan 2019
Copy link to clipboard 
Print this post

Just when you thought it was safe to go back into the water,
I'm back.

Using a new chip and loading MMBasic and my program.
First attempt to run program gave:
[32] VAR RESTORE
Error: Variable name

I then removed VAR RESTORE from my code
It ran OK until I pressed a button which does a VAR SAVE and then I got:
CPU exception #7 at address 0x9D02EF05
Processor restarted

I have not done a VAR CLEAR but I know it will work (I hope)

Peter

p.s. I am using, for the first time, I2C to drive a 16x2 LCD display. I hope that is not part of it.
P
 
Turbo46

Guru

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

Hi Peter,

Someone had that same problem not that long ago. I can't find the post right now but I think it was fixed by upgrading to the latest firmware.

Bill

Edit: found it! here Edited by Turbo46 2019-01-09
Keep safe. Live long and prosper.
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 11:32pm 07 Jan 2019
Copy link to clipboard 
Print this post

G'Day Bill

Progress is being made, I knew it would.
I have V5.05.01, perhaps I had better see whats new.
Geoff has contributed also so it is only a matter of time.
The good thing is that it is easy to fix with VAR CLEAR.

I don't understand these thing but then I didn't understand steam engine either.

Peter
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 11:43pm 07 Jan 2019
Copy link to clipboard 
Print this post

G'Day Bill

I just found your edit. Thanks.
I do have an int. but it comes via an opto isolator and that has no input so I don't think it could be that

Peter
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 11:55pm 07 Jan 2019
Copy link to clipboard 
Print this post

Hi Peter,

The interrupt wasn't Palcal's problem either but upgrading to the latest firmware fixed the VAR RESTORE problem. You said you have V5.05.01 but are you running it? If so I'm buggered.

Bill
Keep safe. Live long and prosper.
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 12:00am 08 Jan 2019
Copy link to clipboard 
Print this post

Well that's what I told it to load
I have spent 70 years mucking about with electronics. It hates me.

Peter
 
Turbo46

Guru

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

More likely it's Murphy, he's usually my problem. Maybe if you could post a sub-section of your code that can demonstrate the problem?

It's a long road from the crystal set to here.

Bill
Keep safe. Live long and prosper.
 
palcal

Guru

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

I had a problem with VAR RESTORE the same as you but I was using V5.04.01 and when I upgraded to 5.05.01 the problem was solved.
"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: 12:20am 08 Jan 2019
Copy link to clipboard 
Print this post

I am thinking perhaps I should write a simple bit of code that contains what are the relevant bits but still produces the fault.

I spent years trying to get a crystal set working. Over 50 miles and a poor aerial was too much.
I then spent at least a year trying to get a 1 valve (1K5) radio working without understanding all those spare electrodes needed to be connected.

Peter
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 12:26am 08 Jan 2019
Copy link to clipboard 
Print this post

G'Day PALCAL

My MMplus is V5.04.08
My MM is V5.05.01
But can you believe every thing you read?

Peter
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 06:46am 08 Jan 2019
Copy link to clipboard 
Print this post

I have reduced my program to :

VAR RESTORE

And I still get the error.

Peter

Edit

So then I doubled the length of my program to:

VAR CLEAR
VAR RESTORE

And it works

Geoff! or anybody, HELPPPPPPPP

PeterEdited by PeterB 2019-01-09
 
Turbo46

Guru

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

Can you make it a bit shorter?

Sorry I couldn't resist.


> RUN
> PRINT MM.VER
5.0502
> LIST
VAR RESTORE
>

I have V5.05.02 running but that surely shouldn't matter.

Bill
Keep safe. Live long and prosper.
 
     Page 2 of 7    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025