Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:05 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 : ArmmiteH7 V5.07.00b6 - Major performance hike

     Page 1 of 3    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 01:05pm 25 Apr 2021
Copy link to clipboard 
Print this post

ArmmiteH7V5.07.00b6.zip

This has the variable hash table look-up from the CMM2. This should give 30-40% improvement in performance

e.g

Solar eclipse calculation
V5.05.11 23.73 seconds
V5.07.00b5 16.91 seconds
V5.07.00b6 10.86 seconds
 
gadgetjack
Senior Member

Joined: 15/07/2016
Location: United States
Posts: 169
Posted: 05:57pm 25 Apr 2021
Copy link to clipboard 
Print this post

This version fixed the keyboard error and runs faster!!! Damn , you are good Peter.
Only error I have found is if you type MEMORY , you get a hard interrupt failure. First I have ever seen that. Not a deal breaker , rest seems ok. Thank you for all the effort you are putting in this. Printing a new case for this as we speak.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 07:00pm 25 Apr 2021
Copy link to clipboard 
Print this post

  Quote  Only error I have found is if you type MEMORY , you get a hard interrupt failure.


Thanks for the report - please try this


ArmmiteH7V5.07.00b7.zip
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 08:31pm 25 Apr 2021
Copy link to clipboard 
Print this post

In the morning, I will dig out my H7 and blow this new f/w into it - use it as my go-to for a while to exercise things a bit...
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 09:59pm 25 Apr 2021
Copy link to clipboard 
Print this post

Beta 7 is looking good.
Thanks Peter.

Jim
VK7JH
MMedit
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 11:02pm 25 Apr 2021
Copy link to clipboard 
Print this post

Just loaded Beta 7.

Keyboard now works.

I loaded my test program from the SD card, loads ok, type RUN and the program will not run and the H7 locks, no screen output, no CRL-C break, no Terminal coms. Tried both the V1 and V2 of the H7, both lock solid and need a hard reset or power cycle.

All options list correctly.
All MM info status queries return correctly.

GUI calibrate is fine.
GUI test is fine.

Here are the memory and options display from the Z1 Test unit, notice this program is not small, it ran perfectly with the first 3 test versions of the updated firmware, Beta 7 broke it, I will do more testing on smaller programs when I get a chance.

Program appears to List correctly.


MEMORY
Flash:
218K (56%) Program (8819 lines)
166K (44%) Free

RAM:
  0K ( 0%) 0 Variables
  0K ( 0%) General
555K (100%) Free
>

Option List
OPTION COLOURCODE ON
OPTION DISPLAY 36,100
OPTION LCDPANEL SSD1963_8_16, LANDSCAPE
OPTION TOUCH 56, 123
OPTION FLASHPAGES 2
OPTION SDCARD 87
OPTION LCDPANEL CONSOLE
OPTION CONTROLS 300
OPTION USBKEYBOARD US, 91
>


Mike.
.
Edited 2021-04-26 09:03 by KeepIS
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 11:22pm 25 Apr 2021
Copy link to clipboard 
Print this post

Loaded a smaller 43K program for a graphical Alarm clock.

Program ran and graphics all work, seconds hand is ballistic so likely changes to the code need to be made to accommodate some upgrades / changes in MM.basic.

Fixed the problem by adding OPTION MILLISECONDS OFF.

This program now runs correctly  

Tried to EDIT the file:

Editor works ok and I can traverse the file.

Commented out a line and pressed F2

Display said saving 3 bytes.  ??????

List returns nothing but a cursor.

The program no longer exists in memory  

Mike.
Edited 2021-04-26 11:57 by KeepIS
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 02:03am 26 Apr 2021
Copy link to clipboard 
Print this post

I thought I had another problem but it looks like a memory issue with the size of the loaded bitmap, thought I'd post it anyway.

The Alarm clock is currently running, I stop the program using CTRL-C.

Type Files and:


files
Error : Not enough memory

>  CPU RESTART

>  files

A:/
  <DIR>  AUTOMATE
  <DIR>  CLOCK
  <DIR>  DROSetup
  <DIR>  JOBS
   252661  AGV3.BAS
4 directories, 1 file

>  RUN

!!!!! I Stopped running program again via CTRL-C

>  files

Error : Not enough memory

>  MEMORY
Flash:
 36K ( 9%) Program (1428 lines)
348K (91%) Free

RAM:
 21K ( 3%) 130 Variables
390K (70%) General
144K (27%) Free
>  


Obviously CPU-RESTART releases all RAM used by the program and so the files cmd works again.

Mike.
.
Edited 2021-04-26 12:09 by KeepIS
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 02:13am 26 Apr 2021
Copy link to clipboard 
Print this post

  Quote  Fixed the problem by adding OPTION MILLISECONDS OFF.

I noticed that milliseconds was on also.
I put it down to a leftover from a program I had just run but it looks like it now defaults to MILLSECONDS ON.

Jim
VK7JH
MMedit
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 02:15am 26 Apr 2021
Copy link to clipboard 
Print this post

After loading the main large test program:



> MEMORY
Flash:
218K (56%) Program (8819 lines)
166K (44%) Free

RAM:
1266532K (1485%) 1012 Variables
  0K ( 0%) General
4293701319K  (-1385%) Free



After restart:


>  MEMORY
Flash:
218K (56%) Program (8819 lines)
166K (44%) Free

RAM:
  0K ( 0%) 0 Variables
  0K ( 0%) General
555K (100%) Free
>


Mike.
.
Edited 2021-04-26 12:15 by KeepIS
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 03:21am 26 Apr 2021
Copy link to clipboard 
Print this post

  Quote  
I noticed that milliseconds was on also.
I put it down to a leftover from a program I had just run but it looks like it now defaults to MILLSECONDS ON


Yes certainly seems like that, knew it would be something simple and the first thing I thought of was the returned time string was now including MS and remembered the Option for that.

Whish my main program was as easy to fix, really hard when the inbuilt editor keeps deleting the loaded image. I get the feeling there is something happening in the token  "speed change" area of beta 7? stopping the program?

Mike.
.
Edited 2021-04-26 13:21 by KeepIS
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 04:25am 26 Apr 2021
Copy link to clipboard 
Print this post

I loaded the main test file, compared the listing to the disk image and they were identical with the exception of a few leading case changes for if, then, else, etc.

I placed a few print statement in the file:

1: The beginning of the variable declarations.

2: The end of the variable decelerations.

3: The end of the GUI definitions.

The only print statement executed was 1, it never got past variable decelerations.

Looks like some kind of memory or tokenised corruption issue.

I can't do more that this.

I can confirm the loss of the file from memory when in the editor if any change is made to the file and it's saved or run from the editor.  

Mike.
.
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 06:00am 26 Apr 2021
Copy link to clipboard 
Print this post

My FTP server program runs well. The only changes were to a few pin numbers and com port choice.

There is definitely a problem with the MEMORY command.

After NEW and CPU RESTART, the memory looks correct.
After loading the FTP server program but before running, the memory RAM results are way out.
After running the program and exiting cleanly, the memory command is correct again.
> new
> memory
Flash:
  0K ( 0%) Program (0 lines)
256K (100%) Free

RAM:
  0K ( 0%) 0 Variables
  0K ( 0%) General
562K (100%) Free
> cpu restart

> memory
Flash:
  0K ( 0%) Program (0 lines)
256K (100%) Free

RAM:
  0K ( 0%) 0 Variables
  0K ( 0%) General
562K (100%) Free

' load a program

Saved 22526 bytes
> memory
Flash:
 22K ( 8%) Program (1049 lines)
234K (92%) Free

RAM:
1460177K (6072%) 403 Variables
  0K ( 0%) General
4293507681K (-5972%) Free
>

' run the program
Shutting down...
> memory
Flash:
 22K ( 8%) Program (1049 lines)
234K (92%) Free

RAM:
 16K ( 2%) 55 Variables
  0K ( 0%) General
546K (98%) Free
>


Jim
VK7JH
MMedit
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 08:24am 26 Apr 2021
Copy link to clipboard 
Print this post

ArmmiteH7V5.07.00b8.zip

Fixes the memory command - this was just a silly artifact and didn't represent an underlying problem

Defaults milliseconds correctly

Fixes ERASE and CLEAR commands

Fixes EDIT

Mike:
I can't do anything about your issue if it still exists in this version unless you let me have the code to work with. The biggest program I have is much smaller than yours. Send me a PM if you don't want to post online.
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 09:43am 26 Apr 2021
Copy link to clipboard 
Print this post

  matherp said  

Mike:
I can't do anything about your issue if it still exists in this version unless you let me have the code to work with. The biggest program I have is much smaller than yours. Send me a PM if you don't want to post online.


Thanks for fixing the Editor, I've been using it to narrow down the problem.

The problem is the number of variables.

If I comment out about 8 to 10 lines of DIM statements, the GUI loads and the program runs until a missing variable is encountered.

I cut out just the variable declarations and placed them in a file with a Print "END" statement followed by END. The same error is encountered, comment out some variables and when enough have been commented out the simple Print "END" statement is reached and the header .BAS file drops to the cursor without locking up the H7.

I can send you this header if you like, but it is simply locking after a certain number of variables. There are around 1300 variables, the header is 15K in size.

Mike.
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 09:54am 26 Apr 2021
Copy link to clipboard 
Print this post

Mike

This is a major issue where you may need to stick with the earlier firmware or do some major rework.

The hashing mechanism allows for up to 512 global variables and 512 local variables. On the CMM2 no-one has come up against this limit.

This allocates 64Kb of memory for the variables (memory for arrays is separate)

Note also that with more than about 256 variables performance will start to drop because of hash key conflicts

Your code with so many variables is also very inefficient with the original firmware as variable location is a sequential search. Using array elements would probably be quicker
Edited 2021-04-26 20:01 by matherp
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 10:03am 26 Apr 2021
Copy link to clipboard 
Print this post

Dam, I'm about 74 variables over, doubt I can drop that many, I assume if not using many local variables then global variables can use remaining memory allocation or am I barking up the wrong tree?

Mike.
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 10:07am 26 Apr 2021
Copy link to clipboard 
Print this post

No, the limit is fixed in each category. Maximum 512 global variables and up to 512 local variables active at any one time in any nested structure of calls.
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 10:15am 26 Apr 2021
Copy link to clipboard 
Print this post

Ok understand, I'm including all constants in that count and it's strange that I'm only 70 old over 512, I'll have to go back and count them manually.

BTW, I understand the slowness of the number of variables, but in this case the variables used in the high speed part of the code are around 60 and are placed and named with a common unique starting character at the start of the file, the rest are used in setup screens, so speed is of no consequence in this part of the code. The application (machine automation part) runs very very fast in the previous version.

Of course with the way the CMM2 works this may well be very inefficient as you point out.

Thanks for the information.

Mike.
Edited 2021-04-26 20:16 by KeepIS
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 10:24am 26 Apr 2021
Copy link to clipboard 
Print this post

Hi Peter,

So far I've come nowhere near the CMM2 limits and 512 globals sounds "excessive" considering the CMM2's target use. However I assume that global CONSTs count against that limit and I can imagine use cases for lots of those (to emulate enumerations for example). Use of those can I think be mitigated by using #define (is that present on the Armmite ?) but we only have 64 of those, perhaps you might increase that limit - just a thought, like I say I'm nowhere near that limit and will probably have wandered off into Forth and excessive CSUB usage before getting there.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
     Page 1 of 3    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025