Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : CMM2 V6.00.00 betas

Posted: 04:20pm
21 Mar 2025
Copy link to clipboard
matherp
Guru

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




 
Posted: 04:36pm
21 Mar 2025
Copy link to clipboard
PhenixRising
Guru

 

Math PID included?
 
Posted: 04:43am
22 Mar 2025
Copy link to clipboard
electricat
Senior Member


good news every day  
 
Posted: 08:17pm
22 Mar 2025
Copy link to clipboard
PeteCotton
Guru


Thank you!   I will update my CMM2's and try out right away!
 
Posted: 05:28pm
23 Mar 2025
Copy link to clipboard
William Leue
Guru

Very nice! Thanks, Peter!
-Bill
 
Posted: 01:15pm
28 Mar 2025
Copy link to clipboard
PilotPirx
Senior Member


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.
 
Posted: 03:14pm
28 Mar 2025
Copy link to clipboard
matherp
Guru

  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.
 
Posted: 04:27pm
28 Mar 2025
Copy link to clipboard
matherp
Guru

Please try this version.

CMM2V1.5.zip
 
Posted: 10:19pm
28 Mar 2025
Copy link to clipboard
PeteCotton
Guru


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.
 
Posted: 12:03am
29 Mar 2025
Copy link to clipboard
PeteCotton
Guru


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.


 
Posted: 06:10pm
29 Mar 2025
Copy link to clipboard
PeteCotton
Guru


  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
 
Posted: 06:56pm
29 Mar 2025
Copy link to clipboard
matherp
Guru

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.
 
Posted: 06:56pm
07 Apr 2025
Copy link to clipboard
matherp
Guru

@PeteCotton

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

CMM2V6.00.00b2.zip
 
Posted: 07:41pm
07 Apr 2025
Copy link to clipboard
PeteCotton
Guru


  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
 
Posted: 07:22am
08 Apr 2025
Copy link to clipboard
PilotPirx
Senior Member


  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.
 
Posted: 07:55am
02 Oct 2025
Copy link to clipboard
matherp
Guru

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
 
Posted: 11:31pm
05 Oct 2025
Copy link to clipboard
PeteCotton
Guru


  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!


 


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