Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 01:36 14 Apr 2021 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: V5.07.00b12 - Various fixes

     Page 1 of 5    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 11:32am 08 Feb 2021
Copy link to clipboard 
Print this post

V5.07.00b12 now available

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Fixes bug in CSUBs when used with OPTION RAM
Fixes bug in 12-bit colour modes missing last column
Fixes bug in edit when using large fonts with low resolution
Initialises the fast counter properly when using SETPIN 18,CIN
Increases the maximum files in a directory to 2000

GUI CURSOR x,y no longer displays the cursor if it is hidden - it just remembers the new location for a subsequent SHOW command

New facility for the fast count. You can now specify a Basic interrupt that will fire when the count exceeds &HFFFFFFFF. This allows you to trigger an interrupt when a specific number of counts have happened. See the example code for how this works

  Quote  
'connect pins 18 and 36
pwm 2,1000,50
setpin 18,cin,myint
pin(18)=&HFFFFFFFF-2047
timer=0
pause 1024
print hex$(pin(18))
do:loop

sub myint
print "done",timer
end sub

Edited 2021-02-08 21:33 by matherp
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 843
Posted: 12:29pm 08 Feb 2021
Copy link to clipboard 
Print this post

My download is coming up as 00b11.bin 30/01/2021.
ChopperP
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1264
Posted: 12:32pm 08 Feb 2021
Copy link to clipboard 
Print this post

Zip file contains V5.07.00b11
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 12:49pm 08 Feb 2021
Copy link to clipboard 
Print this post

Try again - clear cache etc.
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 843
Posted: 01:05pm 08 Feb 2021
Copy link to clipboard 
Print this post

OK on another PC. Thanks
ChopperP
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 912
Posted: 01:13pm 08 Feb 2021
Copy link to clipboard 
Print this post

THANKS Peter!

  Quote  Fixes bug in CSUBs when used with OPTION RAM

Works for me now.

Best regards
Michael
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 02:56pm 08 Feb 2021
Copy link to clipboard 
Print this post

V5.07.00 is getting close to completion. The full list of changes from V5.06.00 is attached below and now also included as a readme.txt file in the download

  Quote  V5.07.00 has major new functionality to make your programming easier including full mouse integration into the filemanager and editor.
First PS2 mice are now supported connected directly to the CMM2. Many current USB mice still support the PS2 protocol and the current Microsoft Basic Optical Mouse is fully tested and recommended.
To make the connection the mouse clock line is connected to pin 33 of the CMM2 and the mouse data to pin 32. Both lines MUST be pulled up to 5V with 4K7 resistors
You can use exactly the same commands and functions to access and use a PS2 mouse as the Hobbytronic mouse except that the channel number for the PS2 mouse is zero

CONTROLLER MOUSE OPEN 0 [,[leftclickinterrupt] [,rightclickinterrupt] [,sensitivity]

Note the new optional sensitivity parameter. This allows you to tune the sensitivity of the Hobbytronic mice I/F by specifying a number between 0 and 10.
0 indicates that the default automaitic sensitivity should be used. Other values will explicitly set the sensitivity as per the Hobbytronic documentation.
For the PS2 mouse the sensitivity can be set between 0 and 8.
Values of 1-4 set the resolution of the mouse to 1,2, 4 or 8 counts/mm. Values 5-8 do the same but in addition enable mouse scaling which gives a non-linear relationship between speed and count.
See https://isdaman.com/alsos/hardware/mouse/ps2interface.htm for more details. NB: not all PS2 mice seem to implement these commands.
New sub-functions
MOUSE( T, 0) This tells you if a PS2 mouse has a scroll wheel (returns 3) or not (returns 0). Only works for PS2 mice (channel 0). For Hobbytronic mice will always return 0
MOUSE( D [,channel])
This allows you to detect a double click of the left mouse button and works for both the PS2 and Hobbytronic mice.
The algorithm say the two clicks must occur between 100 and 500 milliseconds apart.
The report via MOUSE(D) is then valid for 500mSec before it times out or until it is read.

In order to use a mouse in the filemanager and editor you need to tell the firmware to expect a mouse to be available:
OPTION MOUSE channel [,sensitivity]
This says that a mouse is connected to the specified channel (use channel 0 for a PS2 mouse) and the filemanager and editor will then expect and use the mouse.
To disable the mouse in the editor and filemanager use:
OPTION MOUSE OFF

You can enquire the status of the mouse option using MM.INFO(OPTION MOUSE) - reports -1 if no mouse is specified.
The mouse works as you would expect in both applications:

In the filemanager you can:
Left click on a line to position the cursor.
You can use the wheel to scroll up and down the file list
Right click in the top half of the screen to page up
Right click in the bottom half of the screen to page down
Double click to open/run a file (same as typing CR)
If you open an image you can return to the filemanager by left clicking the mouse.


In the editor you can:
Left click to position the edit cursor.
Scroll wheel to move up and down
Left click and hold down then move cursor to a new position and release the left button. The enclosed area will be selected for cut and paste.
Within cut and paste mode you can use the cursor and wheel to change the selection
To exit cut and paste without doing anything right click
Right click in top area of screen to scroll up (except in select mode)
Right click in bottom of screen to scroll down (except in select mode)
Left click at far left to scroll horizontally one character if the screen is scrolled horizontally
Left click at far right to scroll horizontally one character if the line is too long for the display
Double left click at far left to scroll to beginning of line if the screen is scrolled horizontally
Double left click at far right scroll horizontally to the end of line if the line is too long for the display

Fixes bug in CSUBs when used with OPTION RAM
Fixes bug in 12-bit colour modes missing last column
Fixes bug in edit when using large fonts with low resolution
Initialises the fast counter properly when using SETPIN 18,CIN
Increases the maximum files in a directory to 2000
CLS now only clears the serial console when the write page os 1

GUI CURSOR x,y no longer displays the cursor if it is hidden - it just remembers the new location for a subsequent SHOW command

New facility for the fast count. You can now specify a Basic interrupt that will fire when the count exceeds &HFFFFFFFF.
This allows you to trigger an interrupt when a specific number of counts have happened.

New edit font OPTION EDIT FONT VERY LARGE for use with high resolution modes
Changed the horrible serif font 3 to a different one that is the same size

This release also supports a json parsing function. The json string to be parsed must be loaded into a LONGSTRING array
JSON$(array%(),string$) Returns a string representing a specific item out of the JSON input stored in the longstring array%()
e.g.
JSON$(a%(), "name")
JSON$(a%(), "coord.lat")
JSON$(a%(), "weather[0].description")
JSON$(a%(),"list[4].weather[0].description
Examples taken from api.openweathermap.org

Allow the user the ability to select which page(s) are displayed on the screen
Syntax is:
PAGE DISPLAY n [,page]
Normal example of use is:
PAGE DISPLAY 3. This says show on the screen the current contents of page 3.
The command does not impact the current write page
In 12 bit mode you can also use:
PAGE DISPAY 4,1
This sets the page to display for the top layer
The command executes in the next screen blanking period. When a program ends for any reason the normal display page 0 is restored

A new mode 14 is introduced which has the timings for 540P, same 960x540 as mode 12 but with no line duplication. If your monitor can handle it this is the best default mode for a widescreen monitor

Program profiling capability
To turn on or off the profiling use
OPTION PROFILING ON
OPTION PROFILING OFF
This is a permanent option but it defaults to OFF whenever new firmware is loaded.
With profiling on you will see a performance impact of about 5% caused by the profiling data collection which happens at the MMBasic statement level.
In addition you will see a reduction in available variable RAM of 512KB. Note that profiling and OPTION RAM are mutually incompatible.
With profiling enabled you can run your programs as usual and you should see no change in behaviour other than as mentioned above. You can see the way the program has run using the commands
LIST PROFILE
LIST PROFILE CSV
There are 5 comma-separated fields in the output
The first field is the number of times a given statement has been run
The second field is the average time in Microseconds taken to execute the statement
The third field is the crunched statement as stored in memory. This is quoted to make it easier to load into excel etc.
The fourth field is the filename in which the statement appears. This is blank if the statement is in the main program, otherwise it gives the filename of the include file in which the statement is to be found
The fifth and final field gives the line number of the statement in the source file.
When LIST PROFILE CSV is used a file is created in the same directory as the main program with the .BAS extension replaced with .CSV
LIST PROFILE can only be used at the command line
LIST PROFILE CSV can be used in a program allowing you to create and rename multiple files while a program is running if required

new operator for signed shift right
integervariable>>n' for unsigned shift right
integervariable>>>n' for signed shift right

A new fast settick mode is now available:

SETTICK FAST frequency, interruptroutine
This allows you to exceed the current maximum rate of 1 interrupt per millisecond (1000HZ) and has been tested up to 50KHz.
Obviously if the interrupt routine overruns the time available then interrupts will be lost.
If the program is executing a statement that takes longer than the time between interrupts the interrupts will be stacked.

Enhancement is to allow you to select the serial port to be used as the console.
OPTION CONSOLE PORT n
n can be 1, 2, or 3 (default). If this option is set all console output is directed to the specified com port. This allows easier remote operation using a wifi-uart or radio link.
Previously you would have had to remove the MCP2221A chip and connect the external I/F to the USB-B connector.
If the option is set to other than default then COM3 is available on the USB-B connector.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 1312
Posted: 03:40pm 08 Feb 2021
Copy link to clipboard 
Print this post

Looks good Peter,

Any chance of a response to: https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=13417

Best wishes,

Tom
Edited 2021-02-09 01:40 by thwill
CMM2 Welcome Tape, Z-MIM: Zork on the CMM2
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 03:49pm 08 Feb 2021
Copy link to clipboard 
Print this post

Think I did it - please check
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 1312
Posted: 04:02pm 08 Feb 2021
Copy link to clipboard 
Print this post

  matherp said  Think I did it - please check


OK, I've checked my CMM2 (currently running b11) and it does indeed appear to have been fixed, THANKS.

I'm sure I upgraded to and tested with b11 just before writing that post though ... I'm too young to be having senior moments.

Anyway, thanks Peter.

Best wishes,

Tom
CMM2 Welcome Tape, Z-MIM: Zork on the CMM2
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 838
Posted: 01:15am 09 Feb 2021
Copy link to clipboard 
Print this post

Thanks Peter for the Fast Count fix, also for the interrupt capability - exactly what I need for a project I am working on. I understand your statement about implimenting CMM2 stuff into ArmMite H7 but I would really love to see the Fast count preset and interrupt included in it - the CMM2 is fantastic but an overkill for the instrument project I am working on.

Thanks,
Doug.
... all the Maximites, almost all of the MicromMites, all the MM Extremes, all the ArmMites, and loving it!
 
DevineTrash
Newbie

Joined: 15/08/2020
Location: United Kingdom
Posts: 1
Posted: 11:23pm 09 Feb 2021
Copy link to clipboard 
Print this post

I just tried to download but got a "file not found" error  
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 2354
Posted: 11:29pm 09 Feb 2021
Copy link to clipboard 
Print this post

Works for me. Clear browser cache or something.

John
 
Plasmamac

Senior Member

Joined: 31/01/2019
Location: Germany
Posts: 116
Posted: 09:27am 10 Feb 2021
Copy link to clipboard 
Print this post

Thanks a lot  
Plasma
 
Schlowski
Newbie

Joined: 26/03/2014
Location: Germany
Posts: 29
Posted: 08:58am 13 Feb 2021
Copy link to clipboard 
Print this post

Edit: post deleted, error on my side...
Edited 2021-02-13 19:29 by Schlowski
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 10:26am 13 Feb 2021
Copy link to clipboard 
Print this post

V5.07.00b14 now available

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Changes to PAGE DISPLAY

PAGE DISPLAY n [,page]
Normal example of use is:
PAGE DISPLAY 3. This says show on the screen the current contents of page 3.
The command does not impact the current write page
In 12 bit mode you can also use:
PAGE DISPAY 4,1
This sets the page to display for the top layer
The command executes in the next screen blanking period. When a program ends for any reason the normal display page 0 is restored
Note for modes 3 or 5 or 6 or 7 or 12 or 13 you can only select pages 0 or 1 for display in 8 or 16 bit colour and pages 0, 1, or 2 in 12-bit colour

To turn the display off use PAGE DISPLAY -1. To turn it back on select a valid display page - the contents of the video pages are not changed by this command
Edited 2021-02-13 20:32 by matherp
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 10:19am 14 Feb 2021
Copy link to clipboard 
Print this post

V5.07.00b15 now available

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Fixes bug in ON ERROR SKIP allowing errors in one additional command over the number specified


New Sub-commands
SAVE DATA fname$, address, size 'saves "size" bytes to file "fname$" starting from "address". Data is saved in raw binary format
LOAD DATA fname$, address 'loads the raw binary contents of file "fname$" and stores it in memory starting at "address"

Together these allow you to very easily save and restore the contents of an array or video page to and from disk. The code tries to protect you from crashing the system to the extent possible but there are many ways you can misuse the LOAD DATA command if you try
Edited 2021-02-14 20:23 by matherp
 
Plasmamac

Senior Member

Joined: 31/01/2019
Location: Germany
Posts: 116
Posted: 10:57am 14 Feb 2021
Copy link to clipboard 
Print this post

your support is fantastic. thx a lot  
Plasma
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 376
Posted: 01:40pm 14 Feb 2021
Copy link to clipboard 
Print this post

  matherp said  V5.07.00b15 now available
New Sub-commands
SAVE DATA fname$, address, size 'saves "size" bytes to file "fname$" starting from "address". Data is saved in raw binary format
LOAD DATA fname$, address 'loads the raw binary contents of file "fname$" and stores it in memory starting at "address"

Together these allow you to very easily save and restore the contents of an array or video page to and from disk. The code tries to protect you from crashing the system to the extent possible but there are many ways you can misuse the LOAD DATA command if you try


Hi Peter,
this is simply super! It could be done with CSUB, but so it's much easier. Just one suggestion/request: can be in SAVE added flag for append? My favorite for use this is for example SAVE BMP (16 bpp) in the GRF.INC library, where I write header with PRINT# and then I could append chunk of graphic data...
Have a smooth day, Jiri
Napoleon Commander and SimplEd  for CMM2 (GitHub), CMM2.fun
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 721
Posted: 08:53pm 14 Feb 2021
Copy link to clipboard 
Print this post

Is it remotely possible for PAGE DISPLAY to refer to (a section of) the FRAMEBUFFER?

Also, could PAGE WRITE include a numerical value to refer to the FRAMEBUFFER. Maybe, say, 999? Or, gasp, -1? (This would be equivalent to FRAMEBUFFER WRITE.)

Lastly, I am getting an odd error with FRAMEBUFFER WINDOW when FRAMEBUFFER WRITE is active:
mode 2,12   ' 640x400, 7 pages
cls

framebuffer create 1600,400
framebuffer write

line 0,0,1599,399

' uncomment next line to make error go away
'page write 0

x = 0 : dx = 1
do
 framebuffer window x,0,0
 x = x + dx
 if x = 0 or x = 960 then dx = -dx
loop

.
Edited 2021-02-15 06:54 by vegipete
 
     Page 1 of 5    
Print this page
© JAQ Software 2021