Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:21 09 May 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

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10065
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: 1139
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: 294
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: 527
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

Regular Member

Joined: 03/11/2020
Location: Germany
Posts: 94
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: 10065
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: 10065
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: 527
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: 527
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: 527
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: 10065
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: 10065
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: 527
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

Regular Member

Joined: 03/11/2020
Location: Germany
Posts: 94
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.
 
Print this page


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