Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 19:32 25 Nov 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 : CMM2 V6.00.00 betas

     Page 1 of 4    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10646
Posted: 04:20pm 21 Mar 2025
Copy link to clipboard 
Print this post

Attached is an update to the CMM2 firmware.


CMM2V1.5.zip


This brings the MATHS routines up-to-date with the PicoMite. In addition it implements BYVAL and BYREF in function and subroutine definitions.
Finally, it implements drawing thick diagonal lines

Prior to this release diagonal lines could only be 1 pixel wide. This version implements the ability to specify the line width. Currently horizontal and vertical lines can have a defined width and the x1 and y1 coordinate define the top-left pixel of the thick line. i.e. the line is to the right of the specified position or below it on the screen.

This makes no sense for thick diagonal lines where the line should be centered on the origin pixel. To maintain compatibility with existing code you specify this by setting the width as a negative number as in the example below

Try the attached

Option default none
page write 2
Const sw=-7,mw=-11,hw=-15
Const sl=250,ml=220,hl=180
Const xc=MM.HRES\2,yc=MM.VRES\2
Dim integer t=Epoch(now)
Dim x$=DateTime$(t)
Print x$
Dim integer s,m,h
Do
 show s,sw,sl,0
 show m,mw,ml,0
 show h,hw,hl,0
'  t$=Time$
 s=Val(Right$(x$,2))*6
 m=Val(Mid$(x$,15,2))*6
 h=Val(Mid$(x$,12,2))*30
 show h,hw,hl,RGB(yellow)
 show m,mw,ml,RGB(green)
 show s,sw,sl,RGB(red)
 Circle xc,yc,-mw,,,RGB(blue),RGB(blue)
 page copy 2 to 0,b
 Pause 50
'  Do
'  Loop Until Time$<>t$
Inc t
x$=DateTime$(t)
print @(0,0)x$
Loop
'
Sub show(byval angle As integer, byval w As integer, byval l As integer,  byval col As integer)
 Local integer x=l*Sin(Rad(angle))+xc
 Local integer y=yc-l*Cos(Rad(angle))
 Line xc,yc,x,y,w,col
End Sub



 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1649
Posted: 04:36pm 21 Mar 2025
Copy link to clipboard 
Print this post

 

Math PID included?
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 299
Posted: 04:43am 22 Mar 2025
Copy link to clipboard 
Print this post

good news every day  
My MMBasic 'sand box'
 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 578
Posted: 08:17pm 22 Mar 2025
Copy link to clipboard 
Print this post

Thank you!   I will update my CMM2's and try out right away!
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 05:28pm 23 Mar 2025
Copy link to clipboard 
Print this post

Very nice! Thanks, Peter!
-Bill
 
PilotPirx

Senior Member

Joined: 03/11/2020
Location: Germany
Posts: 105
Posted: 01:15pm 28 Mar 2025
Copy link to clipboard 
Print this post

Hello Peter,

with this version I have problems with my keyboard.
The keyboard is not recognized after a power-on. Even a reset does not help. Very rarely the keyboard is recognized (every 10th - 20th time). A reset to version CMM2V5.07.02b11.bin activates the keyboard again.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10646
Posted: 03:14pm 28 Mar 2025
Copy link to clipboard 
Print this post

  Quote  with this version I have problems with my keyboard.

Oh b....ks.

None of the code in that area has changed. I've just done a compare. The only thing which definitely changed is that ST updated the version of the compiler. I'll look at it but it may take some time.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10646
Posted: 04:27pm 28 Mar 2025
Copy link to clipboard 
Print this post

Please try this version.

CMM2V1.5.zip
 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 578
Posted: 10:19pm 28 Mar 2025
Copy link to clipboard 
Print this post

I don't know if this information is of any help in troubleshooting - but both versions worked fine for me with my generic/cheap USB keyboard.
 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 578
Posted: 12:03am 29 Mar 2025
Copy link to clipboard 
Print this post

Aha - I spoke too soon - now I have some weird rectangles on my graphics pages. I've highlighted some in the screenshot below with arrows.


I have guests arriving in a couple of minutes, so can't investigate further tonight - but will try and provide more data tomorrow. This was with the second firmware you posted, but I'll test tomorrow with the first one.


 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 578
Posted: 06:10pm 29 Mar 2025
Copy link to clipboard 
Print this post

  matherp said  Please try this version.

CMM2V1.5.zip


I've just finished my testing. I verified these results on two separate Gen 2 CMM2's (with separate SD cards) - and they did the same things.

I also tried doing a "full chip erase" before writing from STM32Cube and that didn't help.

I have the "Verify after programming" option checked.

With the original firmware 5.07.01.bin the corrupted video effect does not happen.

With the first firmware you posted on this thread, the video corruption effect does not occur.

With the second firmware you posted on this thread, the video corruption does occur.

I have toggled back and forth between original firmware and latest a few times on the two machines and the results are consistent.

The test program I am using is below, and the issue appears to occur when I load an image. I tried both JPEG and PNG and both exhibit the same problem.

The corruption is random though. If I put the LOAD JPG within the DO-LOOP, then the location and colours of the corrupted image change with each loop.


'MODE 1,16 ' 800x600
PAGE WRITE 1
LOAD JPG "img\crt3.jpg"
PAGE DISPLAY 1
DO:LOOP


The is the crt3.jpg file I am using

crt3.zip

And this is an example of what it looks like when loaded by the new firmware



To be clear, the old firmware still works 100% fine, so I am very very happy to carry on using that. I just thought this info might help.
Edited 2025-03-30 04:11 by PeteCotton
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10646
Posted: 06:56pm 29 Mar 2025
Copy link to clipboard 
Print this post

Thanks to your info I think I know the issue. The codebase has grown so I have had to
use a different compiler optimisation to keep the size of the binary down. Looks like something is not always completing in time. So I need to track down what and look to recode or re-optimise that bit.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10646
Posted: 06:56pm 07 Apr 2025
Copy link to clipboard 
Print this post

@PeteCotton

Hopefully this fixes the issue. Please erase all flash in STM32CubeProgrammer before re-programming.

CMM2V6.00.00b2.zip
 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 578
Posted: 07:41pm 07 Apr 2025
Copy link to clipboard 
Print this post

  matherp said  @PeteCotton

Hopefully this fixes the issue. Please erase all flash in STM32CubeProgrammer before re-programming.

CMM2V6.00.00b2.zip


Thanks! Yes, preliminary testing seems to show that it works great. I will give it a good workout this evening.

Thank you once again!

Pete
 
PilotPirx

Senior Member

Joined: 03/11/2020
Location: Germany
Posts: 105
Posted: 07:22am 08 Apr 2025
Copy link to clipboard 
Print this post

  matherp said  @PeteCotton

Hopefully this fixes the issue. Please erase all flash in STM32CubeProgrammer before re-programming.

CMM2V6.00.00b2.zip

Thank you! I try to test it the next days.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10646
Posted: 07:55am 02 Oct 2025
Copy link to clipboard 
Print this post

V6.00.00b4

CMM2V6.00.00b4.zip
  
Includes changes to improve stability of USB keyboard - thanks to disco4now

Includes the new TRIM$ function

TRIM$(source$ [,mask$] [,where/where$])

This function can remove characters from the beginning or end of a string or both
source$ is the input string
mask$ is a string containing a list of character to be removed. If omitted it defaults to space
where/where$ can be L, R, or B or a string beginning with L, R, or B to specify characters should be removed from the left of the source, the right of the source or both. If omitted defaults to L

Enhancement to 3D modelling

Rendering of the 3D object works by Painters algorithm. This works by sorting the faces and drawing those further away first. In addition the MMBasic firmware supports "back face culling". This doesn't draw faces that are pointing away from the camera. In order to sort the faces the current MMbasic code uses the Z axis position of the face centroid. This works in many situations but in some 3D models it is better to use the furthest vertex and sort on that. I've added that as an option to DRAW3D SHOW and DRAW3D WRITE
DRAW3D SHOW n, x, y, z [,nocull][,usefurthest]
DRAW3D WRITE n, x, y, z [,nocull][,usefurthest]


set 1 to use the furthest vertex and zero (default) to use the centroid.
Edited 2025-10-02 20:34 by matherp
 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 578
Posted: 11:31pm 05 Oct 2025
Copy link to clipboard 
Print this post

  matherp said  V6.00.00b4
....
Enhancement to 3D modelling

Rendering of the 3D object works by Painters algorithm. ....


Thanks once again Peter!

I got a chance to test it out this afternoon, and it's working great!


 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1060
Posted: 05:58am 09 Nov 2025
Copy link to clipboard 
Print this post

V6.00.00b6

CMM2 V6.00.00 Beta6 Update
AUTOSAVE N filename  for fast loading with no echo.
TURTLE command updated to Peters new enhanced version
SORT command has an addition option.


CMM2V6.00.00b5.zip

CMM2 V6.00.00 Pre Beta5 Recap
Peter has already added much functionality from the Picomite enhancements.
TRIM$,
Updated MATH commands and Functions etc
Functions MM.HRES, MM.VRES, MM.VER, M.I2C, MM.FONTHEIGHT, MM.FONTWIDTH, MM.HPOS, MM.VPOS, MM.ONEWIRE, MM.Errno, MM.ErrMsg$, MM.WATCHDOG, MM.DEVICE$,MM.WIDTH,MM.HEIGHT
are now all implemented as written and none of them are converted to MM.INFO calls by the pre-processor
MATH PID command and function added.
BYVAL and BYREF qualifiers added to SUB and FUNCTION definitions.
MM.CMDLINE$ is now a function and does not need to create a variable.


CMM2 V6.00.00 Beta5 Update

I was hoping to have a bit more documentation of the updates, but that will now come with beta 6.
For now you can look at Picomite or ARMMite H7 manuals for some of the new commands, syntax enhancements.

This is a summary of some of it.

Firmware is again compiled for speed (-O2) in lieu of size so performance should be restored to original or better.
See some benchmarks at bottom of this page.

The allocation of the internal heap memory is enhanced so memory required to execute commands, SUBs and Functions is allocated from the bottom up and does not have to search past memory previously allocated to variables from top down. This can offer significant performance improvement when many variables are allocated.

BYVAL/BYREF updated to latest fix in Picomite.
getInt() accepts 64bit integers Fix

LINE command enhanced. LW given as -LW will set LW in all directions
LINE AA command added as per picomites
LINE GRAPH command added as per picomites
LINE PLOT command added as per picomites
MATH C_ADD etc commands that act on cells added as per picomites.
MATH C_OR etc commands that act on cells added as per picomites.
MATH C_XOR etc commands that act on cells added as per picomites.
MATH C_AND etc commands that act on cells added as per picomites.

CAN [OPEN|CLOSE|START|STOP|FILTER|SEND|READ] commands added
MM.INFO$(ID)  Returns the unique hex 12 byte ID of the Armmite chip as a string.
MM.INFO(ID48) Returns a 48bit hash of the ID as an integer. Not guaranteed unique world wide but most likely unique for a hobbyist. Suitable as a serial no. for the device and at 6 bytes fits inside a CAN message. See ARMmite H7 Manual for details.

SHIFT F3-F8 Added for VT100 terminal as per picomite 6.00.02B0
//NB: SHIFT F1, F2, F9, F10, F11, and F12 don't appear to generate anything
USBKeyboard mappings corrected so that SHIFT+(F1-F12) resolve to correct codes
i.e. 0xB1- 0xBC in lieu of 0xD1-0xDC. See Picomite or ARMMite H7 Manual

* shortcut for RUN can now call the current program without including the filename.
commandline parameters can also be passed without using filename.
e.g
*
* --base0

LONGSTRING PRINT allows ; to suppress CRLF

MID$ command now allows replacement of different length string
INSTR function now optionally allows Regex expression as search string
LINSTR function now optionally allows Regex expression as search string
REGEX uses different library. GPL licence incompatible with STM licence. See ARMmite H7 manual for syntax.

These are some notes I made when looking at how the CMM2 works.Might be of interest to some.
CMM2 Firmware and MMBasic Memory Map.pdf


Regards
Gerry
Edited 2025-11-14 16:43 by disco4now
F4 H7FotSF4xGT
 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 578
Posted: 10:19pm 09 Nov 2025
Copy link to clipboard 
Print this post

  disco4now said  
Peter has given me the CMM2 firmware to look after.......

Regards
Gerry


Thank you  

And very interesting memory map. Thanks for that as well.
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 498
Posted: 09:31pm 17 Nov 2025
Copy link to clipboard 
Print this post

  disco4now said  V6.00.00b6

CMM2 V6.00.00 Beta6 Update
...
Gerry


Hi Gerry,

Peter referred me to this thread.

Can you tell me where I can find the b6?

I'm having problems with my keyboard on the cmm2 g2 and the beta (see also the other thread https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=18446 ).

The cmm2 is also causing problems with the game Knightmare by Leonicolas with MOD playback.

Can you help here?

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