![]() |
Forum Index : Microcontroller and PC projects : CMM2 V6.00.00 betas
Author | Message | ||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10065 |
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 KingdomPosts: 1139 |
![]() ![]() Math PID included? |
||||
electricat![]() Senior Member ![]() Joined: 30/11/2020 Location: LithuaniaPosts: 294 |
![]() ![]() My MMBasic 'sand box' |
||||
PeteCotton![]() Guru ![]() Joined: 13/08/2020 Location: CanadaPosts: 527 |
Thank you! ![]() |
||||
William Leue Guru ![]() Joined: 03/07/2020 Location: United StatesPosts: 405 |
Very nice! Thanks, Peter! -Bill |
||||
PilotPirx![]() Regular Member ![]() Joined: 03/11/2020 Location: GermanyPosts: 94 |
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 KingdomPosts: 10065 |
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 KingdomPosts: 10065 |
Please try this version. CMM2V1.5.zip |
||||
PeteCotton![]() Guru ![]() Joined: 13/08/2020 Location: CanadaPosts: 527 |
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: CanadaPosts: 527 |
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: CanadaPosts: 527 |
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 KingdomPosts: 10065 |
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 KingdomPosts: 10065 |
@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: CanadaPosts: 527 |
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: GermanyPosts: 94 |
Thank you! I try to test it the next days. ![]() |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |